Re-check configuration fails after postfix is configured for more than one domain

SYSTEM INFORMATION
OS type and version CentOS 7
Virtualmin version 2.013

In my virtual server, the postfix server is configured for receiving not only e-mails from my “main” website (@domain1.com users), but also for another domain configured as sub-server (@domain2.com users).

The configuration for receiving mails from @domain2.com users (the domain configured as sub-server in Virtualmin) was achieved through defining the variable virtual_alias_domains = domain2.com within the configuration file /etc/postfix/main.cf, and then defining the accounts mapping inside /etc/postfix/virtual.

This configuration is working, i.e. I can receive e-mails for both domains without issue. But when I run the “Re-check configuration” script in Virtualmin > System Settings I get the following error message:

Your Postfix configuration has the virtual_alias_domains option set to domain2.com. This overrides the list of domains from the virtual_alias_maps option, and should be removed

If I remove the definition of virtual_alias_domains inside main.cf, the e-mails for domain2.com will not be received anymore. How should I then configure postfix to receive e-mails for my sub-server domain, so that I do not get any errors from “Re-check configuration” script?

You can define the virtual alias domains inside the virtual alias maps file :slight_smile:
On my server, that’s /etc/postfix/virtual

A domain line is:

dom.ain (comment)… I use “DOMAIN: domain name and info”

An alias line is
user@dom.ain alias@dom.ain1, alias@dom.ain2 etc

1 Like

I’ve added as the first line (on top of my virtual mappings within the file /etc/postfix/virtual) the virtual alias domain definition, just like your recommendation.

But as soon as I comment out the virtual_alias_domains definition within /etc/postfix/main.cf, my e-mails do not get delivered to the addresses defined by /etc/postfix/virtual. So it seems that my domain definition at the top of /etc/postfix/virtual isn’t being “recognized” by postfix.

I tried also to change this domain definition to the bottom of the file, but that didn’t work as well.

Maybe I’m forgetting something? Or what could I execute wrong while adding the domain definition? I just wrote a line like this:

mysubserverdomain.com my_comment

Where the domain name and the comment are separated by a tab.

You definitely should not use virtual_alias_domains.

I guess something is wrong with the virtual maps file. Did you run postmap on it, after editing it? (If you edit in Virtualmin, this is done automatically.)

1 Like

I really didn’t know about the postmap command I should run after editing /etc/postfix/virtual. That did the trick!

Thank you @Joe and @MrPete!

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