On Mon, Jun 29, 2020 at 08:15:36PM +0300, Dima Veselov wrote:

> I have a domain, let's say example.com and my virtual users (stored in
> LDAP) are located in different cities. I would like to store their mail
> closer to them and we have enough servers. My question is - what is the
> best practice to configure users to achieve that?
> 
> My current configuration is:
> DN: uid=john,ou=People,dc=example,dc=com
> uid: john
> initials: j.smith
> mail: j.sm...@example.com

The "mail" attribute is widely required to hold the *primary* persistent
public email address of the organisational user, and so should not be
tied to a specific point-in-time mailstore location.  Therefore, the
above value of "mail" is the correct form.

> I also have Postfix LDAP aliases pointed to "uid" and "initials" to calculate
> virtual user mail and then it find mailbox via "mail"->uid, then the message
> is dropped into mailbox with name "john" respectively.

The "uid" attribute is too "flat" for use in routing email to
distributed mail stores.  Therefore you need a second
email-address-valued attribute that holds the destination mailbox
address:

    uid: ivan
    initials: i.denisovich
    mail: i.denisov...@example.com
    maildrop: i.denisov...@moscow.example.com

At any site other than moscow, the "moscow.example.com" domain would be
remote, and email to the user will be forwarded via SMTP.  However, at
the "moscow.example.com" site, the domain would be considered "local",
and local aliases(5) would rewrite the address to "ivan" (possibly
with an appropriate @domain suffix), and deliver to the user's mailbox.

-- 
Sincerely yours,
Dima Veselov
Physics R&D Establishment of Saint-Petersburg University

Reply via email to