configuration for postfix when using dovecot/lmtp + ldap

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

configuration for postfix when using dovecot/lmtp + ldap

Felix Rubio
Hi everybody,

I have a postfix server that is serving two domains, a main domain
(domainA.org) and a hosted domain (domainB.org), that is using dovecot
for authentication and lmtp. I have set up an openldap to be used as a
backend for the managed identities. Currently, all @domainB.org
addresses are aliases to a @domainA.org address.

This works as expected, but the configuration I have in place is a bit
different from those I have found around on the internet, and I hoped
somebody from the list could advise if what I have in place makes sense
or not. Can you guys give it a look?

In main.cf I have:
     virtual_alias_domains =
     virtual_mailbox_domains = domainA.org domainB.org
     virtual_mailbox_maps = ldap:/etc/postfix/virtual/ldap_user_maps.cf
     virtual_alias_maps = ldap:/etc/postfix/virtual/ldap_alias_maps.cf,
ldap:/etc/postfix/virtual/ldap_user_maps.cf

in ldap_user_maps.cf, I have:
     query_filter =
(&(objectClass=inetOrgPerson)(memberOf=cn=mail,ou=Groups,dc=domainA,dc=org)(mail=%s))
     result_attribute = mail

in ldap_alias-maps.cf, I have:
     query_filter =
(&(objectClass=inetOrgPerson)(memberOf=cn=mail,ou=Groups,dc=domainA,dc=org)(mailacceptinggeneralid=%s))
     result_attribute = mail

The reason for me questioning this setup, although seems to work, is
that I have virtual_alias_domains empty, while I have set
virtual_mailbox_domains with all the domains being served. This is
different from every setup I have seen: in virtual_alias_domains I have
always seen an ldap lookup for the incoming mail domain in the mail and
mailacceptinggeneralid attributes of the ldap records and in
virtual_mailbox_domains only the main domain (domainA.org), but I set
the first up I get 'user unknown in virtual user table' errors and if I
do not set the second I get 'relay not allowed' errors.

Can somebody give me some advice on whether this is a correct set-up/how
to get it fixed?

Thank you!

--
Felix Rubio
"Don't believe what you're told. Double check."