You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Mark Hedges <he...@scriptdolphin.org> on 2008/10/09 17:23:51 UTC

please help - cannot see rules in SA object

Please help - I don't know what to do about this.  Am I
missing something fundamental?  Can anyone offer some
insight?  Thank you.  --mark--

---------- Forwarded message ----------
Date: Fri, 3 Oct 2008 15:40:45 -0700 (PDT)
From: Mark Hedges <he...@scriptdolphin.org>
To: users@spamassassin.apache.org
Subject: cannot see most rules in SA object


Hi.  I'm writing a perl script that creates an SA object
(v3.2.4) using site_rules_filename =>
/etc/mail/spamassassin/domain_dir_name and rules_filename =>
/usr/share/spamassassin .

The script runs as an unprivileged user but I tried passing
user root and different combinations of 'allow_user_rules'
=> 1, 'config_tree_recurse' => 1, 'local_tests_only' => 0,
setting $ENV{HOME} and user_dir and home_dir_for_helpers to
some temp dir, etc.

But I still do not see all of the tests in $sa->{conf} that
should be there.

For example, there are no uri tests, but there are plenty of
uri tests in the config files.

Here's a specific example from the default rules:

/usr/share/spamassassin/50_scores.cf:score FU_UKGEOCITIES 3.299 3.296 3.299 3.296 # n=2
/usr/share/spamassassin/72_active.cf:##{ FU_UKGEOCITIES
/usr/share/spamassassin/72_active.cf:uri      FU_UKGEOCITIES		/\b[a-z]{2}\.geocities\.com/i
/usr/share/spamassassin/72_active.cf:describe FU_UKGEOCITIES		URL with [a-z]{2}.geocities.com
/usr/share/spamassassin/72_active.cf:##} FU_UKGEOCITIES

dbg => 'all' shows both these files being parsed.

While the score name FU_UKGEOCITIES does appear in the current scoreset
in the conf object, there is no corresponding rule when looking for it
in the results of $sa->{conf}->get_rule_keys($type) for all of the types
returned by $sa->{conf}->get_rule_types().

In fact there are no uri rules at all in that mapping:

body_evals: 161
body_tests: 0
full_evals: 6
full_tests: 0
head_evals: 87
head_tests: 0
meta_tests: 0
rawbody_evals: 7
rawbody_tests: 0
rbl_evals: 76
uri_evals: 0
uri_tests: 0

What's going on?  How do I get at these rules and the others that
should be there but do not appear?

Thanks for your help.

Mark