Posts Tagged ‘POP3’
POP is simply a protocol for retrieving emails from a remote server. The vast majority of mail
providers use this protocol and it has been around for many years now. The protocol, in it’s
simplest form, is just a few text commands sent from your computer over the internet which when received by the mail server prompt it to respond with the
requested information. There’s only 4 or 5 basic commands we need to know to get started so it’s very simple.
Before starting it’s important to know a few things:
Mail server address.
The address of your mail server, this will usually be of the form mail.domain.com. You should look at the settings in your email client or documentation about your
email account to get this information.
In this demonstration we will be sending our account username and password unencrypted over the internet, if this is a major concern to you then you should not follow
If you make a mistake in a telnet session you cannot use backspace to delete the entry, you may have to press enter to get an error and then re-type the command or quit and start again.
Connecting to the host.
First open up a terminal and type the following, of course replacing mail.yourserver.dk with the address of your POP server:
telnet mail.myserver.dk 110
This should return something like:
telnet mail.myserver.dk 110
Connected to mail.myserver.dk (172.16.0.2).
Escape character is '^]'.
+OK Hello there.
Next we need to log in using the user command.
+OK Password required.
Now give our password using the pass command.
+OK logged in.
The list command.
To see a list of all the messages on the server and their sizes in bytes use the list command. If you specify a message number then only that message will be shown,
i.e list 7.
+OK POP3 clients that break here, they violate STD53.
This just shows that I have 7 emails on the server, they are listed in order from oldest first to newest last.
Reading the messages using retr.
To read one of the messages use the retr command followed
by the message number returned from the list command. It will return the whole message including all headers.
+OK 2412 octets follow.
Received: from mail-in1.inet.tele.dk (mail-in1.inet.tele.dk [18.104.22.168])
by cirkeline.ingolf.dk (Postfix) with ESMTP id 554DA180D71
for <firstname.lastname@example.org>; Wed, 1 Feb 2006 10:09:54 +0100 (CET)
Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [22.214.171.124])
by mail-in1.inet.tele.dk (Postfix) with ESMTP id 2984C7049
for <email@example.com>; Tue, 31 Jan 2006 18:37:01 +0100 (CET)
Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149])
by frontend1.messagingengine.com (Postfix) with ESMTP id 2069DD335A7
for <firstname.lastname@example.org>; Tue, 31 Jan 2006 12:36:18 -0500 (EST)
Received: from web2.messagingengine.com ([10.202.2.211])
by frontend1.internal (MEProxy); Tue, 31 Jan 2006 12:36:18 -0500
Received: by web2.messagingengine.com (Postfix, from userid 99)
id 1148513964; Tue, 31 Jan 2006 12:36:12 -0500 (EST)
X-Mailer: MIME::Lite 5022 (F2.73; T1.15; A1.64; B3.05; Q3.03)
Date: Tue, 31 Jan 2006 17:36:12 UT
From: "Email Administrator" <email@example.com>
Reply-To: "Email Administrator" <firstname.lastname@example.org>
Subject: Your www.domain.com account activation
Reading the top n lines with top.
The top command is used to read the top n lines of a message, the syntax is ‘top message n’ where n is the number of lines you wish to read. Note
that the full headers will be returned along with a new line and then the n lines of the message body.
top 3 5
Headers appear here.....
This is a multi-part message in MIME format.
The stat command.
To see the total number and size of all messages issue the stat command.
+OK 7 56418
Deleting messages using dele.
To delete a message use dele followed by the message number, note that messages are not immediately deleted, they will only be deleted after quitting the session.
The stat command again shows the message is gone.
+OK 6 54006
Resetting the account using rset.
Since the message is only marked for deletion we can undelete the message (and any other marked for deletion) by using rset (for reset).
Again, stat shows the message is now back.
+OK 7 56418
To end the session use quit, this will now permanently delete the messages you deleted during this session.
It’s very simple to read your emails from a POP account using telnet by just remembering a few simple commands, what we have done here is basically exactly
the same as an email client, like Thunderbird or Outlook Express, does when it retrieves your mail. Of course on a daily basis it’s much nicer to use a web interface
or email client but in those situations where all you have is an internet connection then this is a great fall-back especially since nearly every computer will
have telnet already installed.
- In: Uncategorized
- Leave a Comment
– messages load very quickly once they’re downloaded
– messages are stored on your hard drive so they’re not accessible from other computers
– messages are stored on the server are accessible from any computer and webmail anywhere in the world
– messages load slower, in particular the first time they’re read