Testing IMAP via telnet

You can "talk" with an imap server via telnet, e.g. for testing purposes. The following example has been tested with SUSE 10.3 but should work same or similar with any Linux. $ telnet localhost 143 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. * OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=DIGEST-MD5 AUTH=CRAM-MD5 SASL-IR] tweedleburg Cyrus IMAP4 v2.3.8 server ready Now you type the login command with a strange number preceeding: 1 LOGIN testuser password 1 OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE X-NETSCAPE URLAUTH] User logged in Now you select the inbox. Please note this varies between imap servers - cyrus calls the inbox "INBOX", Courier-IMAP calls it "Inbox": 1 SELECT Inbox * FLAGS (\Answered \Flagged \Draft \Deleted \Seen) * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)] * 1 EXISTS * 0 RECENT * OK [UIDVALIDITY 1217915379] * OK [UIDNEXT 2] * OK [NOMODSEQ] Sorry, modsequences have not been enabled on this mailbox * OK [URLMECH INTERNAL] 1 OK [READ-WRITE] Completed You see that 1 mail exists. You want to know if there are any items in the inbox: 4 LIST "" "INBOX" * LIST (\HasChildren) "." "INBOX" 4 OK Completed (0.000 secs 3 calls) 3 uid fetch 2:* (UID RFC822.SIZE FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)]) * 1 FETCH (FLAGS (\Seen) UID 1 RFC822.SIZE 3408 ENVELOPE ("Tue, 5 Aug 2008 07:23:13 +0200" "[Kde-pim] making Konqueror a Kontact plugin to add URLs to Kontact side bar" (("Who Ever" NIL "wever" "not.net")) (("Who Ever" NIL "wever" "not.net")) (("KDE PIM" NIL "kde-pim" "kde.org")) ((NIL NIL "kde-pim" "kde.org")) NIL NIL NIL "<20080805052313.GC2844@not.net>") BODY[HEADER.FIELDS (REFERENCES)] {2} ) 3 OK Completed (0.000 sec) Now you type the logout command: 1 LOGOUT * BYE LOGOUT received 1 OK Completed Connection closed by foreign host.

= See also =
 * http://networking.ringofsaturn.com/Protocols/imap.php
 * http://www.networksorcery.com/enp/protocol/imap.htm
 * http://www.networksorcery.com/enp/rfc/rfc3501.txt