• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Let's Encrypt and "Assign the certificate to mail domain" problems and AutoDiscovery issues caused by this

DerDanilo

Basic Pleskian
Thanks for providing this option but it's missing some important features to be properly usable. Also there seem to be some kind of bugs (or it's designed this ways by default).
Auto discovery also still seems to have issues before being properly usable.

1. mail. / imap. / mail. / pop3. / pop. <domain> don't seem to be included when creating a certificate while also assigning it to the mailserver.

Plesk could check DNS for such subdomains and include them into the certificate. It would already be of great help if "mail.<domain>" would be included in the certificate request since auto discovery configured mail.<domain> per default. It's possible to make sure the name is included manually but this required extra steps (not good, nor does this scale).

In some cases auto discovery seems to configure the root domain as mail server which is a really(really!) bad idea. e.g. if a CDN or e.g BruteForce protection is used in front of the root domain website. Hence mail. or webmail. should be the default.

2. webmail.<domain> doesn't seem to be served with the right certificate by the mail server (IMAP + SMTP)

Webmail.<domain> is included in the same cert that is used by the website and also by the mailserver (Assign the certificate to mail domain"), so why isn't webmail.<domain> accepted here? Some SNI mapping seems

Hence when a mail client tries to connect to the mailserver using webmail.<domain> the server default cert is served.

For dovecot I could easily test to allow other mail (sub)domains:

Code:
/etc/dovecot/conf.d# cat 14-plesk-sni-<domain>.conf
local_name <domain> {
  ssl_cert = </opt/psa/var/certificates/scfOdrQcV
  ssl_key = </opt/psa/var/certificates/scfOdrQcV
}

local_name webmail.<domain> {
  ssl_cert = </opt/psa/var/certificates/scfOdrQcV
  ssl_key = </opt/psa/var/certificates/scfOdrQcV
}

systemctl restart dovecot

Postfix SNI maps are hased but should also be possible to change.

Code:
/etc/postfix/main.cf:tls_server_sni_maps = hash:/var/spool/postfix/plesk/certs

"mail.<domain>" seems to serve the selected (assign the cer...) certificate by default even though mail.<domain> is not included in a certificate request by default. Why is that?

- Why is mail.<domain> not included when assigning the certificate to the mailserver?
- Why seems mail.<domain> to be served with the selected certificate even though it's not even included in the cert alternative names?
- Why was this feature released if not fully tested and properly implemeted (full process tests with many pilot users) ?

In the current state it's more or less unusable since it just causes a lot of headache and customer tickets. So we have to stick to the default servername for now.

@plesk Team

Please "fix" these issues to make customer certificates properly usable.

It would also be of huge help if domains/subdomain/more domains that should be used for mail server config/SNI maps would be configurable in the `Panel.ini`.
Maybe these settings can find it's way into the mail server settings.
The same goes for the autodiscovery config -> What subdomain to use etc.

Thanks in advance!

---

Here is the content of my post on the autodiscovery support article:
Since Plesk seems to configure the root domain as default for autodiscover we have to change it (for now) in the Panel.ini.

Even though "mail.<domain>" is included in DNS Plesk does not include this subdomain in the certificate that is then beeing used for the mailserver. (Posted in the forum about this)

But "webmail.<domain>" is included in the certificate if enabled and therefore can be used as server address. This is anyways easier for most customers to remember. They can just use the same server name for webmail and mail clients. But again this doesn't seem reliable.

The "fun" fact here is that Plesk doesn't seem to provide the customers certificate when the customer enters webmail.<domain> as mailserver address. So where is the problem here? The certificate was selected to be used for the mailserver but doesn't work on some servers. (Weird)

So what to do?

Add the following lines to the Panel.ini file.

[mail]
clientConfig.incomingServer="webmail.<domain>"
clientConfig.outgoingServer="webmail.<domain>"
clientConfig.incomingProtocols="IMAP over SSL/TLS, POP3 over SSL/TLS"
clientConfig.outgoingProtocols="SMTP over SSL/TLS"

Also we did customize the DNS records somewhat to make this work:

_imaps._tcp.example.com. SRV webmail.example.com.
Weight: 1
Prio: 0
Port: 993

_imap._tcp.example.com. SRV webmail.example.com.
Weight: 1
Prio: 10
Port: 143

_pop3s._tcp.example.com. SRV webmail.example.com.
Weight: 1
Prio: 20
Port: 995

_smtps._tcp.example.com. SRV webmail.example.com.
Weight: 1
Prio: 0
Port: 465
 
Last edited:
What do you mean can we please have some more information on this? This is the most comprehensive explanation of the issue I have seen and as a hosting provider using Plesk for clients this is a big issue. Clients want to configure their mail service as they want, using whatever incoming and outgoing server address or sub domain for their mail domain i.e. imap.domain.co.uk (incoming) or smtp.domain.co.uk (outgoing). This does not work and they are forced to use either the domain name i.e. domain.co.uk or webmail.domain.co.uk (I think mail.domain.co.uk may also work) otherwise the server responds with the server hostname default certificate causing a certificate mismatch on mail clients.

I'm really struggling to get my head around what exactly you don't understand about this issue - it is easy to recreate and therefore should be easy to resolve!
 
Any progress on this request. Struggling with the same issue. SNI does not seem to work properly. Can you make there is a possibility in sending mail to include the certificate of the subdomain instead of the server only?
 
I know I'm late to the party but this is still something I'd really like to see happen. The subdomain mail.<domain> needs to be included with the Let's Encrypt SSL-sertificate when you enable "Assign the certificate to the mail domain".

That way there won't be any issues with the certificate not having this subdomain when another SMTP-server or a mail client connects to mail.yourdomain.com on IMAP/POP/SMTP.
 
first4it, I think "Can we please have some information on this?" is just DerDanilo being very polite in asking for a response. As you say, it is a very well researched and described issue. I came here having noted the "Assign the certificate to mail domain" option and wondering how it knew which MX hostname to include ... clearly it doesn't. I wasn't aware SNI was supported and so one host could support multiple MX hostnames. Are you doing this via the UI or CLI?
 
We also have clients that only have email service. We don’t have web or dns hosting. This doesn’t allow the use of customerdomain.tld as mail server on email client.

A good workaround was add webmail.customerdomain.tld as a server name indication (SNI):

  • How can we configure webmail.customerdomain.tld as a server name indication (SNI)?
  • A good and easy improvement to PLESK was add webmail.customerdomain.tld as a server name indication (SNI) by default.
 
We also have clients that only have email service. We don’t have web or dns hosting. This doesn’t allow the use of customerdomain.tld as mail server on email client.

A good workaround was add webmail.customerdomain.tld as a server name indication (SNI):

  • How can we configure webmail.customerdomain.tld as a server name indication (SNI)?
  • A good and easy improvement to PLESK was add webmail.customerdomain.tld as a server name indication (SNI) by default.
From experience I can say that the hostname of the server can always be used.
 
Back
Top