ug(_at_)unixgeek(_dot_)com wrote,
| My first reaction is to try something like:
|
| :0
| * ^(to|cc): .*\/(quotes-plus(_at_)onelist(_dot_)com|(.*metastock|
*anncora(_at_)mindspring(_dot_)com)|.*realtrader|fasttrack(_at_)(_dot_)*)
| {
| :0
| * pct ?? XXXXXXX
| /dev/null
|
| :0
| |formail -i "X-MailingList: invest" -i "Reply-To: $MATCH,$FROM" -ds
invest.spool
| }
| But none of the examples show additional rules in the nested pieces. Is
| this allowed? Is there a better way?
Yes, it's allowed, and it is syntactically correct. My only questions would
be whether you might be better off with ^TO or ^TO_ instead of ^(to|cc): .*,
and whether the test on $pct should be done by scoring rather than by string
comparison.
For example, to trash anything where pct exceeds 85,
:0 # -84.99999 to trash at or over 85
* $$pct^0
* -85^0
/dev/null
rather than
:0 # ^^(9[0-9]|8[5-9]) to trash at or over 85
* pct ?? ^^(9[0-9]|8[6-9]|85\.[0-9]*[1-9])
/dev/null
If you change your mind about the threshold, it's much easier to edit the
former recipe than the latter.