Several mail domains on one server

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g., so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command:
I host several mail domains and try to encrypt them all with the server’s FQDN
So I generated a certbot certificate for that FQDN and use the FQDN as the mail server in my MTA imap configurations.
I’ve tested an email through and tried to read mails from different MTA

It produced this output:

Cert Hostname DOES NOT VERIFY ( !=
So email is encrypted but the host is not verified

I succeed to get mails from thunderbird under laptop Kubutnu 19.10 where I can bypass certificate but under mobile Android client I get “the server doesn’t support TLS.”

My web server is (include version):
Debian GNU/Linux 9 (stretch)

The operating system my web server runs on is (include version):
Kubutnu 19.10

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
Used ISPCONFIG but not anymore

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):
certbot 0.31.0

Are mail servers automatically deducted as mail.domain.tld ?
In that case there is no way to certificate with server’s FQDN ?
How can I solve that ?

I remember that passed years, I used a global certificate including all domains and subdomains. But that is heavy and leads to remake the certificate each time a new domain is created.
What solution do you recommend ?


1 Like

you can get a certificate for multiple domains. (without including every domain)

certbot [your options] -d -d
1 Like

I don’t understand how that would work. I use POSTFIX / DOVECOT mail servers whitch both use same certificate /etc/postfix/smtpd.cert. If I use above generated certificate here, webologix domain MTA will work OK but won’t other domains as for instance domain would look for name whitch is not part of the certificate.

Hi @kmc

you have to create one certificate with all required domain names.

So each time I wiil host a new mail domain on that server I will have to relauch the complete mails certbot command with all domains ?
There is no way to make it work with only the server’s FQDN and MTA just give that FQDN as imap and smtp mail server ?

May be, I don’t use Postfix/Dovecot. Check the documentation if it is possible to create such things like vHosts in mail servers with different certificates.

If this is possible, create one such vHost per domain name and one certificate with that domain name.

I finally added the to the mail server certificate using that command:

certbot --webroot -w /var/www/html certonly -d -d

Now the mail adresses on that domain pass the test and I can get mails with android MTA

Now, wanting to expand the certificate with a second domain that ways:

certbot --webroot -w /var/www/html certonly -d -d -d
certbot --webroot -w /var/www/html certonly -d  -w /var/www/html certonly -d -d

I get the error in both cases:

…Invalid response from

There is an answer with /fr/. I don’t think that will work.

This looks less like a LetsEncrypt issue and more like a Server Administration concern.

In the past, SMTP, IMAP/POP and Mail clients didn’t really care about matching valid certificates. I don’t think any have really bothered to check until about 3 years ago. It’s certainly a pain they are now starting to care - especially since they don’t necessarily have support for quickly switching certs. (Exim was extendable with scripting, not sure about Postfix)

IMHO, i think the easiest thing to do would be running all mail on a single server. e.g. every domain in your system lists as their MX record for SMTP/IMAP/POP. Then you just worry about having a single domain/certificate for mail services.

The caveat with this is that:

  • clients need to be updated to the single domain
  • the credentials would need to use the full email address if they don’t already (e.g. localpart@domain.tld )

It would be much easier to maintain in the long run though.

1 Like

I think you don’t really need to have the blabla.kimsufi name in your certificate, actually.

You need to check if dovecot/postfix can use multiple certificates (and in this case you can use one certificate for each name) or you need to use one certificate with all the names you need in them.

It looks like you can’t have one certificate per name in postfix: (you can have five certificates but the intended use is for different cert algorithms)

But you can have one certificate per name in Dovecot:

Do you mean I define as mx for all domains in my DNS server and then all domains should use that domain as mail server for imap, smtp and pop ?

I tried that. I get:

Cert Hostname DOES NOT VERIFY ( !=
So email is encrypted but the host is not verified

If the mx record points to “”, SMTP servers should not connect to

If the pop/imap clients are configured to use “”, no one should ever be using " “” or any of the other domains. everything should be going though the domain

I forgot to modify the CDN. Every thing OK now.

Thakns a lot everybody for your helps

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.