Talking IMAP

Quick procedure to test that an IMAP account is working using telnet. Good for WordPress Postie plugin admins to know.

First, connect:

[me@mine ~]$ telnet imap.example.com 143
Trying 10.254.0.5...
Connected to imap.example.com.
Escape character is '^]'.
* OK The Microsoft Exchange IMAP4 service is ready.

Now login:

? LOGIN myname mypass
+ OK LOGIN completed.

List folders:

? LIST "" "*"
* LIST (\HasNoChildren) "/" Calendar
* LIST (\HasNoChildren) "/" Contacts
* LIST (\HasNoChildren) "/" "Deleted Items"
* LIST (\HasNoChildren) "/" Drafts
* LIST (\Marked \HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" Journal
* LIST (\HasNoChildren) "/" "Junk E-mail"
* LIST (\HasNoChildren) "/" Notes
* LIST (\HasNoChildren) "/" Outbox
* LIST (\HasNoChildren) "/" "Sent Items"
* LIST (\HasNoChildren) "/" Tasks
? OK LIST completed.

Check the Inbox:

? EXAMINE INBOX
* 314 EXISTS
* 0 RECENT
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
...
? OK [READ-ONLY] EXAMINE completed.

Get the first message in the queue:

? FETCH 1 BODY[]

To logout and end the session:

? LOGOUT
* BYE Microsoft Exchange Server 2010 IMAP4 server signing off.
? OK LOGOUT completed.
Connection closed by foreign host.
This entry was posted in System Administration, Systems Analysis on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).