procmail
[Top] [All Lists]

Re: Removing line-wrapped header

2004-09-08 10:10:51
On Wed, Sep 08, 2004 at 11:07:01AM -0500, David W. Tamkin wrote:

Sean answered Volker, [who is trying to delete long headers
that he possibly can't predict the content of,]

Then there's the little matter that you're claiming you don't know
the header name -- so how is it that you can include the header
anchor above?

simply specify that to formail when you actually invoke it.

What Volker said was that the header name is not unique.  I can take
that one of two ways:

Every time this piece of crud shows up, the header it's in has a
different name.  For example,

Thisheader: lots of stuff and ihateyourgutsaNdwanttokillyou have a
nice day

but the next message with it is like this:

Thatheader: the sun is shining and ihateyourGutsandwanttokillyou see
you tomorrow

OR ...

It has the same name as a legitimate header line, and Volker wants to
take out only the bogus one but keep the legitimate one with the same
name. formail -I Headername: will remove both.

In either case, my only suggestion is this:

:0fwh
| formail -c | grep -vi 'offendingstring'


I wondered the same thing as to which Volker meant.  If he wants to
delete the first of any very long header other than a Received header
(assuming thereby that there is only one such in a message), here is a way:


SIXTYFOUR = "................................................................" 
NOT_RCVD  = 
"[^R]|R[^e]|Re[^c]|Rec[^e]|Rece[^i]|Recei[^v]|Receiv[^e]|Receive[^d]|Received[^:]"

:0 h fw
* $ ^\/($NOT_RCVD)[^$WS:]*:$SIXTYFOUR$SIXTYFOUR
*       MATCH  ??  ^^\/[^:]+:
| formail -I "$MATCH"


-- 
dman

____________________________________________________________
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

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