procmail
[Top] [All Lists]

Re: error question, brain-picking questions

1997-06-30 10:09:00
Dallman Ross <rossd(_at_)heidelberg-emh11(_dot_)army(_dot_)mil> writes:
On Friday, June 27, 1997 3:50 PM, era eriksson [SMTP:era(_at_)iki(_dot_)fi] 
wrote:
...
 > fine), I want to answer the person, "thank you for
 > writing to dman(_at_)netcom(_dot_)com"; but if it is the 
ix.urz.uni-heidelberg.de
 > server that forwarded, then it should be "thank you for
 > writing to o30(_at_)ix(_dot_)urz(_dot_)uni-heidelberg(_dot_)de"; etc., 
etc.

You can usually grep this out of the very first Received: lines. This
depends to some extent of the MTAs of the forwarding sites but you can
at least expect to see something like "Received: from xyz.netcom.com"
near the beginning of the headers, and extrapolate from that. 

I am interested in developing a highly efficient and elegant way
to do this.  I find typical kludges to be easy but ugly, while
well-thought-through, elegant solutions are so much more beautiful.  :-)

In order to detect that the message was sent to such-and-such an address
and forwarded from there to your 'real' address, the message will have
to be modified in some way.  While the Received: headers do count as
such a modification, you cannot in general determine just from them
whether or not the message was forwarded via the such-and-such address
(someone else with a mailbox on that same machine may have forwarded the
message to you, and you cannot depend on the "for <address>" clause).
The only guaranteed solution is to modify the message yourself in some way
in the forwarding process, the prefered method being to add a header like:

        X-Forwarded-Via: o30(_at_)ix(_dot_)urz(_dot_)uni-heidelberg(_dot_)de

and then you can grep for that later.  Depending on whether the forwarding
sendmail is using smrsh, you may be able to get away with a .forward of:

        "|formail -A'X-Forwarded-Via: 
o30(_at_)ix(_dot_)urz(_dot_)uni-heidelberg(_dot_)de' |
                /usr/lib/sendmail -oi 
rossd(_at_)heidelberg-emh11(_dot_)army(_dot_)mil"

That should be one line.


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>