I have a server with two domains. I get the warning as mentioned in the title:
do not list domain example.com in BOTH mydestination and virtual_alias
Although I receive the above warning, it works just fine without problems. But I want to know how to fix it.
The reason for having the domain in both places is because I want to implement catchall - all email sent to @domain.tld should go to the mail account of that domain.
Now, if I don't put the domain in mydestination, the server refuses to accept email for that domain because it does not want to be an open relay. If I don't put the catchall alias into the virtual alias table, the catchall doesn't work (obviously).
So what is the correct solution? I have tried to read the stuff on http://www.postfix.org/VIRTUAL_README.html#virtual_alias, but I just can't seem to make my setup work any other way.
(PS: I am using webmin/virtualmin to manage my website, and when I try to configure it with the built-in configuration tools it comes up with the same solution I have manually. So it seems even webmin doesn't know a better way to do this...)