WhichWebHosting home

HomeGuidesEmail hostingWhat is IMAP?

What is IMAP?

Published

Share

IMAP is the Internet Message Access Protocol, and its version 4rev2 (IMAP4rev2) allows a client to access and manipulate email messages on a server.1, source 1 IMAP4rev2 lets a client manipulate mailboxes, which are remote message folders, in a way that is functionally equivalent to local folders.1, source 1 IMAP4rev2 does not specify a means of posting mail; that function is handled by a mail submission protocol such as the one specified in RFC 6409.1, source 1

What is IMAP and what does IMAP stand for?

IMAP4rev2 includes operations for creating, deleting, and renaming mailboxes, checking for new messages, and removing messages permanently.1, source 1 Its other operations include setting and clearing flags, searching, and selective fetching of message attributes, texts, and portions of them.1, source 1 In IMAP4rev2, messages are accessed by numbers, which are either message sequence numbers or unique identifiers.1, source 1 IMAP4rev2 also provides the capability for an offline client to resynchronize with the server.1, source 1

RFC 3501 specifies version 4rev1 of the Internet Message Access Protocol.2, source 2 RFC 9051, published in August 2021, specifies version 4rev2 and obsoletes RFC 3501.1, source 1 In RFC 8314, a Mail Access Server is a server for POP, IMAP, and any other protocol used to access or modify received messages.3, source 3

How does IMAP work?

An IMAP4rev2 connection is in one of four states.1, source 1 In the not authenticated state, the client must supply authentication credentials before most commands are permitted.1, source 1 In the selected state, a mailbox has been selected to access.1, source 1 The SELECT command selects a mailbox so that messages in the mailbox can be accessed.1, source 1

Each client command is prefixed with an identifier called a tag.1, source 1 The client may send another command without waiting for the completion response of the previous command, subject to ambiguity rules and flow control constraints.1, source 1 The FETCH command retrieves data associated with a message in the mailbox.1, source 1

At any time, an IMAP4rev2 server can send data that the client did not request.1, source 1 Without the IDLE command, a client would need to poll the server for changes to the selected mailbox, such as new mail, deletions, and flag changes.1, source 1 The IDLE command allows a client to tell the server that it is ready to accept real-time updates.1, source 1

An inactivity autologout timer that an IMAP4rev2 server applies to sessions after authentication must last at least 30 minutes.1, source 1 Clients using IDLE are advised to terminate IDLE and reissue it at least every 29 minutes to avoid being logged off.1, source 1

How is IMAP different from POP3?

RFC 1939, which defines POP3, describes IMAP4 as a more advanced and complex protocol.4, source 4 POP3, the Post Office Protocol version 3, is intended to permit a workstation to dynamically access a maildrop on a server host.4, source 4 POP3 is usually used to allow a workstation to retrieve mail that the server is holding for it.4, source 4 POP3 is not intended to provide extensive manipulation operations of mail on the server; normally, mail is downloaded and then deleted.4, source 4

The POP3 service listens on TCP port 110.4, source 4 For the POP service called pop3s, the default port is 995, and a TLS handshake begins immediately when the TCP connection is established.3, source 3 After the TCP connection opens and the POP3 server sends its greeting, the session enters the AUTHORIZATION state.4, source 4 A POP3 server may have an inactivity autologout timer, and such a timer must last at least 10 minutes.4, source 4

In POP3, the server marks a message as deleted but does not actually delete it until the session enters the UPDATE state.4, source 4 The POP3 session enters the UPDATE state when the client issues the QUIT command from the TRANSACTION state.4, source 4 One special case of a POP3 site policy is that messages may be downloaded only once from the server and are deleted after that.4, source 4

Which ports and encryption does IMAP use?

When IMAP4rev2 uses TCP, a server listens on port 143, the cleartext port, or port 993, the Implicit TLS port.1, source 1 When IMAP4rev1 uses TCP, a server listens on port 143.2, source 2 For the IMAP service called imaps, the default port is 993, and a TLS handshake begins immediately when the TCP connection is established.3, source 3 Once the TLS session is established on the imaps port, IMAP protocol messages are exchanged as TLS application data for the rest of the TCP connection.3, source 3

Implicit TLS is the automatic negotiation of TLS whenever a TCP connection is made on a particular TCP port that the server uses exclusively for TLS connections.3, source 3 RFC 8314 recommends Implicit TLS for POP, IMAP, SMTP Submission, and all other protocols used between a mail user agent and a mail service provider.3, source 3 It also calls for mail user agents and mail service providers to discourage the use of cleartext protocols for mail access and mail submission.3, source 3

An IMAP4rev2 server that listens on a cleartext port must allow the STARTTLS command on that port.1, source 1 The STARTTLS command is available only on cleartext ports.1, source 1 An IMAP4rev2 server must always answer a STARTTLS command received on an Implicit TLS port with a tagged BAD response.1, source 1

IMAP4rev2 protocol transactions, including email data, are sent in the clear over the network, exposing them to possible eavesdropping and manipulation unless protection is negotiated.1, source 1 That protection can come from the Implicit TLS port, the STARTTLS command, negotiated confidentiality protection in the AUTHENTICATE command, or some other protection mechanism.1, source 1 IMAP4rev2 clients and servers must implement TLS 1.2 or newer, and the use of TLS 1.3 is recommended.1, source 1 IMAP4rev2 clients should try both ports 993 and 143 concurrently by default, unless user configuration or DNS SRV records say otherwise.1, source 1

For Outlook.com, the IMAP server is outlook.office365.com, the IMAP port is 993, and the IMAP encryption is SSL/TLS.5, source 5

What are an IMAP account and an IMAP account password?

A mail account is your identity with a mail service provider, your authentication credentials, any of your email that the provider stores, and other per-user configuration information.3, source 3 For each account a mail user agent accesses, it must have the server names, ports, authentication credentials, and other configuration information that you specify.3, source 3 For Outlook.com, the username is your email address and the password is your Microsoft account password.5, source 5

In IMAP4rev2, the AUTHENTICATE or LOGIN command establishes authentication and enters the authenticated state.1, source 1 The AUTHENTICATE command provides a general mechanism for a variety of authentication techniques, privacy protection, and integrity checking.1, source 1 The LOGIN command should not be used except as a last resort, after attempting and failing to authenticate with the AUTHENTICATE command one or more times.1, source 1 Using the LOGIN command over an insecure network such as the Internet is a security risk, because anyone monitoring network traffic can obtain plaintext passwords.1, source 1

IMAP4rev2 server software must offer a configuration that advertises the LOGINDISABLED capability and does not permit the LOGIN command when nothing protects the session from password snooping.1, source 1 For Outlook.com, the authentication method listed for IMAP is OAuth2/Modern Auth.5, source 5 Gmail does not support third-party apps or devices that require you to share your Google username and password, and it calls Sign in with Google a safer way to sync your mail to other apps.6, source 6

When you cannot sign in to an email client with Gmail, one error you might see is "Username and password not accepted".6, source 6 With 2-Step Verification, Gmail suggests trying an app password in that case.6, source 6 Gmail says app passwords are not recommended and are unnecessary in most cases.6, source 6 You may need an app password if an Outlook.com password is not recognized, or you add the account to a smart device such as a home security camera.5, source 5

How do IMAP folders, flags and deleting work?

The case-insensitive mailbox name INBOX is reserved to mean your primary mailbox on the server.1, source 1 The DELETE command permanently removes the mailbox with the given name.1, source 1 The SUBSCRIBE command adds a mailbox name to the server's set of active or subscribed mailboxes, as returned by the LIST (SUBSCRIBED) command.1, source 1 A server may mark a mailbox with a special-use attribute, such as \Sent, to show its role.1, source 1

A \Sent mailbox is used to hold copies of messages that have been sent, and a \Drafts mailbox is used to hold draft messages.1, source 1 A \Trash mailbox is used to hold messages that have been deleted or marked for deletion, and an \Archive mailbox is used to archive messages.1, source 1 All special-use attributes are optional, and a given server or message store may support any combination of them, or none at all.1, source 1

The COPY command copies the specified messages to the end of the specified destination mailbox.1, source 1 The MOVE command creates a new message with a new UID in the target mailbox and removes the original message from the source mailbox, and it appears to the client as a single action.1, source 1

A message has a list of zero or more named tokens, known as flags.1, source 1 Among the system flags, \Seen means the message has been read, \Flagged marks a message for urgent or special attention, and \Draft means the message has not completed composition.1, source 1 The EXPUNGE command permanently removes all messages that have the \Deleted flag set from the selected mailbox.1, source 1

How do you set up IMAP in an email client?

Gmail can be added to other email clients, like Microsoft Outlook, Apple Mail, or Mozilla Thunderbird.6, source 6 To add Gmail to another email client, open the client on your device and look for an option to Sign in with Google.6, source 6 When you add Gmail, your messages and labels are synced with the email client.6, source 6 Older versions of email clients, such as Outlook 2016, may not support the modern security standards that Gmail recommends.6, source 6

With a personal Google Account, IMAP access is always turned on in Gmail, and from January 2025 there is no option to choose Enable IMAP or Disable IMAP.6, source 6 POP and IMAP access in Outlook.com is disabled by default.5, source 5

  1. To enable POP or IMAP access in Outlook.com, select Settings, then Mail, then Forwarding and IMAP.5, source 5
  2. Under POP and IMAP, turn the slider for Let devices and apps use IMAP to on, and then select Save.5, source 5

Outlook and Outlook.com may be able to detect an account's mailbox settings automatically, but for other non-Microsoft accounts you may need to contact your email provider for the settings.5, source 5 In cPanel, the Email Accounts interface is for creating, managing, and deleting email accounts for your cPanel account's domains.7, source 7 You can use these email accounts to send and receive email messages from your domains.7, source 7 Your hosting provider can enable or disable the Email Accounts interface in WHM's Feature Manager.7, source 7

You may be downloading too many emails at one time if an email client crashes or emails take too long to download with Gmail.6, source 6 To fix that, you can set IMAP in Gmail to sync only folders with 10,000 emails or fewer.6, source 6 In Gmail's Forwarding and POP/IMAP tab, the IMAP access section has Folder size limits with an option to limit IMAP folders to contain no more than a chosen number of messages.6, source 6 A Google Workspace account managed by an organization may not have access to the Forwarding and POP/IMAP tab.6, source 6

For Outlook.com, you may get a connection error if you configured the account as IMAP in multiple email clients.5, source 5 A Gmail account can be added to up to 15 email clients at a time.6, source 6 You may get the "Too many simultaneous connections" error if many email clients get messages from your Gmail account at the same time.6, source 6

Common questions

What does IMAP stand for?

It stands for Internet Message Access Protocol. It lets an email client access and manipulate email messages on a server, with remote mailboxes that work like local folders.

What is an IMAP account?

It's a mail account: your identity with a mail service provider. The account also covers your authentication credentials, any of your email the provider stores, and other per-user configuration information.

What port does IMAP use?

IMAP uses port 143 or port 993. Port 143 is the cleartext port, and port 993 is the Implicit TLS port. On port 993, a TLS handshake begins as soon as the TCP connection is established.

Is IMAP the same as POP3?

No. POP3 is a separate protocol intended for dynamic access to a maildrop on a server host. POP3 normally downloads mail and then deletes it, while IMAP interacts with remote message folders.

Do I need an app password for IMAP?

Sometimes. With 2-Step Verification, Gmail suggests trying an app password when you can't sign in to an email client, but it says app passwords aren't recommended and are unnecessary in most cases. For Outlook.com, you may need one if your password isn't recognized or you add the account to a smart device.

Does IMAP send email?

No. IMAP does not specify a means of posting mail. A separate mail submission protocol handles that function.

More guides

Email hosting

Does 123 Reg hosting include email?

123 Reg's Web Hosting, Hosting for WordPress and Premium Hosting plans include email addresses, and 123 Reg sells Titan and Microsoft 365 email plans.

· Mateo Cardenas

Email hosting

Does web hosting include business email?

Web hosting sometimes includes business email. See what SiteGround, Namecheap and HostGator state, then how MX records and SPF records work.

· Mateo Cardenas

Email hosting

How to log in to Hostinger webmail

Find out how to log in to Hostinger Webmail at mail.hostinger.com, access your inbox directly from hPanel, and connect third-party mail apps via IMAP.

· Mateo Cardenas

Email hosting

How to log in to IONOS webmail

Learn how to log in to IONOS webmail at mail.ionos.com, manage automatic login, use two-step verification, and apply the right server settings for email.

· Mateo Cardenas