Is there some way to find the culprit rule ?
other that removing all rules and adding them one at the time.

Perhaps the best timing tool for rules is the HitFreqsRuleTiming
plugin, which can be found in masses/plugins/HitFreqsRuleTiming.pm
in the distribution. Should work with 3.2.5 and with 3.3.0.
It is quite primitive in that it does not have any configurables,
but just dumps its results to a file 'timing.log' in the current
working directory (make sure it is writable for the UID under
which SA is running, no error is issued if it can not write there).

To activate it, copy it to some place, then add a loadplugin
command to one of your .pre files, such as a local.pre, providing
the path to the .pm file, e.g.:

loadplugin HitFreqsRuleTiming /etc/mail/spamassassin/HitFreqsRuleTiming.pm

Then run a command line spamassassin giving it a sample message, e.g.:

$ spamassassin -t <test.msg

and after it finishes, you should have a sorted timing report
in file 'timing.log' for all the rules, e.g.:

T                DCC_REPUT_13_19    1.724    1.724    1
T      RAZOR2_CF_RANGE_E8_51_100    0.525    0.525    1
Hi! Mark,

Many thanks for your reply.

I'm using SpamAssassin version 3.2.5 running on Perl version 5.8.5

I did extract HitFreqsRuleTiming.pm from spamassassin_20090708151200.tar.gz,
move it to /etc/mail/spamassassin
then create the /etc/mail/spamassassin/local.pre file with the following line
loadplugin HitFreqsRuleTiming /etc/mail/spamassassin/HitFreqsRuleTiming.pm

Now, on /tmp directory, I execute "spamassassin --lint -t -D" which correctly said:
...cut...
[24936] dbg: plugin: loading HitFreqsRuleTiming from /etc/mail/spamassassin/HitFreqsRuleTiming.pm
...cut...
[27955] dbg: plugin: HitFreqsRuleTiming=HASH(0x114a8588) implements 'start_rules', priority 0
[27955] dbg: rules: compiled one_line_body tests
[27955] dbg: plugin: Mail::SpamAssassin::Plugin::Rule2XSBody=HASH(0x1197b19c) implements 'run_body_fast_scan', priority 0
[27955] dbg: rules: running head tests; score so far=0
[27955] dbg: rules: compiled head tests
[27955] dbg: plugin: HitFreqsRuleTiming=HASH(0x114a8588) implements 'ran_rule', priority 0
...cut...
[27955] dbg: check: is spam? score=4.205 required=5
[27955] dbg: check: tests=MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS [27955] dbg: check: subtests=__BOTNET_NOTRUST,__HAS_MSGID,__HAVE_BOUNCE_RELAYS,__MISSING_REF,__MSGID_OK_DIGITS,__MSGID_OK_HOST,__MSOE_MID_WRONG_CASE,__NONEMPTY_BODY,__SANE_MSGID,__SARE_WHITELIST_FLAG,__TVD_BODY,__UNUSABLE_MSGID

but Ido not find any timing.log file on my current directory or anywhere on my system!!

Did I missed something ?

Thanks,
Eddy




Reply via email to