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