A mail client warns that the certificate is for another name
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 subjectAltNamesubject=CN=server.example.net
X509v3 Subject Alternative Name:
DNS:server.example.netCause
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.comresolves to this server's IP address.dig +short mail.example.comCorrect the DNS record if it points elsewhere, then issue the domain's certificate again.
urbestack-cert-issue --name example.com --forceUrbeStack gives Dovecot and Postfix the new certificate. Run the
opensslcommand from Symptoms again. The certificate names now includemail.example.com.You can also set the mail client to use the server's hostname, which the server's certificate covers.