Verify Dovcot Login using telnet for POP3 and IMAP


Here in the following telnet sessions i am using the following details to demonstrate the dovecot verification. You have to replace with your login details.

server: mail.example.com
username: test@example.com
password: testpassword


Verify IMAP using Telnet

imap port:143
imaps port:993

The following telnet session will help you to use imap telnet session.

Type 1:

arun@loccalhost:~$ telnet mail.example.com 143
Trying xx.xx.xx.xx...
Connected to xx.xx.xx.xx.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES AUTH=CRAM-MD5 SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2008 Double Precision, Inc.  See COPYING for distribution information.
a login test@example.com testpassword    
a OK LOGIN Ok.
b logout
* BYE Courier-IMAP server shutting down
b OK LOGOUT completed
Connection closed by foreign host.



arun@localhost:~$ telnet mail.example.com 143
Trying xx.xx.xx.xx...
Connected to xx.xx.xx.xx.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED] Dovecot ready.
a login test@example.com testpassword                        
* BAD [ALERT] Plaintext authentication not allowed without SSL/TLS, but your client did it anyway. If anyone was listening, the password was exposed.
a NO [PRIVACYREQUIRED] Plaintext authentication disallowed on non-secure (SSL/TLS) connections.


Here in the above case Plaintext authentication not allowed without SSL/TLS. In that case, we can use the following two options to verify IMAP.

Type 2:

arun@localhost:~$ openssl s_client -connect mail.example.com:143 -starttls imap
.
.
.
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : DHE-RSA-AES256-SHA
    Session-ID: 2D47CDB0983B7AC6BF0DD2DBF308D75C05AE139542D9A5EBC4D80031897E5274
    Session-ID-ctx:
    Master-Key: FDF973D885685105FC9CEDBAEC12F022FEE4CAE2BA4327B6C26731C401CD7CC2D15447244B253D70136F44D563E8DE9B
    Key-Arg   : None
    Start Time: 1372191497
    Timeout   : 300 (sec)
    Verify return code: 18 (self signed certificate)
---
. OK Capability completed.
a login test@example.com testpassword
* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS
a OK Logged in
b logout
* BYE Logging out
b OK Logout completed.
closed


Type 3:

arun@localhost:~$ openssl s_client -connect mail.example.com:993
.
.
.
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : DHE-RSA-AES256-SHA
    Session-ID: E1A100FC4B56AEEDE96CBD7586C9F3390066AA2FC5F0117B9BD8D53EC5F399E6
    Session-ID-ctx:
    Master-Key: 628A0E2F3F9EF2DA9C9A64C1365D07407D4DCC2F86B297D04AD361325533E9D57DA49ADAC17DE80700F576408ED2EDCD
    Key-Arg   : None
    Start Time: 1372189555
    Timeout   : 300 (sec)
    Verify return code: 18 (self signed certificate)
---
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
a login test@example.com testpassword
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in
b logout
* BYE Logging out
b OK Logout completed.
closed


=================================================================

Verify POP3 using Telnet



pop3 port:110
pop3s port:995

Type 1:

arun@localhost:~$ telnet mail.example.com 110
Trying xx.xx.xx.xx...
Connected to xx.xx.xx.xx.
Escape character is '^]'.
+OK <23600.1372186718@mail.example.com>
user test@example.com                      
+OK
pass testpassword      
+OK
quit
+OK
Connection closed by foreign host.


arun@localhost:~$ telnet mail.example.com 110
Trying xx.xx.xx.xx...
Connected to xx.xx.xx.xx.
Escape character is '^]'.
+OK Dovecot ready.
user test@example.com
-ERR Plaintext authentication disallowed on non-secure (SSL/TLS) connections.


Here in the above case Plaintext authentication not allowed without SSL/TLS. In that case, we can use the following two options to verify POP3.


Type 2:

arun@localhost:~$ openssl s_client -connect mail.example.com:110 -starttls pop3
.
.
.
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : DHE-RSA-AES256-SHA
    Session-ID: 089C8CD4E6D5BAE1501530918F82F6435F506F7AE3B87E6D49165F00C37DE7AE
    Session-ID-ctx:
    Master-Key: E993A3252EB7CC2D0B611FB9CB92136BC9142B6BB7CE7F9AE75600E48DCB11AB5666EA02439FA64C62F21D50982AD1C8
    Key-Arg   : None
    Start Time: 1372191620
    Timeout   : 300 (sec)
    Verify return code: 18 (self signed certificate)
---
+OK Dovecot ready.
user test@example.com
+OK
pass testpassword
+OK Logged in.
quit
+OK Logging out.
closed


Type 3:

arun@localhost:~$ openssl s_client -connect mail.example.com:995
.
.
.

Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : DHE-RSA-AES256-SHA
    Session-ID: D3E8D8E1ED81F3233E79DC07B3574AB5E0D0E576BE392042119E1FE327940358
    Session-ID-ctx:
    Master-Key: 6C2F619A712727A9833E9DB1CB8E53E5482D0C99E085A65C30F3610085A3D07C74053D1EE949B6909196A12A64E931A6
    Key-Arg   : None
    Start Time: 1372189468
    Timeout   : 300 (sec)
    Verify return code: 18 (self signed certificate)
---
+OK Dovecot ready.
user test@example.com              
+OK
pass testpassword          
+OK Logged in.
quit
+OK Logging out.
closed




Reference:
http://wiki.dovecot.org/TestPop3Installation
http://wiki.dovecot.org/TestInstallation

This entry was posted by Unknown. Bookmark the permalink.

Leave a Reply