POP3 on the command line

You sometimes find the need to run a protocol dialogue on the command line via telnet. I recently had to do this for POP3. In fact it's quite simple if you follow the example below where lines starting with a plus are responses from the server:

  1. telnet my.pop.server 110
  2. Trying 123.456.789.123...
  3. Connected to my.pop.server.
  4. Escape character is '^]'.
  5. +OK Hello there.
  6. user user@my.pop.server
  7. +OK Password required.
  8. pass secret
  9. +OK logged in.
  10. list
  11. +OK POP3 clients that break here, they violate STD53.
  12. 1 2213
  13. 2 2823
  14. .
  15. retr 1
  16. +OK 2213 octets follow.
  17. [email content]
  18. .
  19. dele 1
  20. +OK Deleted.
  21. quit
  22. +OK Bye-bye.

The answer of the server could have a slightly different text which differs from server to server. However the dialogue is still the same.

The most common command shows the list below

command
explanation

quit
terminates the session and deletes messages marked for deletion

stat
statistics about total count and size of mails

list
list of mail and their size

retr no.
retrieve the content of mail with number no.

dele no.
mark mail no. for deletion

noop
no operation, returns an OK (useful to keep the connection up)

rset
resets all changes and marks

top no. lines
show the first lines of message number no.

user name
authenticate as user name

pass password
submit password for current user

uidl
show unique ID of each mail (this is used by your POP3 client if you like to keep the mail on the server)

Technorati Tags:Technorati Tags:

Trackback URL for this post:

http://www.schnuckelig.eu/trackback/95
No votes yet