POP3 Client-Server Communication

Let us see how POP3 Client and Server communicates with each other step by step. Here, I have used PuTTY as POP3 Client and connected to POP3 Server running on “mail.domain.com” listening on TCP port 110 as soon as connected with the server it responds with “+OK POP3 Server Ready” which is POP3 Server’s welcome message. I want to check my e-mail account mail@domain.com for any new e-mails and if fetch it.

Client >> user mail@domain.com

Here mail@domain.com is my e-mail address which I want to check e-mails for.

Server << +OK Send your password

Server says please provide the password to authenticate

Client >> pass mail

Client sends password to server using pass command followed by my password. Here mail is a password of my e-mail account.

Server << +OK Mailbox locked and ready

Server locks the mailbox after being successfully authenticated.

Client >> stat

Client check if there is any mail using “stat” command.

Server << +OK 2 5718

Server says there are 2 mails having total size of 5718 bytes.

Client >> list

Client asks for list of e-mails.

Server << +OK 2 messages (5718 octets)
1 2859
2 2859
.

Server responds with OK there are 2 messages having total size of 5718 bytes, then sends individual message number along with its size. Here we have two messages each having size of 2859 bytes.

Client >> retr 1

Client asks POP3 Server to send message number 1.

Server << Everything between “retr 1” and “retr 2” are contents of message number 1 excluding “+OK 2859 octets”

Client >> retr 2

Client asks POP3 Server to send message number 2.

Server << Everything between “retr 2” and “dele 1” are contents of message number 2 excluding “+OK 2859 octets”

Client >> dele 1

Client issue command to delete message number 1 using “dele” command

Server << +OK msg deleted

Server confirms deletion of message number 1

Client >> dele 2

Client issue command to delete message nubmer 2 using “dele” command

Server << +OK msg deleted

Server confirms deletion of message number 2

Client >> quit

Client issue “quit” command in order to terminate session with POP3 Server

Server << +OK POP3 server saying goodbye…

Server responds with farewell message and the session terminates

 

Client side logs are pasted below. The text marked in maroon color indicates the client side commands.

POP3 Client Logs

============================================================================

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2011.10.29 22:37:46 =~=~=~=~=~=~=~=~=~=~=~=
+OK POP3 Server Ready
user mail@domain.com
+OK Send your password
pass mail
+OK Mailbox locked and ready
stat
+OK 2 5718
list
+OK 2 messages (5718 octets)
1 2859
2 2859
.
retr 1
+OK 2859 octets
Return-Path: test@domain.com
Received: from Home ([127.0.0.1])
by HOME
; Sat, 29 Oct 2011 22:43:41 +0530
From: “Test” <test@domain.com>
To: <mail@domain.com>
Subject: Test 1
Date: Sat, 29 Oct 2011 22:43:41 +0530
Message-ID: <000a01cc965e$1b6f1a20$524d4e60$@com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary=”—-=_NextPart_000_000B_01CC968C.35275620″
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcyWXhZFq4PDEQTISbOJzlFuip/8mw==
Content-Language: en-us
x-cr-hashedpuzzle: Hxg= BFmV Bs1t B77e C74d DAfx DBbr DETD DSgL DzB2 E4xS FHSt Gmri IZ6c Jv9v KnE9;1;bQBhAGkAbABAAGQAbwBtAGEAaQBuAC4AYwBvAG0A;Sosha1_v1;7;{DFC5DD2E-BD19-43AF-B154-901C99A443F0};dABlAHMAdABAAGQAbwBtAGEAaQBuAC4AYwBvAG0A;Sat, 29 Oct 2011 17:13:33 GMT;VABlAHMAdAAgADEA
x-cr-puzzleid: {DFC5DD2E-BD19-43AF-B154-901C99A443F0}

This is a multipart message in MIME format.

——=_NextPart_000_000B_01CC968C.35275620
Content-Type: text/plain;
charset=”us-ascii”
Content-Transfer-Encoding: 7bit

Test 1

——=_NextPart_000_000B_01CC968C.35275620
Content-Type: text/html;
charset=”us-ascii”
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D”urn:schemas-microsoft-com:vml” =
xmlns:o=3D”urn:schemas-microsoft-com:office:office” =
xmlns:w=3D”urn:schemas-microsoft-com:office:word” =
xmlns:m=3D”http://schemas.microsoft.com/office/2004/12/omml” =
xmlns=3D”http://www.w3.org/TR/REC-html40″>

<head>
<META HTTP-EQUIV=3D”Content-Type” CONTENT=3D”text/html; =
charset=3Dus-ascii”>
<meta name=3DGenerator content=3D”Microsoft Word 12 (filtered medium)”>
<style>
<!–
/* Font Definitions */
@font-face
{font-family:”Cambria Math”;
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:”Calibri”,”sans-serif”;
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
–>
</style>
<!–[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D”edit” spidmax=3D”1026″ />
</xml><![endif]–><!–[if gte mso 9]><xml>
<o:shapelayout v:ext=3D”edit”>
<o:idmap v:ext=3D”edit” data=3D”1″ />
</o:shapelayout></xml><![endif]–>
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div>

<p>Test 1<o:p></o:p></p>

</div>

</body>

</html>

——=_NextPart_000_000B_01CC968C.35275620–

.
retr 2
+OK 2859 octets
Return-Path: test@domain.com
Received: from Home ([127.0.0.1])
by HOME
; Sat, 29 Oct 2011 22:44:23 +0530
From: “Test” <test@domain.com>
To: <mail@domain.com>
Subject: Test 2
Date: Sat, 29 Oct 2011 22:44:23 +0530
Message-ID: <000f01cc965e$3426c4f0$9c744ed0$@com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary=”—-=_NextPart_000_0010_01CC968C.4DDF00F0″
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcyWXjAVN274Nw2NRyyPSLNCvwBG+A==
Content-Language: en-us
x-cr-hashedpuzzle: AKRw ApTI Bimm BjFC B5Td CJFT C7aN DCtL DErw DYmW Hbjx IEvg IdRZ I1pd JNJB Jukc;1;bQBhAGkAbABAAGQAbwBtAGEAaQBuAC4AYwBvAG0A;Sosha1_v1;7;{07A4C7C5-EF9F-4457-AB00-9FA7DF8CFFC9};dABlAHMAdABAAGQAbwBtAGEAaQBuAC4AYwBvAG0A;Sat, 29 Oct 2011 17:14:16 GMT;VABlAHMAdAAgADIA
x-cr-puzzleid: {07A4C7C5-EF9F-4457-AB00-9FA7DF8CFFC9}

This is a multipart message in MIME format.

——=_NextPart_000_0010_01CC968C.4DDF00F0
Content-Type: text/plain;
charset=”us-ascii”
Content-Transfer-Encoding: 7bit

Test 2

——=_NextPart_000_0010_01CC968C.4DDF00F0
Content-Type: text/html;
charset=”us-ascii”
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D”urn:schemas-microsoft-com:vml” =
xmlns:o=3D”urn:schemas-microsoft-com:office:office” =
xmlns:w=3D”urn:schemas-microsoft-com:office:word” =
xmlns:m=3D”http://schemas.microsoft.com/office/2004/12/omml” =
xmlns=3D”http://www.w3.org/TR/REC-html40″>

<head>
<META HTTP-EQUIV=3D”Content-Type” CONTENT=3D”text/html; =
charset=3Dus-ascii”>
<meta name=3DGenerator content=3D”Microsoft Word 12 (filtered medium)”>
<style>
<!–
/* Font Definitions */
@font-face
{font-family:”Cambria Math”;
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:”Calibri”,”sans-serif”;
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
–>
</style>
<!–[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D”edit” spidmax=3D”1026″ />
</xml><![endif]–><!–[if gte mso 9]><xml>
<o:shapelayout v:ext=3D”edit”>
<o:idmap v:ext=3D”edit” data=3D”1″ />
</o:shapelayout></xml><![endif]–>
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div>

<p>Test 2<o:p></o:p></p>

</div>

</body>

</html>

——=_NextPart_000_0010_01CC968C.4DDF00F0–

.
dele 1
+OK msg deleted
dele 2
+OK msg deleted
quit
+OK POP3 server saying goodbye…
============================================================================

 

 

Related Posts

One thought on “POP3 Client-Server Communication

Leave a Reply

%d bloggers like this: