procmail
[Top] [All Lists]

Re: Question about Scoring and Server Load

2003-07-15 12:01:16
On Tue, Jul 15, 2003 at 01:59:49AM -0700, Virtual University wrote:

Is there a FAQ somewhere, or does anyone know, which is more efficient 
insofar as reducing server load when filtering spam -- having a set of 
recipes with multiple match checks (aaa|bbb|ccc|ddd) or using scoring?

I haven't seen anything like that in a FAQ, but I would think that
matching as much as possible in a single regexp would take less CPU than
processing multiple regexps and calculating a score for each of them.
So I would prefer to use:

  :0
  * (aaa|bbb|ccc)
  { do something }

than:

  :0
  * 1^0 aaa
  * 1^0 bbb
  * 1^0 ccc
  { do something }

Also, can a procmail score be assigned to a variable such as $SCORE so 
the result can be reported in a mail header?

The procmailsc man page's MISCELLANEOUS section mentions $= which you
can insert into a header using formail, or use elsewhere, thus:

  :0
  * 1^1 aaa
  * 3^1 bbb
  * 2^1 ccc
  | formail -A"X-letter-factor: $="

should work, or you can use a previous score in later recipes:

  :0
  * 1^1 aaa
  * 3^1 bbb
  * 2^1 ccc
  { LETTERFACTOR=$= }

  ...

  :0
  * $ -${LETTERFACTOR}^0
  * 5^1 ddd
  * 1^1 eee
  { do something }


-- 
  Paul Chvostek                                             
<paul(_at_)it(_dot_)ca>
  Operations / Abuse / Whatever
  it.canada, hosting and development                   http://www.it.ca/


_______________________________________________
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>