Skip to content

Configuring an email client for a cPanel mailbox — the correct IMAP, SMTP, and SSL settings

The host, port, and SSL settings that actually work for a cPanel mailbox in Outlook, Apple Mail, and mobile — IMAP vs POP, ports 993/465/587, and why the secure-server hostname matters for the certificate.

Setting up a cPanel mailbox in a mail client fails for one of three reasons almost every time: the wrong hostname (so the SSL certificate does not match and the client warns or refuses), the wrong port/encryption pair, or POP where IMAP was meant. cPanel publishes the exact settings per mailbox, and they are not guesses — the only judgment calls are IMAP vs POP and which hostname gives you a valid certificate. Get those right and Outlook, Apple Mail, and a phone all connect on the first try.

What’s happening

cPanel runs Dovecot for incoming mail (IMAP and POP3) and Exim for outgoing (SMTP submission). Each listens on a standard secure port: IMAP over SSL/TLS on 993, POP3 over SSL/TLS on 995, and SMTP submission on 465 (implicit TLS) or 587 (STARTTLS). The mailbox’s full address is the username and its password is the password — there is no separate “mail login.”

The setting people get wrong is the hostname, and it matters because of the certificate. cPanel’s per-mailbox instructions offer two host options. The “Secure SSL/TLS Settings” use the server’s hostname (something like server.host.tld or mailNNN.provider.com) — that name is on the server’s SSL certificate, so the connection validates cleanly. The convenient-looking mail.yourdomain.com only validates if that hostname is actually covered by a certificate on the server (it is, if the domain has AutoSSL and a mail. entry, but often it is not). Use the host that matches a valid certificate and the SSL warning disappears; use mail.yourdomain.com against a cert that does not list it and the client either warns on every send/receive or refuses outright. IMAP vs POP is the other choice: IMAP keeps mail on the server and syncs every device to the same state; POP downloads and (by default) removes, which breaks multi-device and inflates local storage. For anyone with a phone and a laptop, IMAP is the answer.

How to verify

Get the exact settings cPanel publishes for the mailbox, and the server’s real mail hostname:

# cPanel's own per-account mail-client settings (host, ports, SSL)
whmapi1 get_autodiscover_mail_settings 2>/dev/null
# The server hostname that the SSL cert is issued for
hostname -f
cat /var/cpanel/mainip 2>/dev/null

Confirm the secure ports are actually listening and answer TLS before you blame the client:

# Are Dovecot (993/995) and Exim submission (465/587) listening?
ss -lntp | grep -E ':(993|995|587|465)\b'

# Does IMAPS present a valid certificate on the server hostname?
openssl s_client -connect server.host.tld:993 -servername server.host.tld </dev/null 2>/dev/null | openssl x509 -noout -subject -dates

Check the certificate names so you know which hostname will validate:

# What names are on the cert the mail service presents?
openssl s_client -connect server.host.tld:993 -servername server.host.tld </dev/null 2>/dev/null \
  | openssl x509 -noout -text | grep -A1 'Subject Alternative Name'

The fix

  1. Read the per-mailbox settings from cPanel first. In cPanel » Email » Email Accounts, click Connect Devices (or Set Up Mail Client) for the address. cPanel shows the exact Secure SSL/TLS Settings — incoming/outgoing host, ports, and protocol — for that mailbox. Those are authoritative; use them rather than guessing or copying another provider’s values.
  2. Use the server hostname, not mail.yourdomain.com, unless the cert covers it. Set both incoming and outgoing host to the value cPanel lists under Secure SSL/TLS (the server’s own hostname). That name is on the server certificate, so SSL validates. Only use mail.yourdomain.com if you have confirmed (with the openssl check above) that it is in the certificate’s Subject Alternative Names — otherwise it triggers a name-mismatch warning.
  3. Choose IMAP on 993 for incoming. Set incoming to IMAP, port 993, encryption SSL/TLS. IMAP keeps mail on the server so every device shows the same inbox, sent, and folders. Pick POP3 (port 995) only for a deliberate single-device archive that pulls mail off the server — and even then, set “leave on server” carefully or it deletes server-side copies.
  4. Set outgoing SMTP to 465 (SSL/TLS) or 587 (STARTTLS). Set outgoing to SMTP, port 465 with SSL/TLS, or 587 with STARTTLS — both work; pick whichever the client offers cleanly. Crucially, turn on “My outgoing server requires authentication” and reuse the same username and password as incoming. The single most common send failure is SMTP auth left off (covered in the SMTP 535 article).
  5. Use the full email address as the username. The username is the complete address (user@example.com), never just user. The password is the mailbox password set in cPanel. If the user does not know it, reset it under Email Accounts » Manage » Security » Change Password rather than trying variations in the client.
  6. In Outlook, add the account manually, not via autodiscover. Outlook’s automatic setup frequently guesses Microsoft 365 or the wrong host for a cPanel mailbox. Choose manual / IMAP setup and enter the cPanel-published host and ports by hand. After it connects, verify in account settings that the outgoing server shows 465/587 with authentication on — Outlook sometimes silently sets port 25.
  7. On Apple Mail and iOS, enter the same values and let it verify. Add a mail account as Other, enter address and password, then on the manual screen put IMAP host/993 and SMTP host/465 (or 587). iOS will test and may stall if it cannot validate the certificate — that stall is the hostname/cert mismatch from step 2, not a password problem. Use the server hostname that validates and it completes.
  8. If the certificate warning persists, fix the cert, not the client. A name-mismatch warning means the hostname you entered is not on the server’s certificate. Either switch the client to the hostname that is (the server’s own name), or have the operator add the mail hostname to AutoSSL so mail.yourdomain.com becomes valid — then the friendlier hostname works everywhere. Do not tell users to “accept” or ignore the warning; that trains them to dismiss real ones.

A mail client is configured correctly when it connects without a certificate warning, syncs with IMAP across every device, and sends with SMTP authentication on. Stack Harbor sets up and troubleshoots cPanel mail-client configuration under managed cPanel operations — start a conversation when clients will not connect.