Lmtp w/ Postfix and LDAP: change mailbox name when saving mail.
dwhite at olp.net
Wed Jan 21 10:07:27 EST 2009
k bah wrote:
> On my LDAP server, the uid field of each user (person) is: "username~domain.org".
> I correctly set up cyrus and saslauthd to authenticate with the username as the LDAP field above. A simple Horde hook does the job to make "user at whatever domain he/she typed" into "user~whatever domain...".
> When authenticating, if the mailbox does not exist it gets created (autocreatequota is nonzero on imapd.conf). The mailbox is created following that naming convention (username~domain..).
> Is it possible to (automatically) create mailboxes with that naming convention? I want cyrus to save mail to "username~domain.org" instead of "username".
You can use the ldapdb user canonicalization patch for SASL (See CVS)
for situations like this. It won't automatically created mailboxes, but
it will direct cyrus IMAP to use an alternative name before referencing
Where 'lmtp' matches the name you use within /etc/cyrus.conf. This would
direct cyrus imap, after authenticating, to look up the 'uid' attribute
within LDAP, and use it as the effective username (and mailbox name).
You would not need to change your authentication setup from saslauthd to
ldapdb auxprop, since auxprop plugins and user canonicalization plugings
can function independently.
See the '/doc/options.html' documentation for cyrus SASL for more
options (in CVS).
More information about the Info-cyrus