Session and mailbox states
01Authentication and mailbox selection enable different commands.
End the session rather than using IMAP to send a message.
Key idea: The major states are not authenticated, authenticated, selected, and logout.
Rules & examples
The major states are not authenticated, authenticated, selected, and logout.
- The major states are not authenticated, authenticated, selected, and logout.
- Successful authentication enters AUTHENTICATED; successful SELECT or EXAMINE enters SELECTED. Message-affecting commands require a selected mailbox.
- IMAP accesses mail; SMTP submission is a separate protocol.
This drawing follows ordinary successful authentication then mailbox selection. PREAUTH can start in AUTHENTICATED. A failed selection or successful CLOSE/UNSELECT returns to AUTHENTICATED; logout can end a session from any active state.
Sources
New to this? Start hereA quick picture + helpful background
The envelope and the letter do different jobs.
Mail transport moves a message between servers. The message format describes its contents. Authentication adds checks; it does not make every message safe.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
IMAP4rev2 folds in extensions including IDLE, MOVE, UIDPLUS, and ESEARCH, and adds support for 64-bit message and body-part sizes.
Read the updated RFC section ↗