What do certificate warnings on a mail server mean, and how do I fix them?

Our SMTP test reads the certificate a mail server presents when TLS starts, and can report four problems: it isn't trusted, it doesn't cover the host name, it has expired, or it expires within 14 days. On port 25 many senders still deliver despite a bad certificate, because encryption between servers is usually opportunistic, but senders that enforce MTA-STS hold the mail back, as do DANE senders when the certificate doesn't match the domain's TLSA record, and mail apps on ports 587 and 465 can refuse or warn.

Last reviewed: 5 December 2026.

Who checks a mail server's certificate, and how strictly

Other mail servers check it on port 25 and mail apps check it on 587 and 465, and the two groups react very differently to a bad certificate.

Read moreShow less: Who checks a mail server's certificate, and how strictly

Servers delivering to you on port 25. When your server lists STARTTLS, a sending server can upgrade the connection to TLS before handing over a message. RFC 3207, the STARTTLS standard, leaves the question of whether to believe the certificate to each side as a local matter. RFC 7435 calls the usual approach opportunistic security: encrypt when you can, without demanding proof of who is at the other end. Postfix's default sending level from version 3.11 on, "may", works this way; at an older compatibility level the default is no TLS at all. So for many senders, a bad certificate on your MX host changes how the mail travels, not whether it arrives.

Senders that apply MTA-STS (RFC 8461). A domain opts in with a TXT record at _mta-sts under the domain and a policy file on its mta-sts web host. The certificate rules are short: not expired, chained to a root the sender trusts, and the MX hostname among its subject alternative names. In enforce mode, senders that honour it must not deliver to a host that fails. They try the next MX host, then treat the failure as temporary and retry, so mail waits in their queues and can bounce if the problem lasts. In testing mode they deliver anyway.

Senders that use DANE (RFC 7672). The domain publishes DNSSEC-signed TLSA records at a name such as _25._tcp.mail.example.com. A sender that finds usable records must check the server against them and must not deliver if that check fails. With DANE-EE, the record type RFC 7672 recommends, the sender only checks that the server's certificate or key matches the record: names and the expiry date are ignored.

Mail apps and devices on 587 and 465. RFC 8314 says email programs must validate the server's certificate, and a new account's default must require that validation to succeed. So a broken certificate on your submission host can show up as people who can't send, or who see a security prompt.

What our certificate check covers

It verifies the chain against the root list bundled with Node.js, matches the certificate's names against the host it connected to, and counts the days to expiry.

Read moreShow less: What our certificate check covers

Our test server starts TLS as a sender would, sends the tested host's name in the handshake (the SNI name, which RFC 8461 requires senders to set to the MX hostname), accepts whatever certificate comes back so it can describe it, and checks three things:

  • The chain. Our test server runs on Node.js, which tries to build a path from your certificate to a root in the copy of Mozilla's publicly trusted root list that ships with it.
  • The name. It compares the host it connected to with the DNS names in the certificate, wildcards included. With the MX box ticked, that host is the MX hostname, not your domain.
  • The dates. It counts whole days, rounded down, from the moment of the test to the certificate's end date.

The results, worded as in the test's source code, with the host name and number filled in from your server:

What the SMTP test can say about a certificate
Warning  Certificate isn't trusted
Warning  Certificate doesn't cover <host name>
Fail     Certificate expired <n> days ago
Warning  Certificate expires in <n> days
Pass     Certificate valid until <date>     (only when none of the four apply)

They appear on the SMTP test and in the "Extra: mail server connection" box of the domain health check, which tests port 25 of the main mail server and is marked "Not part of the grade".

What the certificate check can't see

It doesn't read MTA-STS policies or DANE records, doesn't check revocation, never connects over IPv6, tests one address of one MX host, and runs from a single server.

Read moreShow less: What the certificate check can't see
  • MTA-STS policies. It never fetches the policy file, so it can't tell whether your MX hosts match its mx lines. The health check only shows whether the _mta-sts TXT record exists.
  • DANE. It doesn't look up TLSA records. A DANE-EE server with a self-signed certificate gets "isn't trusted" from us, while DANE senders accept it if the key matches.
  • Revocation. It doesn't ask whether the certificate has been revoked, a check RFC 8461 leaves optional for senders too.
  • IPv6. It connects over IPv4 only, so a different certificate on your IPv6 address goes unseen.
  • Other addresses and MX hosts. It tests the first IPv4 address of one host; with the MX box ticked, the MX host with the lowest preference number. Type other MX hostnames in to test them.
  • Other vantage points. Each result comes from one server at one moment.

One gap in the name check: if a certificate has no DNS names in its subject alternative name list, we match its common name instead, which RFC 9525 no longer allows and RFC 8461 doesn't accept.

"Certificate isn't trusted"

The certificate didn't verify up to a root our test server trusts, usually because it's self-signed, signed by a private authority, or sent without its intermediate certificate.

Read moreShow less: "Certificate isn't trusted"

What it means. The finding reads "The certificate chain didn't verify", with a code in brackets from our server's TLS library:

  • DEPTH_ZERO_SELF_SIGNED_CERT: the certificate signed itself.
  • SELF_SIGNED_CERT_IN_CHAIN: the server sent a chain ending in a root that isn't on the public list, which is how a private certificate authority looks when the server includes its root.
  • UNABLE_TO_VERIFY_LEAF_SIGNATURE or UNABLE_TO_GET_ISSUER_CERT_LOCALLY: the issuer couldn't be found, often because the server leaves out the intermediate certificate linking it to the root, or because a private authority's root isn't sent and isn't on the list.
  • CERT_HAS_EXPIRED or ERR_TLS_CERT_ALTNAME_INVALID: the real problem is the date or the name, covered below.

What breaks. Senders enforcing MTA-STS won't deliver, since the policy requires a chain to a root they trust. Mail apps following RFC 8314 refuse or warn.

What doesn't. Opportunistic senders often carry on. Postfix's documentation expects public MX hosts without a publicly signed certificate to present a self-signed or private one. DANE-EE senders never consult the root list.

How to fix it. Get a certificate from a public certificate authority for the host's name, and make the server send the whole chain. TLS 1.3 puts the server's own certificate first, then each certificate that signed the one before it; only the root may be left out. In Postfix's smtpd_tls_chain_files, that means the private key, then the certificate, then the intermediates.

"Certificate doesn't cover" the host name

The name the sender connected to, which for mail is the MX hostname rather than your email domain, isn't among the DNS names in the certificate.

Read moreShow less: "Certificate doesn't cover" the host name

What it means. The title ends with the host we connected to, and the explanation lists up to four names the certificate does carry. Senders connect to the hostname in your MX record, so that's the name MTA-STS senders and our test look for: if mail for example.com goes to mail.example.net, a certificate for example.com alone doesn't help.

RFC 8461 makes it a rule for MTA-STS: a DNS name matching the MX hostname in the subject alternative name list. Under RFC 9525, which replaced RFC 6125, only that list counts, and a wildcard can stand only for the whole left-most label. So *.example.com covers mail.example.com, but not example.com or mx.mail.example.com.

Our server's TLS library can also count a wrong name as a failed chain verification, so this warning can come with "Certificate isn't trusted" and ERR_TLS_CERT_ALTNAME_INVALID in brackets.

What breaks. MTA-STS senders in enforce mode won't deliver to the host, and mail apps refuse or warn.

What doesn't. Opportunistic senders often deliver anyway, and DANE-EE senders skip name checks by design.

How to fix it. Add the MX hostname to the certificate's names, or point your MX record at a hostname the certificate already covers, as the test's own fix text says. If you publish an MTA-STS policy, check that its mx lines match the name you end up with.

When the certificate has expired

Once the end date passes, our test reports a failure, senders that enforce MTA-STS stop delivering, and mail apps can refuse to connect until you renew.

Read moreShow less: When the certificate has expired

What it means. Every certificate has a last valid moment, the "notAfter" date in RFC 5280. Any negative day count gives the Fail "Certificate expired" with the number of days, explained as: "Senders that enforce MTA-STS won't deliver to it. Most others still deliver, because TLS between mail servers is usually opportunistic." The chain check can report it too, as "isn't trusted" with CERT_HAS_EXPIRED in brackets.

What breaks. Enforcing MTA-STS senders queue your mail and retry. RFC 7435 also describes sending servers that accept self-signed certificates but not expired ones, and drop to plain text instead. Mail apps can stop hardest: RFC 8314 lets a program offer to pin a failing certificate only while an account is being set up, never for an account that already exists, so people can find they can't send until you renew.

What doesn't. Opportunistic senders that don't check dates keep delivering. DANE-EE senders ignore the date, because the DNSSEC signature on the TLSA record sets how long the key is trusted.

How to fix it. The test's fix reads "Renew the certificate and reload the mail server." Make sure the renewed file is the one the mail server reads. If renewal was meant to be automatic, find out why it didn't run.

When the certificate expires within 14 days

Our test warns from 13 days left down to 0, a prompt to renew now or to find out why automatic renewal hasn't happened yet.

Read moreShow less: When the certificate expires within 14 days

What it means. Under 14 whole days left gives the Warning "Certificate expires in" that many days, with the end date and the fix "Renew it now, or check that automatic renewal works." The 14-day line is our choice, not a standard. Because the count rounds down, a certificate with hours left reads "expires in 0 days".

What breaks and what doesn't. Nothing breaks yet: RFC 5280 counts a certificate as valid from its notBefore time through its notAfter time, so checks that pass today keep passing until the end date.

How to fix it. If you renew by hand, do it now and reload the server. If an ACME client renews for you, a certificate this close to its end can mean renewal has been failing quietly. Check its log, run it by hand, and confirm the server loaded the new file.

How long a certificate can last now

Publicly trusted TLS certificates issued since 15 March 2026 may last at most 200 days, falling to 100 days from 15 March 2027 and 47 days from 15 March 2029.

Read moreShow less: How long a certificate can last now

The CA/Browser Forum's Baseline Requirements set the rules public certificate authorities follow. Version 2.3.2, dated 3 December 2026, gives this schedule in section 6.3.2:

Maximum validity of publicly trusted TLS certificates (Baseline Requirements 2.3.2, section 6.3.2)
Issued before 15 March 2026                          398 days
Issued 15 March 2026 to 14 March 2027                200 days
Issued 15 March 2027 to 14 March 2029                100 days
Issued on or after 15 March 2029                      47 days

Self-signed and private certificates aren't bound by these limits, though they bring the trust problems above.

A certificate renewed by hand once a year now needs renewing at least twice a year, and from 2029 at least every 47 days. Google's certificates in the examples below run from 3 November 2026 to 26 January 2027, 84 days.

Automating renewal with ACME

ACME (RFC 8555) lets software request and renew certificates with no person involved, proving control of the name over HTTP on port 80 or with a DNS TXT record.

Read moreShow less: Automating renewal with ACME

RFC 8555 lets servers get certificates "without user interaction". It defines two ways for the authority to check that you control the name, and RFC 8737 adds a third, TLS-ALPN, answered on port 443:

  • HTTP challenge. The authority fetches a file from the name over HTTP on port 80, so something on that host has to answer there, a web server or a temporary one run by your ACME client.
  • DNS challenge. You publish a TXT record at _acme-challenge under the name, which suits mail hosts if your ACME client can update your DNS.

For mail servers, add a reload of the mail service to the renewal hook so the new certificate is loaded. If you use DANE, RFC 7672 requires a TLSA record for a new key to be published before the server starts using it; a DANE-EE record of the recommended kind needn't change if each renewal keeps the same key.

Worked examples: Google's certificates, checked 5 December 2026

Gmail's MX host and its submission server both passed every certificate check, each with a Google Trust Services certificate valid until 26 January 2027, which the test counted as 51 whole days left.

Read moreShow less: Worked examples: Google's certificates, checked 5 December 2026

These runs come from our production SMTP test, starting at 12:50:08 UTC. None failed a certificate check, so the sections above quote the test's wording instead.

gmail.com on port 25, MX ticked. The test picked gmail-smtp-in.l.google.com, the first of gmail.com's five MX hosts by preference, and upgraded with STARTTLS to TLS 1.3. The certificate's subject was mx.google.com, not the host we connected to, yet the name check passed: its subject alternative name list held 26 names, including gmail-smtp-in.l.google.com and its four alt siblings. One certificate covers all five of Gmail's MX hostnames, which is the fix our name warning suggests.

SMTP test, gmail.com (MX gmail-smtp-in.l.google.com), port 25, 5 December 2026 12:50:08 UTC
Certificate          mx.google.com, issued by Google Trust Services
Valid                2026-11-03 to 2027-01-26, 51 days left
Names on certificate 26, including gmail-smtp-in.l.google.com
Hostname match       yes
Chain trusted        yes
Finding              Pass  Certificate valid until 2027-01-26
                     Issued by Google Trust Services for mx.google.com; it matches the hostname and the chain verifies.

smtp.gmail.com on 587 and 465. Both ports presented a different certificate whose only name was smtp.gmail.com, from the same issuer with the same dates. On 587 it arrived after STARTTLS, on 465 before the greeting, and both passed the chain, name and date checks.

Check and fix your own mail server, step by step

Find your MX hosts, test each on port 25, test your submission host on 587 or 465, fix what the results name, then test again.

Read moreShow less: Check and fix your own mail server, step by step
  1. List your MX hosts. Put your domain into the MX lookup. Every hostname it shows must be covered by a certificate.
  2. Test them on port 25. In the SMTP test, type your domain with the MX box ticked, then each other MX hostname on its own.
  3. Test where your users send from. Test your submission hostname on 587 or 465; our guide to SMTP ports explains which is which.
  4. Fix the name first, since that needs a new certificate anyway, then the chain, then the date.
  5. Check MTA-STS if you use it. Look up the _mta-sts TXT record with the DNS lookup. If it exists, confirm every MX hostname matches an mx line in your policy before using enforce.
  6. Test again with the "Re-check after you change the server" button.

If senders are returning your mail, emails bouncing back explains how to read the bounce. Outgoing mail that arrives but lands in junk is a different problem, covered in emails going to spam.

Mail server certificate questions

Short answers on missed mail, self-signed certificates, double warnings and the health score.

Will an expired certificate stop me receiving email?

From many senders, no: they encrypt opportunistically and either ignore the date or fall back to plain text. Senders enforcing your MTA-STS policy hold the mail and retry, and it can bounce if you don't renew. Your own users' mail apps can show it too, since RFC 8314 has them validate the certificate.

Can I use a self-signed certificate on my mail server?

On an MX host it works for opportunistic senders, and Postfix's documentation describes it as the fallback for public MX hosts. It fails MTA-STS, and mail apps will warn or refuse on your submission host.

Why can the test show two certificate warnings for one problem?

Our server's TLS library can count an expired certificate, or one that doesn't cover the host name, as a failed chain verification too. So "isn't trusted" with CERT_HAS_EXPIRED or ERR_TLS_CERT_ALTNAME_INVALID in brackets can be the expiry or the name problem shown a second time.

Does a certificate problem lower my domain's health score?

No. The mail server test on the health check is an extra marked "Not part of the grade".

Related guides, tools and problems

These pages cover the tests used above and the problems a bad mail server certificate can lead to.