My 2 paisas

Accessing POP3 email accounts using telnet

Posted on: June 11, 2009

  • Coutsey to Bob Peers
  • The basics.

    About POP.

    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 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
    this exercise.

    Using telnet.

    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 with the address of your POP server:

    telnet 110

    This should return something like:

    telnet 110
    Connected to (
    Escape character is '^]'.
    +OK Hello there.

    Logging in.

    Next we need to log in using the user command.

    user myusername
    +OK Password required.

    Now give our password using the pass command.

    pass ***********
    +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.
    1 22683
    2 19870
    3 785
    4 4475
    5 3221
    6 2972
    7 2412

    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.

    retr 7
    +OK 2412 octets follow.
    Return-Path: <>
    Received: from ( [])
    by (Postfix) with ESMTP id 554DA180D71
    for <>; Wed, 1 Feb 2006 10:09:54 +0100 (CET)
    Received: from ( [])
    by (Postfix) with ESMTP id 2984C7049
    for <>; Tue, 31 Jan 2006 18:37:01 +0100 (CET)
    Received: from frontend1.internal (mysql-sessions.internal [])
    by (Postfix) with ESMTP id 2069DD335A7
    for <>; Tue, 31 Jan 2006 12:36:18 -0500 (EST)
    Received: from ([])
    by frontend1.internal (MEProxy); Tue, 31 Jan 2006 12:36:18 -0500
    Received: by (Postfix, from userid 99)
    id 1148513964; Tue, 31 Jan 2006 12:36:12 -0500 (EST)
    Content-Disposition: inline
    Content-Transfer-Encoding: 7bit
    Content-Type: text/plain
    MIME-Version: 1.0
    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" <>
    Reply-To: "Email Administrator" <>
    Subject: Your account activation
    Message-Id: <>


    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.

    Content-Type: text/plain;

    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.

    dele 7
    +OK Deleted.

    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).

    +OK Resurrected.

    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.

    +OK Bye-bye.


    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.

    Tags: , ,

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )


    Connecting to %s

    Links that I liked to save

    Blog Stats

    • 45,141 hits
    %d bloggers like this: