A mail client cannot log in to a mail account
A mail client keeps rejecting a mail account's password. Dovecot gives the same response for four causes, and a few commands can show you which one applies.
Symptoms
The mail client keeps asking for the password or reports that the login failed. Over IMAP, the server replies with [AUTHENTICATIONFAILED] Authentication failed.
Each attempt produces a line like this in /var/log/maillog on AlmaLinux or /var/log/mail.log on Ubuntu.
imap-login: Disconnected: Connection closed (auth failed, 1 attempts in 2 secs): user=<user@example.com>, method=PLAIN, rip=203.0.113.10, lip=192.0.2.5, securedCause
- The client uses an incomplete username. Login always requires the full email address,
user@example.com. A client configured withuserfails, and the log entry showsuser=<user>. - The password is wrong.
- The mail account's login is turned off in UrbeStack.
- The customer who owns the domain is suspended. Suspending a customer removes their mail accounts from the list Dovecot reads.
Resolution
Test the email address and password as Dovecot sees them.
doveadm auth test user@example.com 'the-password'The command prints one of these two results.
Output passdb: user@example.com auth succeededOutput passdb: user@example.com auth failedIf the test succeeds, the problem is in the mail client. Set its username to the full email address.
If the test fails, check the mail account. The output shows
login_suspendedas1when the account's login is off.urbestack-mail-account-list --name example.comIf the login is off, turn it back on.
urbestack-mail-account-set --address user@example.com --login onIf the password is wrong, set a new one. The command reads the password from the first line of standard input.
urbestack-mail-account-set --address user@example.com --password-stdinIf the domain owner is suspended, urbestack-user-list shows the suspension. Reactivate the customer to restore their mail accounts.
urbestack-user-set --name USER --status activeAfter making a change, repeat the authentication test and look for the success result above.