procmail
[Top] [All Lists]

help trimming received headers?

1997-11-04 14:39:39
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.

Seems like perl would be an easy way to do it if I were good at perl  :-)

Any perl wizard can handle this?  Or someone have a better idea?

If I had to write it in some other language, I would write basically

 rcvd filter
   Keep_Received = false

   for all lines in order
     if ( (egrep) "^Received: .*our-firewall-name.* ) then
        Keep_Received = true
     fi

     if ( (not (egrep) "^Received:.*) or Keep_Received ) then
        spit it out
     fi
     <else discard it>
  end rcvd filter

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