Mail Server Login Error – Dovecot IMAP Authentication Failed

You have set up a Postfix and Dovecot mail server for your own domain name. It runs smoothly for a long time and you are happy with it. Then one day your email client can’t receive emails from your mail server.

Postfix is a SMTP server which is responsible for exchanging emails with other SMTP servers while Dovecot is a IMAP and POP3 server responsible for delivering emails from mail server to email clients for the end-user to read.

If your email clients can’t receive emails from your mail server, then there’s a problem with Dovecot. As all Sysadmins know, to troubleshoot problems, it’s always a good practice to read the log which may give us some hints about what’s going on.

Find the log file of Dovecot by running this command:

sudo doveadm log find

Sample output:

Looking for log files from /var/log
Debug: /var/log/syslog
Debug: /var/log/mail.log
Info: /var/log/syslog
Info: /var/log/
Info: /var/log/mail.log
Warning: /var/log/mail.warn
Warning: /var/log/syslog
Warning: /var/log/
Warning: /var/log/mail.log
Error: /var/log/mail.warn
Error: /var/log/syslog
Error: /var/log/
Error: /var/log/mail.err
Error: /var/log/mail.log
Fatal: /var/log/mail.warn
Fatal: /var/log/syslog
Fatal: /var/log/
Fatal: /var/log/mail.err
Fatal: /var/log/mail.log

Check out these log files. Find the dovecot section. The following is a common error of Dovecot.

mail dovecot: auth: Error: BUG: Authentication client sent unknown handshake command: 
mail dovecot: imap: Error: Authentication server didn't send valid SPID as expected: 
mail dovecot: imap: Error: Disconnected from auth server, aborting (client-pid=31537 client-id=1)
mail dovecot: imap-login: Internal login failure

You can see that there’s a problem with authenticating the email client so IMAP login failed.

To fix this issue, just reload or restart Dovecot.

sudo service dovecot reload/sudo service dovecot restart


sudo systemctl reload dovecot/sudo systemctl restart dovecot

To keep servers running smoothly, it’s also a good idea to check logs periodicly to see if there’s any warnings or errors.

Stay tuned.

Rate this tutorial
[Total: 5 Average: 3.6]

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community ( for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here