[Mimedefang] $hits always 0 after spam_assassin_check

Paul Heinlein heinlein at cse.ogi.edu
Fri Dec 6 12:54:00 EST 2002


On Thu, 5 Dec 2002, David F. Skoll wrote:

> On Wed, 4 Dec 2002, Paul Heinlein wrote:
> 
> > The call to spam_assassin_check() in filter_end() always reports that
> > $hits are 0. I've sent my test account some pretty egregious spam, too
> > :-)
> 
> Does spamassassin work for the "defang" user?  This kind of thing is
> usually a permissions problem.  Is
> /etc/mail/spamassassin/sa-mimedefang.cf world-readable?

In the grand mailing list tradition of answering one's own question...

The problem was that the Mail::SpamAssassin object's rules path wasn't
getting set correctly -- at least in Mail/SpamAssassin.pm. The
spamassassin standalone script was correctly patched at during the
configure/make process, but the module itself contains only the
default path set.

I ended up creating my own object, passing a directory ($rules) to the 
constructor:

  $tester = Mail::SpamAssassin->new({
    local_tests_only   => 1,
    dont_copy_prefs    => 1,
    save_pattern_hits  => 1,
    DEF_RULES_DIR      => $rules,
    userprefs_filename => $config});

Once I get past this project, I'll send a message to the SpamAssassin 
folks letting them know...

--Paul Heinlein <heinlein at cse.ogi.edu>




More information about the MIMEDefang mailing list