Multiple domains for imap and smtp?

Hi there,

Is there a way to have multiple domains for the box for imap and smtp? I know we can host as many domains as we want, if we set in the settings of the email client. Now I want to have mutliple domains here too. Is that possible?

So one has in the email settings and the other client users or so.


No, not really.

You can use a CNAME record to point >> or >> BUT this will not work in the sense that it will cause SSL certificate problems in the users email client, so for all intents and purposes, the design of MiaB precludes this.

Though, someone with good scripting skills, COULD do a unsupported modification.

Hi Martin,

It is possible but you have to change the config manually a little bit. Also you have to renew the Let’s encrypt certificate manually. If you’re interested please let me know so that I can post it here.


Yes, I’m very interested in this. Please tell me.


First you have to provision the LE certificate manually. You have to temporary stop Nginx for this.
sudo service nginx stop
sudo letsencrypt certonly --email your@email.address -d -d -d

Then start Nginx again
sudo service nginx start

Then we have to configure Dovecot to use the new certificate
sudo nano /etc/dovecot/conf.d/10-ssl.conf

Change the following lines to:
ssl_cert = </etc/letsencrypt/live/
ssl_key = </etc/letsencrypt/live/

Save the file and exit nano

Restart dovecot
sudo service dovecot restart

Then we have to configure postfix to use the certificate
sudo nano /etc/postfix/

smtpd_tls_cert_file = /etc/letsencrypt/live/
smtpd_tls_key_file = /etc/letsencrypt/live/

Save the file and exit nano

Restart postfix
sudo service postfix restart

You can use now, and without certificates warnings.

In order to refresh the certificate you have to stop nginx, run the letsencrypt command and start nginx again.

Two points … the certificate should ALSO have the hostname as one of the domains it covers … and expect this to be overwritten when the version of MiaB is upgraded.

@alento Thanks, will keep that in mind