Like us on Facebook!

Monday, 8 April 2013

POP - useful commands

POP3
Version 3 of the Post Office Protocol (POP3) is comparatively simple, and only allows the user to download emails from the server to the client. The user can log in to an account, view the contents of the mailbox, transfer and delete emails, and log out, all via server port 110. This requires few resources, and there is little to configure, which means few sources of error.
The POP3 protocol is simple enough to use directly, in an interactive session:user@linux:$ telnet mail.example.com 110
Trying 192.168.50.50...
Connected to mail.example.com.
Escape character is '^]'.
+OK Hello there.
USER tux
+OK Password required.
PASS secret
+OK logged in.
The LIST command summarizes all the messages it contains (nine in the following example) and their lengths:LIST
+OK POP3 clients that break here, they violate STD53.
1 9586
2 1125022
3 53125
4 2451
5 5931
6 4943
7 4206
8 5231
9 9481
.
The message from Courier in the +OK answer refers to POP3 clients that erroneously expect the server to return the number of messages in answer to the LIST command:
LIST
+OK 2 messages (320 octets)
1 120
2 200
.
RETR is used to retrieve a message from the server:
RETR 2
Return-Path: <p.heinlein@heinlein-support.de>
X-Original-To: p.heinlein@heinlein-support.de
Delivered-To: tux@example.com
Received: from 10.0.42.2 (unknown 10.0.42.2)
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(Client did not present a certificate)
by plasma.heinlein-support.de (Postfix) with ESMTP id BEA0581A4B
for <tux@example.com>; Sat, 7 Apr 2007 01:02:01 +0200 (CEST)
From: Peer Heinlein <p.heinlein@heinlein-support.de>
To: Tux <tux@example.com>
Subject: Test message 2
Date: Sat, 7 Apr 2007 01:02:01 +0200
User-Agent: KMail/1.9.5
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Message-Id: <200704070102.01895.p.heinlein@heinlein-support.de>
X-Length: 1519
Status: R
X-Status: NC
X-UID: 0
Hello!
I am a test message.
=2D-=20
Heinlein Professional Linux Support GmbH
Linux: Academy - Support - Hosting
http://www.heinlein-support.de

Legally required information according to =A735a HGB (German Commercial
Code)
HRB 93818 B / Amtsgericht Berlin-Charlottenburg,=20
Manager: Peer Heinlein =A0-- Seat: Berlin
 Flagging message 2 for deletion after it has been read is just as simple:
DELE 2
DELE 2
+OK Deleted.
However, it will not actually be deleted until the user logs out. This allows us to undo the setting of the deletion flag:
RSET
+OK Resurrected.
 If we do not wish to transfer an entire message to the client, we can use the TOP command to retrieve only the message headers and a specified number of lines of the mail body, given in a second argument to the command (seven in this case):
TOP 2 7
Return-Path: <p.heinlein@heinlein-support.de>
X-Original-To: p.heinlein@heinlein-support.de
Delivered-To: tux@example.com
Received: from 10.0.42.2 (unknown 10.0.42.2)
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(Client did not present a certificate)
by plasma.heinlein-support.de (Postfix) with ESMTP id BEA0581A4B
for <tux@example.com>; Sat, 7 Apr 2007 01:02:01 +0200 (CEST)
From: Peer Heinlein <p.heinlein@heinlein-support.de>
To: Tux <tux@example.com>
 There is also an "idle" command that enables the client to keep the connection open:
NOOP
+OK Yup.
The QUIT command is used to terminate the connection:
QUIT
+OK Bye-bye.
Connection closed by foreign host.

No comments:

Post a Comment

Have your say!