procmail
[Top] [All Lists]

Re: question about VT100 and procmail

1996-06-28 11:16:54
Philip Guenther suggested to gumbie(_at_)sunspot(_dot_)tiac(_dot_)net:

| One of the nice things about the above is that if you find escape
| sequences in the Subject: line especially annoying, then you can
| just tweak the recipe and say:
| 
| :0 HB:
| *  3^1 H ?? ^Subject:.*[
| *  1^1 [
| * -1^1 
| * -4^0
| vt100-folder

Comments: we need to escape those left brackets, don't we, or won't procmail
think we've opened a range without closing it?  Second, we need the `D' flag
for case sensitivity so that <esc>[d won't get the special exemption given to
<esc>[D.

| Each sequence in the Subject: like will now score 4 (3 from the first
| condition and 1 from the second) and thus be refiled.

Only if there are more than one, or if there is at least one more somewhere
else.  If one escape sequence is in the subject, none are anywhere else, and
the one in the subject is not <esc>[D, the recipe will score zero.

One fix: change weight of the last condition to -3.9.  Another: if you want
any occurrence of an escape sequence in the subject to divert the letter to
vt100-folder regardless of anything else,

:0 HB D:
*  2147483647^0 H ?? ^Subject:.*\[[^D]
*  1^1 \[
* -1^1 \[D
* -4^0
vt100-folder

... because a supremum score makes procmail skip all remaining weighted
conditions.  [An infemum score (-2147483647) is deemed a failure on the
whole recipe and makes procmail skip to the next recipe.]

If you don't want to memorize "2147483647", you can use any number larger
than that.  Stephen is personally fond of 9876543210.

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