Issue Description
After a server restart, users cannot authenticate with an address that exists only through a domain alias. Logging in with the account’s primary address works, and after one successful login with the primary address, the alias address also works until the next restart.
Setup:
- Domain: PRIMARY ([email protected])
- Aliases (on the domain object): ALIAS ([email protected])
- Accounts are created with only the primary address (user@PRIMARY).
- Clients log in with user@ALIAS (the alias-domain address).
It looks like alias-domain resolution during authentication depends on the account already being cached.
Expected Behavior
An address that resolves through a domain alias (user@ALIAS → user@PRIMARY) should be accepted for authentication (IMAP, SMTP submission, JMAP) right after a restart, the same way it is accepted for mail delivery, without first logging in with the primary address.
Actual Behavior
Right after a restart:
- Login as user@ALIAS fails (authentication failed / invalid credentials).
- Login as user@PRIMARY succeeds.
- After that, login as user@ALIAS also succeeds, until the next restart.
The password is correct in every case; only the login address differs.
Reproduction Steps
- Create domain PRIMARY with alias domain ALIAS.
- Create an account with only the address user@PRIMARY (no explicit alias-domain address).
- Restart Stalwart.
- Log in over IMAP or SMTP submission as user@ALIAS with the correct password → fails.
- Log in as user@PRIMARY → succeeds.
- Log in as user@ALIAS again → now succeeds.
- Restart Stalwart → step 4 fails again.
Workaround: adding user@ALIAS explicitly as an address on the account makes it work right after a restart.
Stalwart Version
v0.16.x
Installation Method
Binary (Windows)
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
- Clients tested: [e.g. Outlook for Windows, Thunderbird]
- Server behind NAT with port forwarding, no reverse proxy.
- The domain has “Allow relaying” enabled (split-delivery setup with another mail server). This shouldn’t affect authentication but is mentioned for completeness.
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on