2.4 use a dictionary when receiving authentification requests
In conf.d/10-auth.conf I do:
dict lookuptable { dict_name = lookuptable dict_driver = file dict_file_path = /etc/dovecot/mailtouserid.dict } auth_username_format = %{user | lower | dict:lookuptable/shared/ }
But it seems the dictionary doesn't work here... it is skipped. Is this a bug, is it something that will be added lateron or do I do something wrong?
My goal is to allow users to logon with their email address as username.
Best wishes for 2026 to all!
-Huibert.
On 31/12/2025 13:27 EET info--- via dovecot <dovecot@dovecot.org> wrote:
In conf.d/10-auth.conf I do:
dict lookuptable { dict_name = lookuptable dict_driver = file dict_file_path = /etc/dovecot/mailtouserid.dict } auth_username_format = %{user | lower | dict:lookuptable/shared/ }
But it seems the dictionary doesn't work here... it is skipped. Is this a bug, is it something that will be added lateron or do I do something wrong?
My goal is to allow users to logon with their email address as username.
Best wishes for 2026 to all!
-Huibert.
Hi, not sure how you came to this configuration, but no, that does not work, or is not even supposed to work.
Also, auth dict support has been removed. See
https://doc.dovecot.org/2.4.2/installation/upgrade/2.3-to-2.4.html#backends-...
Use passwd-file (or some other supported way) to map emails to usernames.
Aki
So there is not an option by configuration? Would be an useful asset. Now I have to program it with LUA? The passwd-file solution will not convert the email address into an existing userid which I need for mail directory locations eg. Currently I solved it using a series of regexp() expressions which I generated, but that's only an ugly fix and I have to hope a long expression (10k bytes) for a variable will not break dovecot. -Huibert.
On 31/12/2025 14:24 EET info--- via dovecot <dovecot@dovecot.org> wrote:
So there is not an option by configuration? Would be an useful asset. Now I have to program it with LUA? The passwd-file solution will not convert the email address into an existing userid which I need for mail directory locations eg. Currently I solved it using a series of regexp() expressions which I generated, but that's only an ugly fix and I have to hope a long expression (10k bytes) for a variable will not break dovecot. -Huibert.
passwd-file can in fact convert your usernames. just return user=foobar there.
e.g.
passdb byemail { driver = passwd-file passwd_file_path = /etc/dovecot/mail-to-uid fields { noauthenticate = yes } }
/etc/dovecot/mail-to-uid user@email:*::::::user=userid
Aki
Hi Aki, thanks.
But that will not change the mail address into the userid in the rest of dovecot...
So if someone has two email aliases, ending up in the same userid and mail folder, finding the right mail folder will fail.
And yes with symbolic links you can fix that, but that is as ugly as my current fix, I guess.
-Huibert.
participants (2)
-
Aki Tuomi
-
info@opdepc.nl