procmail
[Top] [All Lists]

Re: Removing line-wrapped header

2004-09-08 05:17:23
At 22:53 2004-09-08 +1200, Volker Kuhlmann did say:
How can I remove a certain long line-wrapped header?
The header name is not unique, but its value is.

:0 fhw
* ^Header:.*somestring
| grep -vi '^Header:.*somestring'

would be perfect but doesn't work with wrapped headers. Unfortunately
formail doesn't have a full header remove option:

:0
* ^\/Header:.*somestring
| formail -I"$MATCH"

MATCH will be set to the Header, intermediate text, and somestring, and formail won't see that match string as a header only (with null value, which would cause it to delete). Your syntax is also lacking the 'f' flag for filtering.

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? If you KNOW the header is "Header:", then you could simply specify that to formail when you actually invoke it.


# will operate on HEADERS by default
:0f
* ^\/.* somestring
* MATCH ?? ^\/[^:]*:
| formail -I "${MATCH}"

I performed a quick test, and this performs fine, at least according to what I _think_ you're trying to ask for.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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