LDAP and SQL are complex systems. Trying to set up both Postfix
and LDAP or SQL at the same time is definitely not a good idea.
You can save yourself a lot of time by implementing Postfix first
with local files such as Berkeley DB. Local files have few surprises,
and are easy to debug with the
postmap(1) command:
% postmap -q [email protected] hash:/etc/postfix/virtual
Once you have local files working properly you can follow the
instructions in
ldap_table(5),
mysql_table(5) or
pgsql_table(5)
and replace local file lookups with LDAP or SQL lookups. When you
do this, you should use the
postmap(1) command again, to verify
that database lookups still produce the exact same results as local
file lookup:
% postmap -q [email protected]
ldap:/etc/postfix/virtual.cf
Be sure to exercise all the partial address or parent domain
queries that are documented under "table search order" in the
relevant manual page:
access(5),
canonical(5),
virtual(5),
transport(5), or under the relevant configuration parameter:
mynetworks,
relay_domains,
parent_domain_matches_subdomains.