-1

We run multiple brands on multiple servers, and what we basically want is for Postfix (which I have set up and forwarding successfully) to forward on <username>@brand2.com to <username>@brand1.com.

All it needs to do is receive mail for any username at brand 2 and forward it to the same username but at brand 1.

So for example if I emailed dave@brand2.com it would forward it to dave@brand1.com .

Is this possible, if so could anyone advise how I would go about this?

Flimzy
  • 2,454
  • 18
  • 26

1 Answers1

2

It is a trivial thing. Postfix has two mechanisms similar to forwarding: first, the "orderly" /etc/aliases, and the second is the virtual aliasing. Its configuration file is in most cases in /etc/postfix/virtual. This second is capable to the so-named "domain forwarding", by the most trivial syntax:

@brand1.com: @brand2.com

Don't forget to run a postmap virtual after changing this file.

peterh
  • 4,953
  • 13
  • 30
  • 44
  • Thanks, that's perfect. Would I be correct in assuming then that this would work for all users automatically? As in I wouldn't need to add a line for each user. – David Thompson Oct 14 '14 at 08:52
  • @DavidThompson Yes, it forwarded every user automatically. You can even combine this with non-domain aliases (for example, forward every mail from brand1.com to bigbrother_at_brand3.com AND brand2.com). If you are satisfied with an answer, don't forget to accept it (by clicking the pipe on the left side). It is a big reward to the answering person. – peterh Oct 14 '14 at 09:04