1

I have built a Spam filter based on this RECIPE

Since then my requirements have changed and would like to know how to route mail in Postfix based on the recipient email address. Some users now belong to a new domain and are hosted on another mail server but I do not want to lose mail that is sent to their old address.

So if I receive:

When I tried to simply add the following to /etc/postfix/virtual the test message seemed to just get lost somewhere. I have no clue where it went or how to check where it went...

[email protected] [email protected]

Many thanks for any pointers.

2
  • the newdomain.com is hosted on the same server?
    – ALex_hha
    Sep 3, 2013 at 19:21
  • no... the postfix server above is the gateway to the local Exchange server for the old domain. The new domain is another mail server hosted by HQ in another city.
    – cwheeler33
    Sep 4, 2013 at 13:06

1 Answer 1

2

You can use transport_maps

relay_domains = olddomain.com, newdomain.com
transport_maps = /etc/postfix/relay_maps
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical

/etc/postfix/relay_maps

[email protected] smtp:[ip.of.local.exchange]
[email protected] smtp:mx.newdomain.com
[email protected] no-reply

/etc/aliases

no-reply: /dev/null

/etc/postfix/recipient_canonical

[email protected] [email protected]

Note: you must create local user no-reply

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .