To Test a POP3 Mailserver from Linux you only need an open terminal, telnet or openssl installed. Then it is simply a matter of opening a connection to your server and sending it some commands. It is the same commands that your GUI mail client will be doing.
The following is how to read your emails. To open a connection you can use either telnet or openssl if the connection is to be encrypted.
telnet mailserver.dragon.lab pop3
openssl s_client -connect mailserver.dragon.lab:995
The above openssl command returns the ssl certificate you can stop that from happening by using the -quiet flag.
Both of the commands above should return message a message
* OK Dovecot (Ubuntu) ready.
The following listing shows how to find out the directories available on the server for the user you logged in with and how to grab the first email from the server.
- The commands you type are in bold.
- They can be in upper or lower case.
- Any text after the command can be in quotes “” to allow you to send escape characters or white space.
+OK Logged in.
+OK 1 message:
+OK 1629 octets
Received: from mailserver.dragon.lab
by mailserver.dragon.lab (Dovecot) with LMTP id lscAMP8jTFjdCgAAEtR2Vw
Received: from localhost (localhost [127.0.0.1])
by mailserver.dragon.lab (Postfix) with ESMTP id B9C4E40D02
X-Virus-Scanned: Debian amavisd-new at dragon.lab
X-Spam-Status: No, score=-1 required=6.31 tests=[ALL_TRUSTED=-1]
Received: from mailserver.dragon.lab ([127.0.0.1])
by localhost (mailserver.dragon.lab [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id m6M1uA3-zLiJ for
Sat, 10 Dec 2016 15:49:18 +0000 (GMT)
Received: from [10.1.200.4] (unknown [10.1.200.4])
(using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
(No client certificate requested)
(Authenticated sender: firstname.lastname@example.org)
by mailserver.dragon.lab (Postfix) with ESMTPSA id D8A7A40D01
To: Fred Bloggs
From: Fred Bloggs
Subject: testing the mail server
Date: Sat, 10 Dec 2016 15:49:17 +0000
Content-Type: text/plain; charset=utf-8; format=flowed
This is your first test email.
+OK Logging out.
Connection closed by foreign host.
Now you can test a POP3 mailserver from the command line by reading emails.