Alias of virtual server, with own email - situation

Hi,
I have multilanguage website with multiple domains. Each language has its own domain and point to the same public_html (it is what domain aliases do).

Primary virtual server/domain has emails hosted elsewhere (not on this server) but aliases have emails here.

This is the reason why users get errors sending from any alias domain to primary domain.
“User unknown in virtual alias table” - postfix tries to delivery email locally but in this case it should not.

I am unable to uncheck “Mail for domain enabled” for primary virtual server:
“Failed to modify server : A target server must have email enabled if any aliases do”

What would be the right way to fix this?

  • create sub-servers(not aliases) and symlink them to the same public_html as primary virutal server? I am not sure what would happen with file permissions and owners.
  • Is there a way to configure postfix not to deliver localy for this domain? - that would be the best way in my opinion but i do not know how to do it
  • … ?

Thank you for reading this post and helping me :slight_smile:

If I have understood your problem statement correctly, the simplest solution would be to set the MX record of the virtual server in Virtualmin’s DNS records to reflect the MX record of the domain since your emails are hosted elsewhere (not on this server).

Hello,
thank you for reply. I already tried that and it didnt work. I changed MX record of the primary virtual server to the correct address (before it was mail.primary-domain.com and I changed it to correct domain)

dig MX primary-domain.com @localhost

Dig is returning correct value for the MX record but emails are still delivered locally.

I am not sure what exactly checkbox "Mail for domain enabled” does but I am unable to uncheck it because there are existing aliases of virtual server, with own email.

I think that problem is in /etc/postfix/virtual because postfix first looks here before dns lookup.
And problematic domain is listed here but is somehow linked with domain aliases. I will need to look into documentation to understand how it works and how to fix this without breaking anything else.

My conclusion is that this is limitation of virtualmin control panel. If primary virtual server doesn’t have emails enabled then alias server cannot have emails enabled.

At the end I fixed my problem with converting alias servers into subservers with emails enabled and disabling email for primary server.

I then symlinked public_html from subserver => primary server

1 Like

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