Email security · Practical guide

Configure business email with verified IMAP and SMTP TLS settings

Choose the provider hostname, distinguish implicit TLS from STARTTLS, verify certificates with OpenSSL and troubleshoot authentication without leaking passwords.

Archive placement: August 2022

A padlock and keys on a keyboard

A secure mail setup depends on the correct server hostname, transport mode and authentication settings. Port numbers are useful clues, but a mail client still needs to validate the certificate and use the settings supplied for the actual account. Copying a generic hostname or accepting a certificate warning can leave a connection broken or expose credentials.

Record the account details from a trusted source

In cPanel, open the relevant mailbox and its device connection settings where available. Record the full username format, incoming and outgoing hostnames, ports and encryption modes. The correct TLS hostname may be a provider-managed name rather than your domain's mail subdomain.

Check whether the mailbox is actually hosted in cPanel or at an external provider. The web hosting location and the email location do not have to match. Public MX records describe inbound delivery routing, but they do not necessarily give the authenticated submission or IMAP hostname that clients should use.

Inspect inbound mail routing without guessing client settings
dig example.com MX +noall +answer
dig mail.example.com A +noall +answer
dig mail.example.com AAAA +noall +answer

Understand the transport mode before testing a port

  • IMAP on port 993 normally begins TLS immediately, then carries mailbox commands inside that connection.
  • SMTP submission on port 587 commonly starts with a plain protocol greeting and upgrades through STARTTLS.
  • SMTP submission on port 465 normally begins TLS immediately. Use it only when the provider supports it.
  • Port 25 is principally server-to-server SMTP and may be restricted; it is not a substitute for the documented authenticated submission service.

A wrong mode can produce a TLS error even when the server is healthy. For example, opening implicit TLS against a STARTTLS listener skips the required protocol negotiation. Configure the client to require the intended encryption rather than silently falling back when an upgrade fails.

Verify IMAP and SMTP certificates without logging in

Test IMAP with implicit TLS
openssl s_client -connect mail.example.com:993 \
  -servername mail.example.com -verify_hostname mail.example.com \
  -verify_return_error </dev/null
Test SMTP submission with STARTTLS
openssl s_client -starttls smtp -connect mail.example.com:587 \
  -servername mail.example.com -verify_hostname mail.example.com \
  -verify_return_error </dev/null
Alternative only when the provider documents port 465
openssl s_client -connect mail.example.com:465 \
  -servername mail.example.com -verify_hostname mail.example.com \
  -verify_return_error </dev/null

A successful certificate verification establishes the tested TLS endpoint's identity under your workstation's trust configuration. It does not validate mailbox credentials, quotas or message delivery. An OpenSSL trust-store problem on the test machine can also differ from a current mail client, so inspect the reported chain error rather than assuming the account is at fault.

Configure authentication in the client and test both directions

Enter the account details in the mail client itself, not in a shell command that may retain them in history. Outgoing mail usually requires authentication independently of incoming mail. An account that receives messages successfully can still fail SMTP submission because the outgoing username, password or method is wrong.

Send a small test to an external mailbox you control and reply to it. Confirm the correct From address, sent folder, received message and timestamps. Test from the networks users actually use when practical; a local firewall or ISP restriction can affect one location while the provider service is healthy.

If the provider supports OAuth or application-specific credentials, follow its documented policy. Do not assume enabling MFA on the hosting panel automatically protects ordinary IMAP or SMTP password authentication.

Troubleshoot by layer instead of repeatedly resetting passwords

A timeout suggests reachability, filtering or the wrong address; a hostname mismatch suggests a certificate or hostname problem; an authentication rejection occurs later in the protocol. Record the exact error, hostname, port, encryption mode and time without recording the password.

For delivery failures after successful submission, inspect the bounce and the provider's delivery tools. DNS authentication, remote policy and mailbox quotas are separate from client TLS setup. Avoid deleting and recreating a mailbox as a first troubleshooting step, because that can put stored messages and settings at risk.

Document the supported setup and keep it current

Store the verified settings in your organization's onboarding documentation and remove old insecure alternatives. Keep mail clients updated and review recovery access when employees change roles. Ask support to resolve persistent certificate warnings rather than training users to dismiss them.

For a support request, provide the redacted connection error, the tested hostname and port, and whether sending, receiving or both are affected. That evidence identifies the failing layer much faster than a report that email is simply down.

Primary documentation

← Back to all guidesDiscuss your hosting setup ↗