procmail
[Top] [All Lists]

Re: Re-write outbound Received: mail headers

2005-11-29 04:39:11
Dallman Ross:
J Moore:

I understand that re-writing Received: headers is a somewhat
controversial subject, and can lead to all sorts of problems if
it's not done correctly. I need a solution that's maintainable -
I think procmail can do this based on Weldon Whipple's "How-To"
document at: http://www.technoids.org/procmailfilter.html, and a
"recipe" in the sendmail Cookbook. Both, however, seemed to stop
short of where I need to go.

Q: Can procmail do this?

If you just want to delete the offending (to your system policy)
Received header, I can think of a decent way.  But I need to
know if this header is always the bottom one, or if it's in the
middle somewhere (more work).


As described, he wants to *change* an old Received header.

If all that has to be changed in the message, is that particular
Received header field, I would choose sed, even without procmail.


Do you need to pickup the domain and [A.B.C.D] from the one-newer
Received-header, or is that static information?


/^Received: from \[192\.168\.1\.75\]/, / {
# unfold
# change
# refold
}

The unfolding and refolding are not necessary when what has to be
changed is always on a single line, but better be safe than sorry.
Please contact http://groups.yahoo.com/group/sed-users/ for help on
sed-issues.

With procmail, you could use my snr-code, see
http://www.xs4all.nl/~rvtol/procmail/

-- 
Grtz, Ruud


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail