# A mail client cannot log in to a mail account

UrbeStack sysadmin note about Dovecot. Last updated 30 Nov 2026.

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.

```output
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, secured
```

## Cause

- The client uses an incomplete username. Login always requires the full email address, `user@example.com`. A client configured with `user` fails, and the log entry shows `user=<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 succeeded
```

```output
passdb: user@example.com auth failed
```

If 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_suspended` as `1` when the account's login is off.

```
urbestack-mail-account-list --name example.com
```

If the login is off, turn it back on.

```
urbestack-mail-account-set --address user@example.com --login on
```

If 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-stdin
```

If 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 active
```

After making a change, repeat the authentication test and look for the success result above.

If the problem persists after you follow this note, you can [open a support ticket](https://support.urbestack.com/new?type=support). Including the output of the commands you ran helps support diagnose the problem.
