procmail
[Top] [All Lists]

Re: help trimming received headers?

1997-11-04 15:27:51
W. Wesley Groleau asked,

| One of my wishes (as opposed to necessities) is to automatically get rid
| of a lot of received headers that are really just clutter.  Every piece of
| mail I get has a minimum of five of these headers AFTER it gets past our
| firewall.

 :0hfw
 | formail -c | egrep -v '^Received:.* from (pattern for your firewall)'

The downside ... which may not necessarily bother you ... is that all
continuation lines in the head will be unwrapped.

It could be done in sed as well in a way to preserve continuation breaks, but
I'm just not up to writing the kind of sed code that looks for multi-line
patterns right now, though I used to do such things a lot.  And yes, perl
could handle it very well, no doubt.

Of course, if you're willing to give up all Received: headers,

 :0fhw
 | formail -I Received:

is all you need.

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