1

I have two domains in the mydestination parameter of Postfix:

mydestination = foo.com, bar.net

The MX-Records for foo.com and bar.net are set to mail.foo.com. In my /etc/aliases I map admin to the user john

admin: john

When I send mails to admin@foo.com the mails are accepted and delivered to /home/john/Maildir/.
When I send mails to admin@bar.net the mails are accepted with relay=mail.foo.com but they don't arrive in John's inbox.

  1. Why?
  2. Where the heck are the mails for admin@bar.net?
horen
  • 411
  • 2
  • 7
  • 22

1 Answers1

1

Use virtual_alias_maps for this case, e.g in main.cf:

virtual_alias_maps = hash:/etc/postfix/virtual

And in /etc/postfix/virtual put the following:

admin@foo.com    john
admin@bar.com    john

You can there use full emailadresses, not only usernames. Without a domain, the hostname/mailname of your system/postfix will be used. This is an important feature when dealing with multiple domains.

/etc/alias is for local aliases only.

Don't forget to run postmap and newaliases respectively.

sebix
  • 4,313
  • 2
  • 29
  • 47