An IMAP Session Play-by-Play

In this section we show and describe an actual IMAP session play-by-play. Our goal is to familiarize you with the most common IMAP operations. Knowing the operations will help you quickly troubleshoot problems independently of the client or server you’re working with.

In our examples, we use the tcpflow program (see Chapter 18, IMAP Tools , for information on where to obtain tcpflow) to examine the IMAP client-server interactions. tcpflow is a special protocol-analysis program that permits you to watch a conversation take place between a TCP-based client and server. tcpdump or your favorite protocol analysis program would work equally well.

Our session was generated in a Telnet session to the IMAP port on the server:

%telnet localhost imap

Commands are shown in bold, responses from the server are shown in plaintext:

A00001 CAPABILITY
* CAPABILITY IMAP4REV1 MAILBOX-REFERRALS LOGIN-REFERRALS AUTH=CRAM-MD5
A00001 OK Completed

Each command is preceded by an arbitrary tag. As we mentioned earlier, the tag is an arbitrary string that the server “tags” its responses with. The purpose is to help the client keep track of which response goes with which command. Appendix C, IMAP Commands , provides a complete list of IMAP commands. The commands used in the sample session are, for the most part, self-explanatory. In any case, they’re discussed in the explanation following Example 3-1, which shows the client/server conversation during an actual IMAP session and discusses ...

Get Managing IMAP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.