Debian – Logging into mail server works through telnet but fails though imap(s) (Dovecot+MySQL)

debiandovecotemailimaptelnet

I have followed the ISPMail tutorial on how to set up a Debian mail server.

I can log into the dovecot server through telnet like this:

[root@{hostname}: /home/{user}]# telnet {hostname}.{TLD} 143
Trying 127.0.1.1...
Connected to {hostname}.{TLD}.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS     AUTH=PLAIN] Dovecot ready.
1 LOGIN {user}@{hostname}.{TLD} {password}
1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY     THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-    EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-    STATUS] Logged in

(Sidenote) should not these 2 commands be identical?

[root@{hostname}: /home/{user}]# telnet {hostname}.{TLD} imaps
Trying 127.0.1.1...
Connected to {hostname}.{TLD}.
Escape character is '^]'.
1 LOGIN {user}@{hostname}.{TLD} {password}
Connection closed by foreign host.

But when I try to access the server with a mailprogram (mutt) like this:

mutt -f imaps://{hostname}.{TLD}
Username at {hostname}.{TLD}: {user}@{domain}
Password for {user}@{domain}@{hostname}.{TLD}: {password}
Logging in.
Login failed.
Closing connection to {hostname}.{TLD}

Here is /var/log/mail.log:

Jan  2 00:50:55 {hostname} dovecot: imap-login: Login: user=<{user}@{domain}>, method=PLAIN, rip=127.0.1.1, lip=127.0.1.1, secured
Jan  2 00:51:03 {hostname} dovecot: IMAP({user}@{domain}): Disconnected: Too many invalid IMAP commands. bytes=38/1284
Jan  2 00:51:26 {hostname} dovecot: imap-login: Disconnected (no auth attempts): rip=127.0.1.1, lip=127.0.1.1, TLS handshaking: SSL_accept() failed: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol
Jan  2 00:51:55 {hostname} dovecot: imap-login: Aborted login (auth failed, 1 attempts): user=<{user}@{domain}>, method=PLAIN, rip=127.0.1.1, lip=127.0.1.1, TLS
Jan  2 00:52:15 {hostname} dovecot: imap-login: Aborted login (auth failed, 1 attempts): user=<{user}>, method=PLAIN, rip=127.0.1.1, lip=127.0.1.1, TLS

Thunderbird and my iPhone' mail program can't login either.

What could be causing this problem?

Best Answer

Num-Lock / Num-Pad

the number pad or num-lock maybe causing problem in password and maybe difficult to spot. Use number keys on top of keyboard.

Telnet

IMAP(IMAP4) port is 143. Traffic is in plain text. That why you can connect with telnet.

IMAPS(IMAP4 over SSL) port is 993. A SSL channel has to be established first. It is expecting SSL hand shake. That is why your telnet to imaps failed.

Mutt

mutt -f imap://{hostname}.{TLD}

Test imap authentication, username, password with plain imap 1st. That let you know if the account is actually working or not.

mutt -f imaps://{hostname}.{TLD}

If imaps is setup properly with self-signed certificate, mutt will ask for certificate confirmation. You will have to option to reject, accept once or accept always.

Thunderbird

To test IMAPS, use Thunderbird with manual config. If your dns is not fully setup, enter IP address of your imap server, pick IMAPS and port 993. When checking imaps email, it should pop up a window for accepting the self signed ssl cert.

Related Topic