procmail
[Top] [All Lists]

Re: spotting empty continuation lines

2000-02-25 12:56:18
David W. Tamkin wrote:
Sometimes I'll receive a message with a header field where a continuation
line is empty except for the indenting whitespace.  I'd like to catch those
in a recipe.

The problem is that the newline before a properly indented continuation line
in a header won't match procmail's $ or ^ (usually that's a good thing).

  * H ?? ? egrep '^[  ]+$' # egrep -x '[      ]+' if it groks -x

will do it, but is there a way within procmail without the external program?

Maybe I'm confused, but it seems to me that the header lines are
concatenated for "H ?? ..." which means that the latter version
won't do it either.

Direct these 5 lines:
From me(_at_)some(_dot_)domain Fri Feb 25 00:00:00 2000
Received: just to illustrate
        that the header lines will be concatenated

This is the one-line body

into stdin for "procmail -m junk.rc", where junk.rc contains
among other things:
#---start junk.rc excerpt
NL="
"

:0
* H ?? illus.*head
{
    LOG="Multiple original lines were concatenated$NL"
}

:0
* H ?? ? egrep 'illus.*head'
{
    LOG="Multiple original lines were concatenated for egrep too$NL"
}
#---end junk.rc excerpt


For me, both LOG= are performed.

Cheers,
Stan

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