From LQWiki
SUSE 9.3 example
$ telnet localhost 143 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION] Courier-IMAP ready. Copyright 1998-2004 Double Precision, Inc. See COPYING for distribution information.
Now you type the logout command:
LOGOUT * BYE Courier-IMAP server shutting down LOGOUT OK LOGOUT completed Connection closed by foreign host.
SUSE 10.3 example
$ 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:
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

This page is available under a