New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
SecurityUpdated 26 Oct 2026

SMTP Server Certificates: Choosing, Installing, Renewing and Monitoring TLS Certificates for Mail

How to manage TLS certificates on mail servers: which names to put on them, public versus private CAs, chain and SAN issues, automated renewal, expiry monitoring, SNI, MTA-STS and DANE effects, and troubleshooting steps.

DW
Written by Daniel Whitfield
IP Reputation and Warm-up Lead
Reviewed by Omar Haddad
  • Published11 Aug 2025
  • Read time6 min
  • Length1,181 words
Share this guide

Encryption between mail servers depends on certificates, and certificates expire. A lapsed certificate on a submission port makes mail clients and applications refuse to connect; on a receiving server, it can make strict senders defer or bounce mail when they require validated TLS. Unlike many technical faults, an expired certificate is entirely predictable, and yet it remains one of the common causes of mail outages. This guide explains what a mail server certificate must contain, how receivers and clients validate it, how to obtain and install it, how to automate renewal, how MTA-STS and DANE change the stakes, and how to monitor and troubleshoot. For the client-side error messages, see SMTP certificate errors and TLS troubleshooting.

NamesThe certificate must cover the hostname clients and MX records use, not just your website name
ChainServe the leaf and intermediate certificates; the root is provided by the client
RenewalAutomate it and test that the mail service reloads the new certificate
MonitorAlert at least 21 days before expiry on every port and hostname

Who checks the certificate and how

ConnectionTypical validationConsequence of a bad certificate
Mail client or application to submission port (587 or 465)Full validation: trusted chain, matching name, valid datesConnection refused or warning; sending stops
Server to server on port 25, defaultOpportunistic: most senders accept any certificate, expired or not, to keep mail flowingMail continues, but without real protection
Server to server with MTA-STS enforceValidated chain and name match required. See MTA-STSMail is deferred or fails to MTA-STS-aware senders
Server to server with DANECertificate must match TLSA records. See DANE for SMTPMail is deferred to DANE-aware senders if it does not match
IMAP and POP clientsFull validationClients stop fetching mail

What the certificate must contain

  • The right names. The Subject Alternative Name list must include every hostname that clients or senders use to reach the server: the MX target (mx1.example.com), the submission hostname (smtp.example.com) and, for MTA-STS, the names listed in the policy. A certificate for www.example.com only will not match.
  • Wildcards (*.example.com) cover one label. They are convenient but widen the damage if the key leaks.
  • Server authentication usage. The certificate must permit server use, which public authorities do by default.
  • A trusted issuer. For public mail, use a certificate from a widely trusted authority. Private authorities work only inside organisations that distribute the root.
  • Key strength. RSA 2048 bits or an ECDSA P-256 key are common; follow your authority's and your policy's requirements.
  • Validity dates. Public certificates have limited lifetimes that have been getting shorter; plan for frequent renewal.

Obtaining and installing

  1. Generate a private key on the server (or in a managed key store) and create a certificate signing request that lists the names.
  2. Choose an authority. Free automated authorities using the ACME protocol are widely used for mail; commercial authorities offer longer support terms.
  3. Prove control of each name. For HTTP validation the mail host needs a web endpoint; for DNS validation you add a TXT record, which works for hosts without a web server. See DNS records for email.
  4. Install the full chain file (leaf plus intermediates) in the order the mail software expects.
  5. Point the mail software at the new files, reload it and confirm with a test connection.
# Inspect what a server presents, including the chain and expiry
openssl s_client -starttls smtp -connect mx1.example.com:25 -servername mx1.example.com -showcerts </dev/null 2>/dev/null \
  | openssl x509 -noout -subject -issuer -dates -ext subjectAltName

The -servername option sends SNI, which matters when one IP address serves several hostnames. Test both with and without it, because some servers present a default certificate when SNI is missing, and some senders do not send SNI.

Automated renewal

  • Use an ACME client with a scheduled job, and renew well before expiry (for example when thirty days remain on a ninety-day certificate).
  • Run a deploy hook that copies the new files and reloads the mail service. Many outages happen because the file was renewed but the process kept the old certificate in memory.
  • Restrict permissions on private keys and avoid keeping copies in backups with wide access.
  • If several servers share a name, make sure all receive the new certificate, or use a central store.
  • Test the process on a staging host and by forcing a renewal before the first real one.

Common problems

ProblemCauseFix
Name mismatchCertificate does not list the MX or submission hostnameReissue with correct SANs
Incomplete chainIntermediate certificate missingInstall the full chain; check with an online or openssl test
Expired certificateRenewal failed or service not reloadedFix automation and add monitoring
Different certificate per portPorts 25, 465 and 587 configured separatelyUpdate all listeners
Old TLS versions or weak ciphersOutdated configurationSupport TLS 1.2 and 1.3 only, and modern ciphers
Wrong certificate by SNIDefault virtual host serves the wrong certificateConfigure SNI maps properly
DANE mismatch after renewalTLSA records still point to the old keyRoll TLSA records before changing keys; use the 3 1 1 form if possible
Clock skewServer time wrongRun time synchronisation

Special cases

Several situations deserve their own attention. Servers behind a load balancer need the same certificate on every node, and the balancer itself may terminate TLS, so check which device presents the certificate to the world. Hosted mail from a provider usually handles certificates for you, but custom domains used for tracking, images or return paths may need their own certificates. Mail servers that serve many customer domains often present one certificate for the server name and rely on policies, not per-domain certificates, for validation. If you use client certificates for authentication between systems, track their expiry too, because they fail silently in the same way.

Finally, test the failure case on purpose. In a staging environment, install an expired or mismatched certificate and see what your applications do: some fail loudly, others retry for hours, and a few quietly fall back to unencrypted mail, which you should never allow. Knowing the behaviour in advance turns an outage into a known procedure.

Monitoring

Check expiry from the outside, as senders see it, not just from the file on disk. Probe every hostname and port: 25, 465, 587 and any IMAP or POP ports. Alert at several thresholds (30, 14 and 7 days), send alerts to people and not only to a shared mailbox, and include certificate checks in your runbook. Watch TLS reports from MTA-STS, which tell you when senders fail to validate your certificate. Track certificate transparency logs for unexpected issuance for your domains. See delivery monitoring and DNSSEC and CAA for control over who may issue.

Rotation and key hygiene

  • Rotate keys on renewal where policy allows; reuse of a key is acceptable only if your policy says so.
  • Revoke and replace certificates immediately if a private key is exposed.
  • Keep an inventory of certificates with owner, hostnames, issuer, expiry and renewal method.
  • Document emergency steps: who can issue, where files live, how to reload services.

A mail certificate is routine maintenance that becomes an incident only when nobody owns it. Automate issuance, verify the live result from outside, and keep monitoring simple and loud.

Run mail on a managed, monitored platform Let us handle TLS for your sending infrastructure.

Explore the SMTP relay

References and further reading

Frequently asked questions

Which names must an SMTP certificate cover?

Every hostname used to reach the server: MX targets, the submission hostname and any names in your MTA-STS policy.

Does an expired certificate stop incoming mail?

Often not for ordinary port 25 traffic, but senders using MTA-STS enforce or DANE will defer mail, and client connections will fail.

Why does the old certificate still appear after renewal?

The mail service was not reloaded. Add a deploy hook that reloads it.

Can I use a wildcard certificate for mail?

Yes, if it covers the hostnames, but weigh the wider impact of a leaked key.

How do I test what the server presents?

Use openssl s_client with -starttls smtp and -servername, then read the chain and dates.

Topics#tls#certificates#smtp#renewal#monitoring
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales