HowTo: Retrieve Email from a POP3 Server using the Command Line

The POP3 (Post Office Protocol Version 3) is an application-layer Internet standard protocol used by local Email clients to retrieve Email from a remote server over a TCP/IP connection.

This tutorial shows how to connect to POP3 mail server and manage incoming Email using the ‘telnet’ command.

Step 1: Open a connection from your computer to a POP3 mail server

$ telnet pop.domain.ext 110
Trying ???.???.???.???...
Connected to pop.domain.ext.
Escape character is '^]'.
+OK ready
  • pop.domain.ext – Your mail server;
  • 110 – Default port for POP3.

Step 2: Type your Login

> USER username
+OK Password required for UserName.

Step 3: Type your Password

> PASS password
+OK username has ? visible messages (? hidden) in ????? octets.

POP3 Commands with Description

Here are the basic POP3 commands, that you can use to manage your incoming Email.

CommandDescriptionExample
USER [username] 1st login command USER Stan
+OK Please enter a password
PASS [password] 2nd login command PASS SeCrEt
+OK valid logon
QUIT Logs out and saves any changes QUIT
+OK Bye-bye.
STAT Returns total number of messages and total size STAT
+OK 2 320
LIST Lists all messages LIST
+OK 2 messages (320 octets)
1 120
2 200
…
LIST 2
+OK 2 200
RETR [message] Retrieves the whole message RETR 1
+OK 120 octets follow.
***
DELE [message] Deletes the specified message DELE 2
+OK message deleted
NOOP The POP3 server does nothing, it merely replies with a positive response. NOOP
+OK
RSET Undelete the message if any marked for deletion RSET
+OK maildrop has 2 messages (320 octets)
TOP [message] [number] Returns the headers and number of lines from the message TOP 1 10
+OK
***
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Fix rpmdb: Thread died in Berkeley DB library
Viewed 22308 times since Fri, Feb 14, 2020
SSH: Execute Remote Command or Script – Linux
Viewed 3278 times since Mon, Feb 18, 2019
YUM CRON RHEL7: Configure automatic updates.
Viewed 2781 times since Fri, Oct 26, 2018
Using renice and taskset to manage process priority and CPU affinity with Linux OEL 6.4
Viewed 4903 times since Mon, Feb 17, 2020
Prosty skaner portów TCP w bash
Viewed 4151 times since Thu, May 24, 2018
how to list all hard disks in linux from command line
Viewed 5687 times since Mon, Jan 28, 2019
Enabling or disabling a repository using Red Hat Subscription Management
Viewed 14703 times since Mon, Oct 29, 2018
Exclude multiple files and directories with rsync
Viewed 3392 times since Wed, Oct 31, 2018
Linux: Disks diagnostic using smartctl
Viewed 16319 times since Wed, Jul 25, 2018
Linux nslookup Command Examples for DNS Lookup
Viewed 10245 times since Sat, Sep 29, 2018