[Dovecot] how to deliver when username and email differ

Timo Sirainen tss at iki.fi
Sat Oct 20 23:19:33 EEST 2007


On Sat, 2007-10-20 at 09:42 -0400, Cory Coager wrote:
> 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))

Using "mail=user" instead of plain "mail" would make this more
understandable. Also v1.1 won't anymore work unless you do this.

mail=%n@%d is exactly the same as mail=%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?

So you'd want %n part to be taken from sAMAccountName, but %d taken from
mail (or just kept as-is)? Not possible, but I just added "username" and
"domain" fields for v1.1 which allow modifying them separately.

You could probably do this with aliases in your SMTP server.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20071020/bffc680a/attachment.bin 


More information about the dovecot mailing list