procmail
[Top] [All Lists]

Re: Matching all but one header (was: Re: Headers)

1997-08-02 18:14:00
Antti-Juhani Kaijanaho wrote,

| How would this sound:
| * ^([^S][^u][^b][^j][^e][^c][^t]|[^:]?[^:]?[^:]?[^:]?[^:]?[^:]?\
| |[^:][^:][^:][^:][^:][^:][^:][^:]*):.*\<phrase(\>|$)

| In the second alternative, there must be exactly one "[^:]?" less than
| there are letters in "Subject", and the third alternative must have
| exactly one [^:] more than there are letters in "Subject".  If one can
| live with sloppy matching, one can replace every [^:] in the recipe
| with a period.  This would make the recipe more readable.
| 
| This is ugly, yes, but it should work.  The idea is that any header
| with a name shorter or longer than "Subject" is checked.  Any header
| except Subject: whose name is as long as "Subject" is checked too.

Scoring is much simpler, such as the example I posted Saturday afternoon.

For one thing, not only is this example hard to proofread and edit, but it
would fail to catch any header with a seven-character name in which even
one letter matched the corresponding position in "Subject".  If someone is
forwarding a netnews article to you, it's likely to have a Summary: line,
which will not match any of those alternatives.  Also, an X- header could
be of one of these forms:

X-B....:
X-.j...:
X-..e..:
X-...c.:
X-....t:

and its contents would also be overlooked by that condition.

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