All emails sent to my email server arrive in the inbox of root, regardless of the user specified in user@domain.com.
My virtual file in /etc/postfix/virtual is:
query1@domain1.com username1
query1@domain2.com root
and my postfix main.cf file contains
myhostname = domain1.com
mydestination = domain1.com, domain2.com
home_mailbox = Maildir/
virtual_alias_domains = domain1.com domain2.com
virtual_alias_maps = hash:/etc/postfix/virtual
With my current understanding, incoming mail to query1@domain1.com will be checked against virtual_alias_domains. As domain1.com is listed, the virtual file will be checked. Here, the entire address query1@domain1.com is mapped to the account username1, and mail is placed in the Maildir of the UNIX account with name username1.
I'm thinking I might have misunderstood how virtual_domains work in this context - if so, could someone please explain what I have misunderstood ?
Otherwise, if my understanding is correct, why would mail not be reaching the intended user, and being delivered to the root user instead ?
Environment Specs
I am running Ubuntu with Postfix.