POP3 Protocol using Telnet

What is POP3?

POP3 (Post Office Protocol Version 3) is an Internet Protocol used by Internet Service Providers (ISP) which permits to retreive e-mails from a mail server. It is described in RFC1939. This service is using the TCP protocol, port 110.

What is this page for?

With e-mail clients, you may expect problems to get your mail, for example if you have received a big e-mail you’d like to delete, want to test an account quickly, look intelligent, or if you have any other reason to check a mailbox.

The Protocol

This assumes that you have a telnet client and you know how to run it.

You have to connect to the POP3 service of your (ISP’s) mail server : telnet pop.isp.com 110 under UNIX systems, if the connection is successful, you’ll get a greeting message. At this point you have to send a command to the server, which is answered by +OK for a positive answer or -ERR in any other case.


Before being able to read and/or erase your e-mails, you have to authenticate to the server. There are 2 commands for this which must be followed : USER and PASS. Example of authentication:

$ telnet pop.eo.lu 110
Connected to unicorn.europeonline.net.
Escape character is '^]'.
+OK Europe Online Mail Server.
USER rewt
+OK rewt selected
+OK Congratulations!
+OK blah blah

This means that the account exists and the password is valid. The QUIT command tells the server that you want to stop the connection.

Get/delete e-mails

Once authenticated, you can have some info about your e-mails, fetch some or delete some. Some POP3 commands will be quickly described from now:


The STAT commands tell about the mailbox content briefly:

+OK 2 2206

This output shows that there are two messages in the mailbox, and their size is 2206 bytes. It doesn’t say about each message size. In order to know which message takes what space, you’ll have to use the LIST command:


+OK 2 messages (2206 octets)
1 1273
2 933

OK, I hope you understood that there are 2 messages received, size of the first is 1273 bytes, and second is 933 bytes.

Retreive your mail, with RETR and TOP

You can use these 2 commands to fetch your e-mail, the 1st gets the whole e-mail you requested, and the 2nd displays the header and the number of lines you asked to see from the message’s body. Anyway, you should consider that there are some ISPs who delete e-mails from the mail server when you retreived them, so if you’re not sure about it, use the TOP command. RETR requests as argument the e-mail number you’d like to fetch, and TOP requests the same and the number of line you would like to see. Here is an example:

+OK 1273 octets
< the POP3 server sends the entire message here >
TOP 1 5
+OK 1273 octets
< the POP3 server sends the headers of the message, a blank line, and the first 5 lines of the body of the message >

The TOP command is useful to see the content is big e-mails.

Delete E-mail

You have to use the DELE command. The syntax is the same as RETR. (DELE 4 to delete the fourth message in the INBOX).

New day, new adventure