First I must say that this is my first time setting up postfix so there might be something I've missed.
Anyway, I have 2 domains set up on postfix with virtual table. The problem is that when I send mail to user@domain2.com it goes to user@domain1.com as seen in the logs below:
Dec 15 22:57:34 debian postfix/local[30311]: 8474E4294E: to=<user@domain1.com>, orig_to=<user@domain2.com>, relay=local, delay=0.03, delays=0.02/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
So the orig_to parameter is the one I'm trying to send mail to but for some reason postfix changes it to domain1.com. In fact anything I send to domain2 goes to domain1. Here's my main.cf:
myhostname = domain1.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost, localhost.localdomain, localhost, domain1.com
relayhost = example.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = $smtp_sasl_security_options
smtp_use_tls = yes
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_domains = domain2.com
virtual_alias_maps = hash:/etc/postfix/virtual
And here's virtual table:
domain1.com DOMAIN
user@domain1.com user
@domain1.com user
root@domain1.com root
domain2.com DOMAIN
@domain2.com user2
user@domain2.com user2