Score:1

Postfix LDAP aliases - user unknown

np flag

I have server POSTFIX + DOVECOT with LDAP (ActiveDirectory) authorization.

/etc/postfix/ldap_virtual_mailbox_maps.cf

query_filter = (&(objectClass=person)(mail=%s))
result_filter = %s
result_attribute = mail

/etc/postfix/ldap_virtual_alias_maps.cf

query_filter = (&(objectClass=person)(othermailbox=%s))
result_attribute = othermailbox

/etc/dovecot/dovecot-ldap.conf.ext

pass_filter = (&(objectCategory=Person)(sAMAccountName=%n))
user_filter = (&(objectCategory=Person)(sAMAccountName=%n))

The email specified in the attribute "mail" works (users can send and receive messages). I specify an alias in the attribute "othermailbox" (for example - [email protected]).

    # postmap -q [email protected] ldap:/etc/postfix/ldap_virtual_alias_maps.cf
    [email protected]

When I send an email to this address ([email protected]) then get "Undelivered Mail Returned to Sender"

The mail system [email protected]: user unknown

What am I doing wrong ? I will be grateful for comments.

Score:0
fr flag
anx

I suspect the result_attribute in your ldap_virtual_alias_maps.cf is not what you meant to configure. A virtual_alias_maps result that just the returns the lookup key by itself is not very useful (that feature is meant to alias one address to other addresses).

Usually, it would look up by the additional address (your field othermailbox), but it would still return the primary address (your field mail). You may want something like this.

# lookup by othermailbox
query_filter = (&(objectClass=person)(othermailbox=%s))
# but return primary address
result_attribute = mail

If you tell Postfix that [email protected] is an alias for [email protected].. that does not tell Postfix where the mail should go. Because the (unchanged) destination [email protected] is still not a known user.

np flag
Brilliant! That helped. Thanks for the help.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.