Linux 4 All

Best Linux tricks source

Here is how to test IMAP, POP and SMTP authentication using telnet or openssl:

POP3 test:

telnet $SERVER_IP 110
+OK Hello there. 
USER user@example.com
+OK Password required.
PASS Password
+OK logged in.

IMAP test:

telnet $SERVER_IP 143
a1 LOGIN user@example.com Password
a1 OK LOGIN Ok.

POP3-SSL test:

openssl s_client -connect $SERVER_IP:995
+OK Hello there. 
USER user@example.com
+OK Password required.
PASS Password
+OK logged in.

IMAP-SSL test:

openssl s_client -connect $SERVER_IP:993
a1 LOGIN user@example.com Password
a1 OK LOGIN Ok.

For the SMTP test, first we need to generate base64 encrypted username/password hash and then we can test it:

printf '\0%s\0%s' 'user@example.com' 'Password' | openssl base64
AHVzZXJAZXhhbXBsZS5jb20AUGFzc3dvcmQ=

telnet $SERVER_IP 25
AUTH PLAIN AHVzZXJAZXhhbXBsZS5jb20AUGFzc3dvcmQ=
235 2.7.0 Authentication successful AHVzZXJAZXhhbXBsZS5jb20AUGFzc3dvcmQ=

e-mail

photo credit: Micky.! via photopin cc

How to kill a MySQL query arrow-right
Next post

arrow-left How to enable real IP Apache error_log behind Load Balancer
Previous post

Leave a Reply

Your email address will not be published. Required fields are marked *