IMAP server testing at command level

Modified on Mon, 23 May 2016 at 12:25 PM

Open a CMD (command prompt)
From now on, commands you need to type are highlighted - other text is an example of what to expect returned form the IMAP server. This test will allow you to test logging onto the IMAP server, listing folders, and fetching info about a specific email.

Telnet mail.domainname.com 143 (Replace mail.domainname.com with the mail server hostname)

* OK IMAP4rev1 SmarterMail
A1 LOGIN emailname@domainname.com Pa$$w0rd (Replace emailname@domainname.com with the email address of the mailbox user that you want to connect to, and replace Pa$$w0rd with the mailbox user's password)
* CAPABILITY IMAP4rev1 UIDPLUS XLIST IDLE
? OK LOGIN completed
A2 LIST "" "*" (This will list any IMAP folders)
* LIST (\Unmarked) "/" "Deleted Items"

* LIST (\Marked) "/" "Inbox"
* LIST (\Unmarked) "/" "Junk E-Mail"
* LIST (\Unmarked) "/" "Sent Items"
? OK LIST completed
A3 Select Inbox (This will select the "Inbox" IMAP folder, listed above)
* 12892 EXISTS

* 0 RECENT
* OK [UNSEEN 89] Message 89 is first unseen
* OK [UIDVALIDITY 0] UIDs valid
* OK [UIDNEXT 37] Predicted next UID
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)]
? OK [READ-WRITE] SELECT completed
A4 FETCH 1 Body (This will list the email BODY details for message number 1)
* 1 FETCH (BODY ("text" "html" ("charset" "utf-8") NIL NIL "8bit" 114 2))

? OK FETCH completed
A5 FETCH 1 All
* 1 FETCH (FLAGS (\SEEN) INTERNALDATE "29-Oct-2013 11:11:59 +0000" RFC822.SIZE 692 ENVELOPE ("29-Oct-2013 11:11:59 +0000
" "=?utf-8?B?TWljcm9zb2Z0IE91dGxvb2sgVGVzdCBNZXNzYWdl?=" (({17}
Microsoft Outlook NIL "EMAILNAME" "DOMAINNAME.COM")) (({17}
Microsoft Outlook NIL "EMAILNAME" "DOMAINNAME.COM")) NIL (({20}
=?utf-8?B?dGVzdA==?= NIL "EMAILNAME" "DOMAINNAME.COM")) NIL NIL NIL "<838b6800392f4f8cbe00410d15eeb661@com>"))
? OK FETCH completed
A6 LOGOUT (This will logout)
* BYE IMAP4rev1 Server logging out
? OK LOGOUT completed

Connection to host lost.


Notes: The full RFC for the IMAP 4 (revision 1) protocol is available at http://tools.ietf.org/html/rfc3501. Please note a significant requirement in this version:
2.2.1.  Client Protocol Sender and Server Protocol Receiver
   The client command begins an operation.  Each client command is
   prefixed with an identifier (typically a short alphanumeric string,
   e.g., A0001, A0002, etc.) called a "tag".  A different tag is
   generated by the client for each command.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article