On Mon, Jul 13, 2009 at 10:34:00AM -0400, Daniel L'Hommedieu wrote:
>> main.cf:
>> # Pick one:
>> #canonical_maps = hash:/etc/postfix/canonical
>> #virtual_alias_maps = hash:/etc/postfix/valias
>> #virtual_alias_domains = ... set me explicitly ...
>> #
>> #canonical_maps = cdb:/etc/postfix/canonical
>> #virtual_alias_maps = cdb:/etc/postfix/valias
>> #virtual_alias_domains = ... set me explicitly ...
>> #
>> #canonical_maps = ldap:/etc/postfix/canonical.cf
>> #virtual_alias_maps = ldap:/etc/postfix/valias.cf
>> #virtual_alias_domains = ... set me explicitly ...
>>
>> canonical:
>> [email protected] [email protected]
>>
>> valias:
>> [email protected] [email protected]
>>
>> The headers will read "[email protected]", but the envelope recipient
>> for delivery (virtual(5) happens after canonical(5)) will still be
>> [email protected]. There are other ways of doing this, but this one is
>> perhaps the most natural.
>
> Thanks Victor.
>
> I ended up using a simple recipe in procmail, which is really probably the
> better way to do what I wanted anyway. Here's the recipe:
>
> :0 fhw
> * ^Received:.*bar.edu.*
> | sed -e 's/[email protected]/[email protected]/'
>
> Sure, all of the headers get changed, but I don't really care about that -
> all I really care about is having the original email address in the
> headers, so it is of no consequence to me that the "Received" headers show
> that email was received for the [email protected] address and not the [email protected]
> address.
>
> FWIW I had tried the canonical map as you suggest (I thought I had
> mentioned that), but all that seemed to do was forward the mail back to the
> .edu address, which put the mail into a loop until I removed the map.
Which is *exactly* why I add the virtual(5) reverse mapping, so that
the envelope recipient is "de-canonicalized". The procmail regexp recipe
is fragile. Do as you see fit, but I recommend the canonical+virtual
approach.
--
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:[email protected]?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.