Viktor,

I change my email to plain text format and send you again.

Thanks,

Carl

From: Xie, Wei 
Sent: Tuesday, August 05, 2014 12:57 PM
To: [email protected]
Cc: Xie, Wei
Subject: RE: How to fetch From address from header via Postfix head_check?

Viktor,

Sorry to reply to you lately due to some reasons.

>>Actually you would not like to this.  Because setting "Resent-From:"
>>to duplicate the "From:" address is silly.

I just wanted to do a technical test to see how to fetch From address from 
header  , not really to do setting "Resent-From:" to duplicate the "From:" 
address. 

>> I thought you wanted "Resent-From:" to record the receiving address whose 
>> mail forwarded, not the message author.  The envelope recipient often does 
>> >> not appear in message headers at all. You're barking up the wrong tree 
>> I'm afraid.

Maybe I do not speak our requirement. Giving an example.

From: [email protected]
To: [email protected]  (is forwarded to [email protected])

The email is sent from [email protected] to [email protected], entering osu email 
system. OSU email system checks the account [email protected] is a forwarding 
account to [email protected] and gets forwarding address [email protected]. It 
hands over the message to outbound Postfix server. From postfix email log, we 
can see the "from address" is [email protected], "to address" is  
[email protected], but do not see the original receiving address 
[email protected].  The Postfix is only responsible for outbound email delivery 
to next hop for [email protected], it is not responsible for the translation 
from "original to address" [email protected] to "forwarding address" 
[email protected].  When the message is finally delivered to [email protected], 
we can see the following key information in the header.

***********************************
<snip>

Received: from OSU Email server
                by OSU outbound server (Postfix) with ESMTPS id xxxxxxxxxxx
                for <[email protected]>; Thu, 24 Jul 2014 09:56:29 -0400 (EDT)

<snip>

From: <[email protected]>
To: <[email protected]>
Subject: TEST

**********************************

The logic of our requirement or idea is described as the following syntax in 
terms of header_check in Postfix: To any forwarding emails from non-osu.edu and 
non-ohio-state.edu sender addresses, we need fetch "original to address" and 
add one line "Resent-From: <original to address>" via Postfix. 

If !/^From: (.*)@osu.edu & ^From: (.*)@(.*).ohio-state.edu/i
   If /^To: (.*)/ PREPEND Resent-From: $1
   endif
endif

If the above idea is not appropriate for simple forwarding to a recipient's 
mailbox, but technically is it feasible? We just think this idea is wrong 
option. Mainly we want to use this inappropriate way to bypass the problem on 
next HOP - one windows new antispam system before they fix the problem.

>>What you want is best done in a delivery agent with:
>>
>>    <transport>_destination_recipient_limit = 1
>>
>>to ensure that the message being modified is routed to exactly one recipient. 
>> At that point you can inject various headers that record the recipient 
>>address >>prior to forwarding.  Avoiding "Resent-From"
>>if you're paying attention

If we choose the above method to avoiding "Resent-From", can you explain more 
detail, especially how to create transport map file to identify  the message 
being modified?  How to identify any forwarding emails from non-osu.edu and 
non-ohio-state.edu sender addresses?

Thanks,

Carl

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
On Behalf Of Viktor Dukhovni
Sent: Thursday, July 31, 2014 7:17 PM
To: [email protected]
Subject: Re: How to fetch From address from header via Postfix head_check?

On Thu, Jul 31, 2014 at 07:15:03PM +0000, Xie, Wei wrote:

> In Postfix header_check,  I would like to know how to fetch "From 
> address" from header via Postfix head_check.  The rule "/^From:
> (.*) / PREPEND Resent-From: [email protected] " seems not working.

Actually you would not like to this.  Because setting "Resent-From:"
to duplicate the "From:" address is silly.  I thought you wanted "Resent-From:" 
to record the receiving address whose mail forwarded, not the message author.  
The envelope recipient often does not appear in message headers at all.

You're barking up the wrong tree I'm afraid. 


What you want is best done in a delivery agent with:

    <transport>_destination_recipient_limit = 1

to ensure that the message being modified is routed to exactly one recipient.  
At that point you can inject various headers that record the recipient address 
prior to forwarding.  Avoiding "Resent-From"
if you're paying attention.

-- 
                Viktor.

Reply via email to