On 24. Jan 2025, at 23.53, Timo Sirainen via dovecot <dovecot@dovecot.org> wrote:
On 24. Jan 2025, at 23.49, Timo Sirainen <timo@sirainen.com> wrote:
But lmtp doesn't find the user until I set auth_username_format = %{user | username}
Did you have auth_username_format set already in old config? The default also has | lower to make it lowercase, which you probably want to keep.
But then it tries to store the new mail in /data/mail/user@fqdn though "home:default = /data/mail/%{user}" is set.
I can't reproduce this. If I have auth_username_format = %{user | username} then home:default = /data/mail/%{user}" expands to username without the @domain. Does it also contain the @domain if you run "doveadm user user@fqdn"?
Oh, should clarify these. I was talking about global auth_username_format setting. With that it behaves as expected. But if you set it only inside passdb {} or userdb {} then it affects only the lookup user (i.e. lookup "user", not "user@domain" in passwd-file), but not the %{user} variable (it will contain "user@domain"). This behavior is intentional, but I wonder if it could be documented better somewhere.
Actually, it's not working at all how I thought it would. The global auth_username_format works as expected. However, using it inside passdb or userdb works only with passwd-file driver, where the username lookup is changed but it won't affect %{user}. For anything else the setting is just ignored. Perhaps this will change in the future, but for now I'll just update documentation. It's not really a problem for other passdbs/userdbs anyway.