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
Looking for log files from /var/log Debug: /var/log/syslog Debug: /var/log/mail.log Info: /var/log/syslog Info: /var/log/mail.info Info: /var/log/mail.log Warning: /var/log/mail.warn Warning: /var/log/syslog Warning: /var/log/mail.info Warning: /var/log/mail.log Error: /var/log/mail.warn Error: /var/log/syslog Error: /var/log/mail.info Error: /var/log/mail.err Error: /var/log/mail.log Fatal: /var/log/mail.warn Fatal: /var/log/syslog Fatal: /var/log/mail.info 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.