I don't think this can be done using just Postfix alone.
Postfix can do canonical mapping of sender addresses, and of recipient addresses,
but not do one depending on the value of another.
--
Greg
s.fenster@gmail.com wrote:
> Hi. I want to know if there is a way to rewrite the sender address
> based on the recipient of the address.
>
> So for example, if the email is addressed to a@domain.com, re-write the
> from address to x@domain.com. Otherwise, keep the sender address as it
> is.
>
> I was looking at sender_canonical and regular expressions, but it looks
> like it applies the regular expression matching pattern to the sender
> address and rewrites the sender address. I want to apply the regular
> expression to the recipient but rewrite the sender address.
>
> I ultimately want to use the virtual table to redirect email for
> a@domain.com to some other email address, but instead of retaining the
> original sender address, I want to change the sender address.
>
> Any ideas on how to do this?
>
> Thanks,
> Seth
>