Problems with connecting Thunderbird client to dovecot installed on Ubuntu

I am trying to connect a Thunderbird client to my dovecot server. The dovecot is installed on Ubuntu. I know that my server works (at least partially), since when I send a mail to a user in the server ([email protected]), I see the new file created in /home/feedback/Maildir/new.

However, when I try to connect with my Thunderbird to the server, It recognizes the server, but informs me that my user/password is wrong (they are not wrong).

The exact message is:

Configuration could not be verified - is the username or password wrong?

The server configuration it tries to connect to is: incoming - IMAP 143, outgoing - SMTP 587

The dovecot configuration file is located here: dovecot.conf

My PAM configuration is:

@include common-auth  
@include common-account  
@include common-session  

In the log, I see:

May 23 06: 07: 20 misfortune dovecot: imap-login: Disconnected (no auth attempts): ? rip=77.126.236.118, lip=184.106.69.153

Dovecot -n gives me:

Log_timestamp: %Y-%m-%d %H: %M: %S  
Protocols: pop3 pop3s imap imaps  
Ssl: no  
Login_dir: /var/run/dovecot/login  
Login_executable(default): /usr/lib/dovecot/imap-login  
Login_executable(imap): /usr/lib/dovecot/imap-login  
Login_executable(pop3): /usr/lib/dovecot/pop3-login  
Mail_privileged_group: mail  
Mail_location: maildir: ~/Maildir  
Mbox_write_locks: fcntl dotlock  
Mail_executable(default): /usr/lib/dovecot/imap  
Mail_executable(imap): /usr/lib/dovecot/imap  
Mail_executable(pop3): /usr/lib/dovecot/pop3  
Mail_plugin_dir(default): /usr/lib/dovecot/modules/imap  
Mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap  
Mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3  
Imap_client_workarounds(default): tb-extra-mailbox-sep  
Imap_client_workarounds(imap): tb-extra-mailbox-sep  
Imap_client_workarounds(pop3): 
Auth default: 
  passdb: 
    driver: pam  
  userdb: 
    driver: passwd  

Solution 1:

Troubleshoot your IMAP server first. Just beware, do it over a secure connection, because all your credentials are sent plaintext.

telnet your.mail.server.com 143

. login username password

. list "" "*"

. select INBOX

. fetch 1:* flags

To read the body of the first message in the current selected folder:

. fetch 1 rfc822.text

Or just see here for more examples:

Accessing IMAP email accounts using telnet

If that stuff doesn't work, that's proof positive that Dovecot is not correctly configured.

Solution 2:

That mail is delivered to ~/Maildir does not mean Dovecot works at all – Dovecot only handles IMAP, not SMTP or delivery.

  • Fix your mail_location. You say that your mail is delivered to ~/Maildir, yet your Dovecot is configured to look in ~/mail and /var/mail/%u. Change mail_location to maildir:~/Maildir.

  • Make sure your PAM configuration in /etc/pam.d/dovecot is correct.

  • Look for any error messages in /var/log/syslog and /var/log/auth.log (authentication errors usually go to the latter).