ending the spam.assassin.prefs.conf madness.

Anthony Peacock a.peacock at CHIME.UCL.AC.UK
Tue Nov 22 13:28:19 GMT 2005


Hi Rick,

> > -----Original Message-----
> > From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK]On
> > Behalf Of Julian Field Sent: Tuesday, November 22, 2005 6:14 AM To:
> > MAILSCANNER at JISCMAIL.AC.UK Subject: Re: ending the
> > spam.assassin.prefs.conf madness.
> >
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> >
> > On 22 Nov 2005, at 10:17, Anthony Peacock wrote:
> >
> > > Hi,

<SNIP>

> This will get all relevent paths and version,
> 
> #!/usr/bin/perl
> use Mail::SpamAssassin ;
> my $test = Mail::SpamAssassin->new();
> 
> my $SAVersion = $Mail::SpamAssassin::VERSION;
> my $siterules = $test->{site_rules_filename};

I don't think you strictly need the above line.  In the SpamAssassin 
code this checks to see if the site_rules_filename config has been 
set by a parameter passed to the new method.  As you don't pass this 
to the new method, you know it will be undef.

Same for the other code sections below.


> $siterules ||= $test->first_existing_path
> (@Mail::SpamAssassin::site_rules_path);
> 
> my $defaultrules = $test->{default_rules_path};
> $defaultrules ||= $test->first_existing_path
> (@Mail::SpamAssassin::default_rules_path);
> 
> my $defaultprefs = $test->{default_prefs_path};
> $defaultprefs ||= $test->first_existing_path
> (@Mail::SpamAssassin::default_prefs_path);
> 
> my $defaultuserprefs = $test->{default_userprefs_path};
> $defaultuserprefs ||= $test->first_existing_path
> (@Mail::SpamAssassin::default_userprefs_path);
> 
> my $defaultuserstate = $test->{default_userstate_dir};
> $defaultuserstate ||= $test->first_existing_path
> (@Mail::SpamAssassin::default_userstate_dir);
> 
> print "SpamAssassin Version\t: $SAVersion\n";
> print "Site Rules Path\t\t: $siterules\n";
> print "Default Rules Path\t: $defaultrules\n";
> print "Default Prefs Path\t: $defaultprefs\n";
> print "Default User Prefs\t: $defaultuserprefs\n";
> print "Default User State\t: $defaultuserstate\n";
> 
> 
> Rick
> 
> 
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> ------------------------ MailScanner list ------------------------ To
> unsubscribe, email jiscmail at jiscmail.ac.uk with the words: 'leave
> mailscanner' in the body of the email. Before posting, read the Wiki
> (http://wiki.mailscanner.info/) and the archives
> (http://www.jiscmail.ac.uk/lists/mailscanner.html).
> 
> Support MailScanner development - buy the book off the website!
> 


-- 
Anthony Peacock       
CHIME, Royal Free & University College Medical School
WWW:    http://www.chime.ucl.ac.uk/~rmhiajp/
"In the beginning of a change, the patriot is a brave and 
scarce man, hated and scorned. When the cause succeeds, however, 
the timid join him...for then it costs nothing to be a 
patriot." -Mark Twain

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!



More information about the MailScanner mailing list