procmail
[Top] [All Lists]

Re: strlen() in procmail

2003-01-14 23:17:14
On Tue, 14 Jan 2003, David W. Tamkin wrote:

Bart asked,

| :0c:
| * ^Subject:\<+Re:
| * 1^0
| * 1^0 ^In-Reply-To:[^<]+<\/[^>]+
| any_old_mailbox_will_do
|
| However, that changes $=, which is in a sense also changing the outcome.

Every attempted recipe changes $= as soon as procmail either starts the
action or abandons the recipe as a mismatch.  (If the recipe has no
weighted conditions, $= is reset to 0.)  If your criteria include
preserving $= without saving it in an ordinary variable, your quest is
hopeless.

I don't want to preserve $=, I just don't want to change it in any way
that the existing recipe didn't already, if that makes sense.

E.g. suppose the original recipe was

:0c:
* 1^1 ^Received:.*\<from\>.*\<for\>
any_old_mailbox_will_do

At the end, $= is the number of Recieved: fields that mention both "from"
and "for".  Now I want to add something that will extract a $MATCH without
changing $= any further.

I can't add

* -1^0
*  1^0 ^In-Reply-To:[^<]+<\/[^>]+

because that decreases $= when there is no In-Reply-To.  I tried

* 0^0 ^In-Reply-To:[^<]+<\/[^>]+

but procmail is too clever and ignores the entire condition because it
detects that it can't possibly change the score.

Perhaps something along the lines of

* (|^In-Reply-To:[^<]+<\/[^>]+)

which appears to work, but I'm concerned that there's some oddity of which
I'm unaware with using \/ inside parens like that.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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