2009/3/5 ghe <g...@slsware.com>:
> I need to change email sent by a user from one domain (a.com) so that
> clicking Reply will reply to him at b.com. (a.com isn't always reliable,
> and I admin b.com, among other reasons.)
>
> Google got me to postfix.org's documentation on generic maps. I'm
> running 2.5, so tried that, to rewrite the destination address on its
> way out, but couldn't get it to work:

This is a little unclear. I interpret that to mean mail sent from your
server, from u...@a.com, should appear to come from u...@b.com, so
that the return-path will be at b.com - is this correct? You then said
you want "to rewrite the destination address on its way out", but
that'd be inconsistent.

> main.cf:
> smtp_generic_maps = hash:/etc/postfix/generic
>
> /etc/postfix/generic:
> ghe2...@gmail.com               g...@slsware.com
> g...@qw.net                      ...@slsware.com

generic_maps are for rewriting local addresses on outgoing mail, as documented:
http://www.postfix.org/ADDRESS_REWRITING_README.html#generic

> I sent mail to myself at gmail, expecting it to come here

That sounds like you want to rewrite the recipient address, which is
non-local.I believe canonical_maps will do this for you, but I don't
know what the scope is (ie. I expect it to affect mail which isn't
local-to-local, but I honestly don't know). Someone else can shed more
light on this.

> So I tried to rewrite the sender address on its way in. The
> canonical-sender map worked when I telnet'ed and did SMTP by hand,
> without supplying a From: header. But when he sent me mail, the
> Return-Path header was rewritten but From: was not, so clicking Reply
> was sending to a.com.
>
> Is there a way to get postfix to change From: or to maybe copy
> Return-Path to a Reply-To?

The canonical and generic maps will affect the envelope address/es and
From/To headers, unless I'm mistaken. The documentation doesn't
suggest to me that it will parse and modify any other headers.

Reply via email to