[Dovecot] how to deliver when username and email differ

Cory Coager ccoager at utechproducts.com
Sat Oct 20 16:42:16 EEST 2007


I have an Active Directory virtual setup and am using LDA to deliver to
local recipients.  Today I found a big problem with my configuration and
not sure if this is fixable.  Some of the users have multiple email
addresses and the %n variable for user doesn't match their actual
username.  So if I have realname "Joe Bob" with a username of "joe" and
an email of "jbob at somewhere.com", deliver will try to deliver to "jbob"
and this is wrong.  Here is the relevant part of my ldap config:

user_attrs = mail,postOfficeBox=home
user_filter = (|(mail=%n@%d)(proxyAddresses=%n@%d)(sAMAccountName=%u))
pass_attrs = mail,postOfficeBox=home
pass_filter = (|(mail=%n@%d)(proxyAddresses=%n@%d)(sAMAccountName=%u))

Somehow I need to change the username from the LDAP lookup but it seems
that the mail attribute does this already.  If I switch the mail
attribute with sAMAccountName the domain becomes NULL.  Anyone know if
this is fixable?


More information about the dovecot mailing list