GLossary Pages

Sunday, April 7, 2013

The RETR command did not succeed. Thank ATT and YAHOO for the need for this post

This post is about the "conversation" that occurs between a mail client and the mail server when the client is downloading mail using POP3

Because email is one of the early developments of the internet, everything about the connection and download of mails is done in plain text in the English language.  So much so that you can log into a mail server and get you mail by typing text commands in response to text prompts from the server

But we are not going there. If that is your interest there is an article here that discusses how to use Telnet to connect to the POP3 server.

I am concentrating on only Three of those POP commands STAT, LIST and RETR.

STAT is the command issued to the server to ask if there is mail to download.  The server replies with a message that looks like

+OK nn mm
where nn is number of messages and 
mm is the total size of those messages. 

LIST is the command that follows and is designed to get the server to provide more information about the messages it is holding.  So when your mail client issues the list command to the server it get a reply that looks something like this.

Thunderbird: LIST
Server: +OK 2 messages (320 octets)
Server: 1 120
Server: 2 200
Server: .
In this example there are 2 messages available  
The important information for the mail client such as Thunderbird is that the server has allocated the messages a number (in the examples case 1 and 2) that proceeds the message size information.

This allows for the Third command, RETR.  Using the information obtained in the proceeding LIST the mail client can now proceed to ask the mail server for the message.  This is done using the RETR command and the message number.  This command is issued once for each message to initiate a download of that message and looks something like this.

             Thunderbird: RETR 1
             Server: +OK 120 octets
             Server: <the POP3 server sends the entire message here>
             Server: .

As you can see, for the RETR command to fail, there basically has to be a problem on the server as the mail client (Thunderbird) is only asking the server to provide that which it has already said is available.

Further information can be found in RFC 1939 which is the standard that all POP3 compliant mail server and clients must comply with

1 comment:

  1. Thanks for sharing, nice post! Post really provice useful information!

    Hương Lâm chuyên cung cấp bán máy photocopy và dịch vụ cho thuê máy photocopy giá rẻ, uy tín TP.HCM với dòng máy photocopy toshiba và dòng máy photocopy ricoh uy tín, giá rẻ.