"Dallman Ross" <dman(_at_)nomotek(_dot_)com> writes:
Right now I have the middle part in as:
:0
* $ $=^0
* ^(Message-Id|In-Reply-To|References):\/.*[$!]
* -100^1 MATCH ?? [$!]
{ }
I'm not sure whether I've re-invented my original scoring problem by
doing it this way, though.
Yep. You'll need to extract each of those header fields and count the
number of $s and !s in them in separate recipes.
Thanks. Might the possibly work as a saving grace? In thinking about
this, either I've suddenly forgotten why we were using MATCH at all, or
else had an ephipheny that removing the MATCH restores scoring
functionality here for all three headers:
:0
* $ $=^0
* -100^1 ^(Message-Id|In-Reply-To|References):.*[$!]
{ }
That counts at most one $ or ! in at most one of those header fields.
Alternatively, or is it moreover, since we're using scoring,
we do have the option of ORing like this, don't we?
:0
* $ $=^0
* -100^1 ^Message-Id:.*[$!]
* -100^1 ^In-Reply-To:.*[$!]
* -100^1 ^References:.*[$!]
{ }
That'll count at most one $ or ! in each of those header fields.
Parenthetically, is there any reason to want to reverse the score
we've got so far and add, rather than subtract?
:0 # note the negative sign immediately below (is this kosher?)
* $ -$=^0
* 100^1 ^Message-ID:.*[$!]
. . .
That's kosher, but it doesn't affect the overall problem.
Finally, and furthermore, resuscitated from the earlier post is
again Stage 3:
# $= now contains the corrected score. If it's greater than
# zero still, then do whatever
:0
* $$=^0
{ whatever }
I'm now unclear on the concept of why we need a Stage 3. Why not
just put "whatever" in the braces up above and be done with it?
If you look back at my previous message you'll find that the inner
recipe read as follows:
:0
* $$=^0
* ^Message-Id:\/.*[$!]
* -100^1 MATCH ?? [$!]
{ }
If the message didn't have a Message-Id: header field than the action
won't take place at all. So moving your spam handling action into it's
braces will break it if a message gets through with no Message-Id:
header field. That may be unlikely for the Message-Id: header field,
but if you duplicate that inner recipe for the In-Reply-To: header field
or the References: header field than that becomes a serious problem.
Hmm, how about the following:
:0
* ! ^(Return-Path|Sender):.*list
* -175^0
* 100^1 [$!]
{
MATCH=
:0
* $$=^0
* -100^1 ^Message-Id:.*[$!]\/.*
* -100^1 MATCH ?? [$!]
{
MATCH=
:0
* $$=^0
* -100^0 ^In-Reply-To:.*[$!]\/.*
* -100^1 MATCH ?? [$!]
{
MATCH=
:0
* $$=^0
* -100^0 ^References:.*[$!]\/.*
* -100^1 MATCH ?? [$!]
{
whatever
}
}
}
}
That'll mishandle messages that have more than one Message-Id:,
In-Reply-To:, or References: header field, but I would consider them
malformed anyway, so... If you want to handle that situation correctly
than you'll need to follow David's suggestion of either using a formail
process to extract the headers or a recursive rcfile.
Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail