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
Split and Reassemble files
Viewed 1373 times since Mon, May 28, 2018
RHEL: Extending a vmdk (Virtual Machine disk)
Viewed 1616 times since Sun, May 27, 2018
OCFS2 Cluster File System Setup Guide in Linux
Viewed 2203 times since Sat, Jun 2, 2018
How To Use Systemctl to Manage Systemd Services and Units
Viewed 255 times since Mon, Dec 7, 2020
O’Reilly’s CD bookshelf
Viewed 6187 times since Wed, Jun 27, 2018
Build a simple RPM that packages a single file
Viewed 1552 times since Sat, Jun 2, 2018
Set Up SSH Tunneling on a Linux / Unix / BSD Server To Bypass NAT
Viewed 477 times since Fri, May 15, 2020
12 Tcpdump Commands – A Network Sniffer Tool
Viewed 965 times since Fri, Jul 27, 2018
watchdog How to restart a process out of crontab on a Linux/Unix
Viewed 3201 times since Tue, Jul 31, 2018
Check a Website Availability from the Linux Command Line
Viewed 675 times since Mon, Feb 18, 2019