Telnet for POP3 and IMAP4

For testing purposes it is useful to know how to use TELNET to access a mailbox using the POP3 or the IMAP4 protocol. Suppose you have a mail server running with POP3 and IMAP4 enabled and you want to give it a try.

POP3

On a client open a command prompt and enter TELNET <<mailserver>> 110

If the server is running fine you’ll see a welcome message (like +OK The Microsoft Exchange POP3 service is ready) and you can enter the user credentials:

User <<username>>

Pass <<password>>

image

You are now successfully logged on. If you enter the LIST command all items in the Inbox are shown. RETR 1 will retrieve the first message in this list while DELE 1 will delete this first message. Bottom line is that you are successfully logged on, POP3 is running fine and the mailbox can be accessed.

Use the QUIT command to log off from the mailbox.

IMAP4

On a client computer open a command prompt and enter TELNET <<mailserver>> 143

If the server is running fine you’ll see a welcome message (like * OK The Microsoft Exchange IMAP4 service is ready) and you can enter the user credentials:

. login <<username>> <<password>>

That is: dot space login <<username>> <<password>>, you have to enter the dot and the space before the login command. If you omit either one the login will fail!

image

To get an overview of all the folders in the inbox you can use the LIST command:

. LIST “” “*”

Again, you have to enter the dot and the space before the actual LIST command.

Use the STATUS command to get the number of messages, for example:

. status inbox (messages)

image

Logoff from an IMAP4 session is a bit peculiar, use the CTRL + ] key combination, followed by the QUIT command (to actually quit the TELNET session).

image

Useful commands for a quick test of your mailbox and the POP3 and IMAP4 services.

If you want a complete overview of all commands please check this websites:

http://bobpeers.com/technical/telnet_imap and http://bobpeers.com/technical/telnet_pop

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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