--- In postfix-us...@yahoogroups.com, Victor Duchovni
<victor.ducho...@...> wrote:
>
> On Sun, Feb 08, 2009 at 09:50:16PM -0800, Jeff Weinberger wrote:
>
> >
> > I am trying to figure out the best way to map one domain to
another with
> > the same users...precisely the behavior I am trying to achieve is:
when
> > mail is sent (from outside, or from another user within my postfix
> > installation) to u...@... I want it redirected to u...@...
> > - in otherwords, the user is preserved, but the domain is
> > translated/rewritten. To be more specific:
> >
> > us...@... gets re-routed to us...@...
> > us...@... gets re-routed to us...@...
>
> - Are you looking to rewrite just the envelope recipient, or also
message
>   From/To/Cc headers?

It's only important to rewrite the envelope sender. The result I want
is that the message is delivered to *...@domain2.tld - if it has the
original To/Cc header that's fine, and probably desireable.

>
> - Is all mail first passed through an SMTP content_filter?

Yes. All mail coming from outside my server is passed through
amavisd-new for spam/virus checking. Mail originating from my server
is passed through a specialized content filter. (via the submission
service)

It is important that this rewrite apply to messages coming from
outside as well as those originating on my server.

>
> - Are all the original and rewritten recipients delivered to another
host
>   via SMTP, or is some of the mail delivered locally (local,
virtual, ...)?

I'm not completely sure this answers your question, but the message
may be only to u...@domain1.tld or to a number of addresses including
u...@domain1.tld. Only the "copy" of the message to u...@domain1.tld
should get rerouted to u...@domain2.tld.

both domain1.tld and domain2.tld are mine and my postfix instance is
the MX for them. domain1.tld is an alias domain and domain2.tld is a
virtual domain.

>
>
> >
> > My initial guess is to use recipient_canonical_maps and use a pcre
map:
> >
> > /^(.*)@domain1.tld/   {$1)@domain2.tld
>
> This guess is wrong for many reasons, but I think it best to first
> understand what problem you are really trying to solve, before we
> tear apart the wrong answer to potentially the wrong question.

Thank you...but I would also like to know if I can impose on your
time, what is wrong with this - it will help me better solve this and
future problems.

>
> > I don't see a way to achieve this with alias_maps and
header_checks (with
> > action REDIRECT) would miss messages sent to u...@... where that is
> > not the To: or Cc: address (such as list mail).
>
> This is worse.

That I understood. Thanks.

>
> > Really, I am just checking with experts more knowledgeable than I
whether I
> > have chosen a good (or the best) way to achieve this, or if there
is a
> > better way.
>
> Yes, there is a correct way of solving your problem, but first describe
> your problem in more detail.

Does that help? Please let me know if there is any more detail I can
provide.

Thank you for your help!



>
> --
>       Viktor.
>
> Disclaimer: off-list followups get on-list replies or get ignored.
> Please do not ignore the "Reply-To" header.
>
> To unsubscribe from the postfix-users list, visit
> http://www.postfix.org/lists.html or click the link below:
> <mailto:majord...@...?body=unsubscribe%20postfix-users>
>
> If my response solves your problem, the best way to thank me is to not
> send an "it worked, thanks" follow-up. If you must respond, please put
> "It worked, thanks" in the "Subject" so I can delete these quickly.
>


Reply via email to