Mapping usernames used for authentication to UNIX usernames

Frank Volf frank at deze.org
Wed Jun 16 16:58:52 EEST 2021


Hi,

I'm looking for some advice or pointers how to best solve a small 
problem that I have. I have no doubt that this can be done in dovecot, 
but I'm struggling to find the easiest way to implement it.

First of all, what I have:
I have a relative small dovecot setup for a dozen domains, and about 50 
users in total. All users use IMAP to retrieve mail, and SMTP submission 
protocol to submit email.
Because of the small size, every user has its own UNIX account, 
authentication is done using PAM and mail is stored in a Maildir folder 
in their home directory.
Works perfectly!

There is one minor inconvenience. When a new mail client is configured, 
users (often guided by the auto config generator of the mail client) 
tend to use their email address as the username to authenticate instead 
of their UNIX account name, which fails of course.

Would it be possible to configure something that will map an email 
address to the UNIX account name and use the account name for 
authentication and obtaining the related information (uid, gid, home dir)?

I do have two concerns:

1) I do not want to break existing mail configurations, so 
authentication with the UNIX username should still be possible.
2)  I cannot do a simple reg. exp for the translation because every 
email domain has e.g. an info at domain.com mailbox, and I do not want them 
all to go to UNIX user "info".

As said, I would appreciate any advice on how this can be configured the 
easiest.

Thanks in advance.

Kind regards,

Frank



More information about the dovecot mailing list