ok i get the question however the users email address and password is pretty much a world wide standard more for simpliciy then anything else
logging and acting on hack attempts (what i do) works better (i blacklist the offending ip in real time)
i get for extra security you might want to add a seperate username for auth
anyways that being said this is just a db lookup question
dovecot is very flexable on db lookup's against a user, you will need to add a column for the new login name and have to alter the dovecot sql query on login to look at the username auth field but then return the data as per normal aka username@domain etc.
this is platform dependant (ie mysql, pgsql - which i use)
this would probably not work with other auth methods as there is no flexability to use different fields for different options
also note postfix (or your mta) will also have to be updated accordingly (smtp auth)
if you give me some more detail on the db setup and / or the query strings i can probably help further.
On 2026-11-17 6:27 a.m., Gandalf Corvotempesta via dovecot wrote:
Hello,
I am running Dovecot 2.3 with SQL passdb and userdb. At the moment the login name is the same as the email address, and everything else is built on top of that: the mail location, the userdb lookup, LMTP delivery, Sieve, quota and so on all use the full address as the user.
What I would like to do is let users authenticate with a dedicated login name that is different from their email address, while keeping the email address as the canonical user for everything else. In other words, the login name should only be an alias used at authentication time, and once the passdb has accepted it, the session should continue exactly as it does today, with the email address as %u, the same home and mail location, and the same userdb lookup.
My first attempt was to add a separate column holding the login name and change the password_query so that it matches on that column instead of the address, while still returning the email address in the user field, for example selecting the address as user and filtering with the login name in the where clause. On a single server this seems (i'm not 100% sure) to behave as intended. The difficulty appears in my real setup, where the mailbox sits behind a Dovecot proxy. The proxy passdb returns proxy_maybe and host, and I also had to return destuser so that the backend receives the new login name, since the backend now looks the account up by that name. Authentication then works end to end, but sessions start using the login name as the actual user: new empty mail directories named after the login name get created on every access, and the mailbox appears empty from both IMAP clients and webmail, while the real mail is still under the old address-based location.
I am not sure which component is responsible. One possibility is that with proxy_maybe, when the destination is the local server, Dovecot skips the proxy but still applies destuser as the new username. Another is that the userdb used in the real login path does not see the user field that the passdb rewrites, even though doveadm auth lookup reports the email address as the user. I also wonder whether I should set home or mail explicitly from the database so that the storage location can never depend on the name used at login.
Could someone tell me whether this kind of setup is supported, what the recommended way is to keep the email address as the canonical user when the login name differs, and how the user field, destuser and proxy_maybe are supposed to interact in this case? I can provide doveconf -n output and the relevant queries from both the proxy and the backend if that would help.
Thank you very much for your time.
Best regards
dovecot mailing list --dovecot@dovecot.org To unsubscribe send an email todovecot-leave@dovecot.org
--
Thanks - Paul Kudla (Manager SCOM.CA Internet Services Inc.)
Have A Happy Tuesday AND Happy Sucessful 2026 !
Scom.ca Internet Services <http://www.scom.ca> 104-1009 Byron Street South Whitby, Ontario - Canada L1N 4S3
Toronto 416.642.7266 Main 1.866.411.7266 Fax 1.888.892.7266 Email paul@scom.ca