For almost every modern provider, IMAP settings come down to three values: the incoming server name, port 993 and SSL/TLS encryption. The username is normally your full email address, and for Gmail, Yahoo and iCloud the password is usually an app-specific password rather than your normal login password.
This sheet lists the server names for Gmail, Outlook.com, Yahoo, iCloud and Zoho, explains the settings that matter, and covers the errors people hit when a client refuses to connect. Providers change names, authentication rules and menu paths from time to time, so treat the table as a starting point and confirm against the provider's current documentation if a value does not work.
IMAP settings by provider
| Provider | Incoming server | Port and security | Notes |
|---|---|---|---|
| Gmail | imap.gmail.com | 993, SSL/TLS | Use an app password (requires 2-Step Verification) or a client that supports Google sign-in (OAuth) |
| Outlook.com, Hotmail, Live | outlook.office365.com | 993, SSL/TLS | Microsoft has been moving consumer accounts to modern authentication, so use a client that supports Microsoft sign-in |
| Yahoo Mail | imap.mail.yahoo.com | 993, SSL/TLS | Generate an app password in Account Security |
| iCloud Mail | imap.mail.me.com | 993, SSL/TLS | Requires an app-specific password from your Apple Account |
| Zoho Mail | imap.zoho.com | 993, SSL/TLS | IMAP access must be enabled in Zoho settings. Other regions use their own domain, such as imap.zoho.eu or imap.zoho.in |
For Microsoft 365 work and school accounts the server is also commonly outlook.office365.com, but an administrator may restrict IMAP or require modern authentication. See Outlook and Microsoft 365 settings for the sending side.
How to read each setting
- Server name. A DNS hostname. A typo here produces errors such as host not found or connection timed out.
- Port. 993 is IMAP over implicit TLS: the connection is encrypted from the first byte. Port 143 starts in plain text and upgrades with STARTTLS.
- Security. Choose SSL/TLS for 993 and STARTTLS for 143. Mixing them, for example STARTTLS on 993, causes a hang or a handshake error.
- Username. Use the full address unless the provider documents otherwise. Zoho and some hosted domains need the full address of the mailbox, not an alias.
- Authentication. Normal password, app password or OAuth 2.0. The client must support whichever method the provider requires.
If you are unsure what IMAP does compared with POP3 and SMTP, read IMAP, POP3 and SMTP compared. In short, IMAP keeps mail on the server and synchronises folders and read state across devices, while SMTP only sends.
App passwords and OAuth
Major providers have stopped accepting your ordinary account password from third-party mail clients. Two methods replace it. An app password is a generated, single-purpose password that you paste into the client. OAuth 2.0 lets the client open the provider's own sign-in page and receive a token, so no password is stored in the client at all. Where a client offers a Sign in with Google or Sign in with Microsoft button, use it.
To create an app password you normally need two-step verification switched on first. The menu names differ between providers and change over time, so search the provider's help for app passwords. Our overview app passwords explained covers when each is needed, and OAuth 2.0 for SMTP and IMAP explains the token flow.
Test the connection before blaming the client
When a client says it cannot connect, test the server directly. If the test works, the problem is in the client settings. If it fails, the problem is the network, the server name or the credentials. The OpenSSL client is available on Linux, macOS and Windows with a recent installation.
openssl s_client -connect imap.gmail.com:993 -quiet
# After the greeting (* OK ...), type the following lines:
a1 LOGIN [email protected] app-password-here
a2 LIST "" "*"
a3 LOGOUTA successful login returns a1 OK, and a failed one returns a1 NO with a reason. A connection that never prints the greeting points to a firewall, a wrong port or a security mode mismatch. Do not paste a real password into shared terminals or logs, and rotate any app password you test with.
Minimal client configuration examples
Most clients accept the same four values. In a configuration file for a tool such as isync (mbsync), the Gmail incoming block looks like this.
IMAPAccount gmail
Host imap.gmail.com
Port 993
User [email protected]
PassCmd "pass show mail/gmail-app-password"
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crtThe same pattern works for the other providers: change the host, keep port 993 and IMAPS. For Python scripts, the standard library imaplib.IMAP4_SSL(host, 993) follows the same rule and expects an app password or OAuth token.
Choosing IMAP, POP3 or both
- Use IMAP if you read mail on more than one device. Folders, flags and deletions stay consistent.
- Use POP3 only if you need to download and remove mail from the server, for example to archive locally. See POP3 and how it compares with IMAP.
- Remember that iCloud does not offer POP3, so IMAP is the only choice there.
- Keep outgoing mail on SMTP with its own settings: port 587 with STARTTLS or 465 with SSL/TLS, depending on the provider.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Authentication failed or invalid credentials | Normal password used where an app password or OAuth is required | Create an app password, or use the client sign-in button |
| Cannot connect to server, timeout | Wrong server name, port blocked by firewall or antivirus mail scanning | Check the hostname, try another network, disable mail scanning that intercepts port 993 |
| Handshake or SSL error | Security type mismatch, for example STARTTLS selected for port 993 | Use SSL/TLS with 993 or STARTTLS with 143 |
| Certificate warning | Old client, wrong server name or a device clock that is wrong | Correct the hostname and the date and time. Do not click through repeated warnings |
| IMAP disabled message | Access switched off in provider settings or by an administrator | Enable IMAP in the account settings or ask your administrator |
| Folders missing or sent mail in the wrong place | Folder mapping not set in the client | Map Sent, Drafts and Trash manually in the account settings |
| Works on the phone but not the desktop client | Client does not support the required sign-in method | Update the client or switch to one that supports OAuth |
Security habits for mail client credentials
- Use a separate app password for each device or application so that you can revoke one without affecting the rest.
- Never share the app password in tickets or chat. Treat it as equivalent to your account password for mail.
- Prefer OAuth where the client offers it, because tokens can expire and be revoked.
- Keep operating systems and mail clients updated, since older TLS libraries may be rejected by providers.
- Avoid public Wi-Fi without a VPN when you must use unencrypted port 143, or better, do not use it at all.
Incoming settings are only half of the picture. To send mail from the same client you also need the matching outgoing server, covered for Gmail in Gmail SMTP settings and for Apple in iCloud SMTP settings. If the client refuses to authenticate for sending, SMTP 535 authentication failed explains the cause.
When to use these settings and next steps
Use this cheat sheet when you add an existing mailbox to a client such as Thunderbird, Apple Mail, Outlook or a phone app. If you run your own application that must send transactional or bulk mail, do not route it through a personal mailbox. Personal mailboxes have sending limits and are meant for people. A dedicated relay with its own credentials, proper authentication and event reporting is a better fit, and the incoming IMAP settings above do not apply to it.
Sending from an application? Use a dedicated SMTP relay with its own credentials instead of a personal mailbox.
References and further reading
Frequently asked questions
What are the IMAP settings for Gmail?
Server imap.gmail.com, port 993, SSL/TLS, your full address as username and an app password or Google sign-in as authentication.
Which IMAP port should I use?
Port 993 with SSL/TLS is the standard choice. Port 143 with STARTTLS also exists but is less commonly recommended.
Why does my correct password fail over IMAP?
Large providers usually require an app password or OAuth for third-party clients, so the normal account password is rejected.
Does iCloud support POP3?
No. iCloud Mail is accessed with IMAP, using imap.mail.me.com on port 993 and an app-specific password.
Are IMAP settings the same as SMTP settings?
No. IMAP receives and syncs mail from one server, while SMTP sends mail through another, with its own host and ports.