[email protected]: > Hi, > > I have inherited a postfix MDA that I'm just trying to understand and we > currently have a problem with the forwarding of emails using LDAP lookups. > > Currently an email is forwarded if it matches the below map: > > virtual_alias_maps = ldap:ldapforward > ldapforward_query_filter = > (&(|(mail=%s)(mailalternateaddress=%s))(mailforwardingaddress=*)) > ldapforward_result_attribute = mailforwardingaddress > > Now if we have the following 2 LDAP users: > > [email protected] > > [email protected] > [email protected] > [email protected] > > The initial lookup doesnt match against bob as he has no mailforward, > but then the postfix catchall lookup matches against the 2nd address and > forwards the email that should of gone to bob. > > Whats the solution for this setup? How do I stop LDAP filters matching > the catchall mailbox when a more specific one exists without a mailforward?
This requires a one-to-one virtual alias mapping: [email protected] -> [email protected] By design, virtual aliasing stops when a right-hand side address matches the left-hand side (of course it also stops when a right-hand side address fails to match the virtual alias table). Wietse
