ending the spam.assassin.prefs.conf madness.

Rick Cooper rcooper at DWFORD.COM
Tue Nov 22 16:53:43 GMT 2005



> -----Original Message-----
> From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK]On
> Behalf Of Julian Field
> Sent: Tuesday, November 22, 2005 10:56 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 15:16, Rick Cooper wrote:
>
> >> -----Original Message-----
> >> From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK]On
> >> Behalf Of Julian Field
> >> Sent: Tuesday, November 22, 2005 9:58 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 12:00, Rick Cooper wrote:
> >>>
> >>> Julian, this code works :
> >>>
> >>> #!/usr/bin/perl
> >>> use Mail::SpamAssassin ;
> >>> my $test = Mail::SpamAssassin->new();
> >>> my $siterules = $test->{site_rules_filename};
> >>> $siterules ||= $test->first_existing_path
> >>> (@Mail::SpamAssassin::site_rules_path);
> >>> print "Site Rules Path : $siterules\n";
> >>
> >> Presumably, as I need a directory, I don't want to do the
> >> site_rules_filename bit. So I end up with just
> >>
> >> use Mail::SpamAssassin;
> >> $a = new Mail::SpamAssassin;
> >> print "site rules is \"";
> >> print $a->first_existing_path (@Mail::SpamAssassin::site_rules_path);
> >> print "\"\n";
> >>
> >> If I create a mailscanner.cf in there, and put everything from
> >> spam.assassin.prefs.conf in it, and just softlink that mailscanner.cf
> >> and spam.assassin.prefs.conf, then does this do the Right Thing(TM)?
> >>
> >
> > Why not just ln -f -s /MailScannerPath/etc/spamassassin.prefs.conf
> > site_rules_path/mailscanner.cf?
>
> So all I need to do is add a link to spam.assassin.prefs.conf in
> site_rules_path/mailscanner.cf ?
>
> This sounds like this whole entire problem could be solved with 1
> soft link.
>

Look at the attached and see if it couldn't be easily incorporated into the
existing SA.pm. It will allow you to use the MailScanner overrides from
spam.assassin.prefs.conf, all the other normal site rules and you don't need
any links, mailscanner won't interfere with normal command line stuff and I
think/hope every one would be happy.

I tested this by running the lint at the end, then moving a copy of
/etc/mail/spamassassin to another directory and hard coding that directory
as $siterules. ->lint came out no errors. Then I edited local.cf in the new
directory (which SA would never look for) and created a bare word lint error
and re-ran the code. It showed one lint error so the $test object was indeed
ignoring the standard rules dir and using what was fed it through the $test
= Mail::SpamAssassin->new({config_text => @lines}); line.

Will this satisfy everyone? Of course if you are going to lint your SA
install with MailScanner rules then you will have to point to the right rule
file, or Julian could whip up a quick lint utility similar to the attached
specifically for checking after modifying spam.assassin.prefs.conf, and/or
lint at startup every time and output the errors as required.

Heck you could probably add yet another config value to let the user decide
if spam.assassin.prefs.conf should be in or out of the normal site rules
path. :-)

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!

    [ Part 2, Application/OCTET-STREAM (Name: "FixMsSiteRules.pl")  ]
    [ 1.6KB. ]
    [ Unable to print this part. ]




More information about the MailScanner mailing list