procmail
[Top] [All Lists]

Re: Removing line-wrapped header

2004-09-08 17:35:14
Thanks for all your replies! 

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

Damn, I tried to make myself clear :(

The header name is known, and there will be multiple headers of that
name. I want to remove a particular instance of that header, the one
which has "somestring" in the value part.

formail -IHeadername: removes all the headers with that name, but I only
want to remove a single one. formail couldn't even remove the first or
last (only leave the first or last). That's requiring to know that it is
the Nth header I want to axe, which is a requirement I prefer to get
around if possible as I suspect it's unreliable in my case.

David's formail -c | grep -iv would work, but leaves the remaining
headers in a funny state.

Obviously procmail/formail can't easily deal with it. Perhaps some
external tool would be better. Reassembling the headers with gawk would
work but isn't so nice of course.

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"

Clever! But it's for a different problem :(

Thanks,

Volker

-- 
Volker Kuhlmann                 is possibly list0570 with the domain in header
http://volker.dnsalias.net/             Please do not CC list postings to me.

____________________________________________________________
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>