# A mail client warns that the certificate is for another name

UrbeStack sysadmin note about Dovecot. Last updated 30 Nov 2026.

A mail client connecting to `mail.example.com` warns that the certificate is for another name, the server's hostname. Dovecot and Postfix use the domain's certificate only if it covers the requested name, so point the name at this server and issue the certificate again.

## Symptoms

A mail client set to `mail.example.com` warns of a certificate name mismatch. The certificate it shows is issued for the server's hostname.

Check which certificate the server presents for `mail.example.com`.

```
openssl s_client -connect mail.example.com:993 -servername mail.example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -ext subjectAltName
```

```output
subject=CN=server.example.net
X509v3 Subject Alternative Name: 
    DNS:server.example.net
```

## Cause

For `mail.example.com` and `webmail.example.com`, Dovecot and Postfix present the domain's certificate if it covers the requested name or includes `*.example.com`. Otherwise, they present the server's certificate, which covers its hostname.

When this server handles a domain's mail, UrbeStack requests both names on the domain's certificate. Before requesting the certificate, UrbeStack checks that each name resolves to this server. It leaves off any name that fails that check, such as `mail.example.com` when its DNS record still points to an old server.

## Resolution

Check that `mail.example.com` resolves to this server's IP address.

```
dig +short mail.example.com
```

Correct the DNS record if it points elsewhere, then issue the domain's certificate again.

```
urbestack-cert-issue --name example.com --force
```

UrbeStack gives Dovecot and Postfix the new certificate. Run the `openssl` command from Symptoms again. The certificate names now include `mail.example.com`.

You can also set the mail client to use the server's hostname, which the server's certificate covers.

If the problem persists after you follow this note, you can [open a support ticket](https://support.urbestack.com/new?type=support). Including the output of the commands you ran helps support diagnose the problem.
