procmail
[Top] [All Lists]

Re: auto-remove extra header?

1996-06-23 14:43:37
Timothy Luoma receives mail where a stray blank line breaks up the headers
and makes the headers that follow it look like part of the body.  So let's
set up a test for mail where the start of the body looks like a header,
 
  :0Bfw # brackets enclose caret, space tab
  * ^^[^        ]:
  | sed -e '/^$/,$!b' -e '/./,$!d'
 
You could even narrow it to the Novell problem by making the condition very
specific:
 
  :0Bfw # brackets enclose caret, space tab
  * ^^X-Nvlenv-01Date-Posted:
  | sed -e '/^$/,$!b' -e '/./,$!d'

The easily apparent way,

  :0Bfh
  * ^^X-Nvlenv-01Date-Posted:
  | formail -X ""

will work for Timothy's situation, but I don't recommend it for the general
case for this reason: if there are two or more blank lines between the first
set of headers and those that got separated from it, that will remove only
one.

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