Is there any command in unix to check a pop3 account using terminal? I mean, type the server/username/password of a pop3 account and see if the username/password is correct?

  • 1
    getmail will also work. – sikerbela May 6 '15 at 21:30

You can use telnet to connect to the mail server and talk POP3 to check your credentials:

$ telnet pop.gmx.net 110
Connected to pop.gmx.net.
Escape character is '^]'.
+OK POP server ready H migmx028 0MAbjW-1YwF4D0ml8-00BiVl
USER spamaccount80@gmx.de
+OK password required for user "spamaccount80@gmx.de"
PASS typeyourpassword
-ERR Error retrieving your GMX emails. Your connection is not encrypted. Enable SSL in your mail program. Instructions: https://ssl.gmx.net
Connection closed by foreign host.

Well, this failed because most mail server require a SSL/TLS encrypted session nowadays. So instead of using telnet you can use socat:

$ socat - OPENSSL:pop.gmx.net:995
+OK POP server ready H migmx113 0MC062-1Yzese0KO7-00AVNE
USER spamaccount80@gmx.de
+OK password required for user "spamaccount80@gmx.de"
PASS typeyourpassword
+OK mailbox "spamaccount80@gmx.de" has 13518 messages (191718918 octets) H migmx113

If you type a wrong password, the server will probably say something like:

-ERR authentication failed

Or instead of socat you probably have openssl laying around:

$ openssl s_client -quiet -connect pop.gmx.net:995
depth=2 C = DE, O = Deutsche Telekom AG, OU = T-TeleSec Trust Center, CN = Deutsche Telekom Root CA 2
verify error:num=19:self signed certificate in certificate chain
verify return:0
+OK POP server ready H migmx108 0MWpjO-1YiwnK3ZfP-00XoK
| improve this answer | |
  • Might be worth including the command line for plain ol' POP3 without SSL – roaima May 6 '15 at 22:44
  • @roaima Good remark. I've added telnet and openssl examples. – FloHimself May 7 '15 at 6:12

If you want to check your pop3 mail accounts then take a look at the following terminal mail clients:

  1. pine
  2. alpine
  3. mutt

There are many more, but those are the most popular ones that I know of.

| improve this answer | |

I suggest mutt. Why?Because support tls and even kerberos for single sign on If use single sign on put on .muttrc

set imap_authenticators="gssapi"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.