Skip to content
Module 3 · Lesson 6 of 25

Auth flow and userdb vs passdb

Part of Dovecot: IMAP/POP3 at Production Scale, in the Authentication (PAM, SQL, LDAP, passwd-file) module.

Author

Dovecot splits authentication into two databases:

  • passdb verifies the password ("is this person who they say?").
  • userdb provides user metadata ("where do their messages live, what's their UID, quota?").

Both queries happen on every login. They can come from the same source or different sources (e.g., LDAP for passwords, static template for userdb).

Auth flow:

client → imap-login → auth daemon → passdb lookup → userdb lookup → imap process

If passdb says yes and userdb returns valid metadata, login succeeds. If userdb returns nothing, login fails with "no such user" even if the password was correct.

Enable verbose auth logging when debugging:

auth_verbose = yes
auth_debug = yes

in local.conf. Restart Dovecot. Tail /var/log/dovecot.log and replay the failing login.

Sign in to keep track of what you have read.

Pulse · email sending

Sending infrastructure that is yours alone.

Every domain gets its own MX host, IP, DKIM selector and certificate. Take it managed, and we run it for you, or buy a licence and run it on your own servers.

# on a fresh Ubuntu server
$ cd pulse && sudo ./install.sh
→ docker compose up · kumomta · stalwart · caddy
→ dashboard ready on https://pulse.yourdomain.com
$

Also from us:Beat: monitoring that tells you the fixConsulting: $65/hr, no retainer