I have a small Ubuntu 16.04.3 email server and I choose the easiest way using IRedMail. Email and Roundcube now works for my primary domain, but I'm having problems adding a new domain. Let's say I have olddomain.com and newdomain.com.
I configured DNS at my DNS provider
I added newdomain.com in IRedMail Admin panel
I generated a key using:
amavisd-new genrsa newdomain.com.pem
and if I run "amavisd-new testkeys" I get:
TESTING#1 olddomain.com: dkim._domainkey.olddomain.com => pass
TESTING#2 newdomain.com: dkim._domainkey.newdomain.com => pass
- I think I did not touch the nginx configuration
- Restarted everything
Now if I browse to mail.newdomain.com to use Roundcube I get redirected to mail.olddomain.com. I'm not sure if this is the default behavior, but it's not what I would prefer. I would like email users of newdomain.com be able to use Roundcube on mail.newdomain.com. How can I set that up?
I think you need to create configuration files for the new domain.
Check this link
Actually, all you need to do is to create another virtual host in Apache or another server block in Nginx for the new mail domain. However, the Apache/Nginx directory structure is heavily modified by iRedmail, which makes the process a little complicated.
To see the exact steps for Nginx, check out my iRedMail tutorial: https://www.linuxbabe.com/mail-server/set-up-iredmail-multiple-domains-nginx