Sat, 23 Dec 2006

Command Line Email Reading




telnet your.pop.server 110

eg. My email address is manages@cse.mrt.ac.lk , therefore my POP server is cse.mrt.ac.lk

Now let's go through the following sample telnet session. You will get to know the commands and their usage as we progress. After you have connected to the POP server, a message similar to the below will appear. Let's continue from there.

+OK sigiri POP3 Server (Version 1.004) ready.

USER manages

Use your login name instead manages, don't use mine.

+OK please send PASS command

PASS mypassword

 Use your email password, not mine.

+OK 2 messages ready for manages in /usr/spool/mail/manages

Note: Unlike most times when you enter your password, this time you will see it as you enter it. Please make sure that no one is staring at your screen over your shoulders.

list This will display the total number of messages and size again as well as a list with each file number, a space and its size. something similar to the following:

+OK 2 messages; msg# and size (in octets) for undeleted messages:

1 607
2 1323403
.

retr 2 Displays the message-2 including headers.

top 1 20 Displays the first 20 lines of the message-1. Unlike the retr command, this will not scroll the message to the end . It just shows the first 20 lines of the message body. This is useful if you want to read the whole message. The syntax of the retr command is

retr messageNo NumberOfLines

dele 2 Deletes the message-2. This is how you delete a message. You will see the confirmation for the deletion. In fact the message-2 is a mail bomb, you can identify it from the size. It is rather unusual to have a legitimate message of over 1MB.

+OK message 2 marked for deletion

If you type list again, you will see that message number 2 is indeed gone.

There are few more commands I have not discussed, the best way to learn them is to issue an incorrect command.

blah

-ERR Invalid command; valid commands: DELE, HOST, LAST, LIST, MBOX, NOOP, RETR, RSET, STAT, TOP or QUIT

Now you can play with the rest of commands. Note that some POP servers do not give this error message.

quit ends your session. Simply closing the telnet session may hang your mailbox.



Posted at: 12:59 | category: /mail | Comments ()