IMAP (Internet Message Access Protocol) is the standard protocol for email clients to retrieve and manage email from mail servers. Understanding IMAP helps you understand how your email client syncs with your mail server.
What is IMAP?
IMAP is a client-server protocol that allows email clients to access email stored on a mail server. Unlike POP, which downloads messages to the client, IMAP keeps messages on the server and synchronizes state between multiple clients. This is why you can access the same email from your phone, computer, and webmail and see consistent state.
How IMAP works
- Connection establishment. The client connects to the IMAP server on port 143 (standard) or 993 (IMAPS).
- Authentication. The client authenticates using username and password (or OAuth tokens).
- Mailbox selection. The client selects a mailbox (typically INBOX).
- State synchronization. The client fetches message flags, headers, or content as needed.
- Operations. The client can read, delete, move, flag, or copy messages. These operations are synchronized with the server.
- IDLE mode. Many clients use IMAP IDLE to receive push notifications of new messages.
IMAP versus POP
| Feature | IMAP | POP |
|---|---|---|
| Message storage | Kept on server | Downloaded to client |
| Multi-device sync | Yes | No |
| Server-side search | Yes | No |
| Folder management | Yes | Limited |
| Bandwidth usage | Higher (headers only) | Lower (full download) |
| Offline access | Limited | Full |
Key IMAP features
Server-side search: IMAP allows searching messages on the server, useful for large mailboxes.
Folder hierarchy: IMAP supports nested folders for organizing email.
Flags and keywords: Messages can be flagged (read, deleted, flagged) and have custom keywords.
Partial fetching: Clients can fetch just headers or message bodies, reducing bandwidth usage.
Concurrent access: Multiple clients can access the same mailbox simultaneously with state synchronization.
IMAP ports
Port 143: Standard IMAP port. STARTTLS can be used for encryption.
Port 993: IMAPS (IMAP over SSL/TLS). Encrypted from the start.
Temporary email and IMAP
Temporary email services do not expose IMAP access. The inbox is accessed through a web interface that polls for new messages via HTTP. This is a deliberate design choice — IMAP would require account credentials and persistent state, which contradicts the disposable nature of the service. For permanent email, IMAP is the standard for client access.