ending the spam.assassin.prefs.conf madness.

Rick Cooper rcooper at DWFORD.COM
Tue Nov 22 00:49:21 GMT 2005


    [ The following text is in the "iso-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]



> -----Original Message-----
> From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK]On
> Behalf Of Matt Kettler
> Sent: Monday, November 21, 2005 5:29 PM
> To: MAILSCANNER at JISCMAIL.AC.UK
> Subject: Re: ending the spam.assassin.prefs.conf madness.
>
>
> Julian Field wrote:
> > My question still stands: what is the following code supposed to say?
> >
> > Julian Field wrote:
> >
> >> Can you double check that please?
> >>
> >> use Mail::SpamAssassin;
> >> $a = new Mail::SpamAssassin;
> >> print "site rules is \"" . $a->{siterules} . "\"\n";
> >> produces
> >> site rules is ""
> >> so it's not called "siterules". Please can you provide me a code
> >> snippet (requiring no external configs) that produces the text you are
> >> looking for.
>
>
> Well, I did say I knew little of perl. I was merely wondering if it was
> accessible. Apparently not.
>
> The code that's relevant from SpamAssassin.pm is:
>
>     my $siterules = $self->{site_rules_filename};
>     $siterules ||= $self->first_existing_path (@site_rules_path);
>
>

That says set the site rules path to site_rules_filename, if provided by the
calling program,
and if $siterules doesn't have a value the use the sub first_exiting_path to
return the first path that exists. It looks at the paths below

# first 3 are BSDish, latter 2 Linuxish
@site_rules_path = (
  '__local_rules_dir__',
  '__prefix__/etc/mail/spamassassin',
  '__prefix__/etc/spamassassin',
  '/usr/local/etc/spamassassin',
  '/usr/pkg/etc/spamassassin',
  '/usr/etc/spamassassin',
  '/etc/mail/spamassassin',
  '/etc/spamassassin',
);


A look at
http://www.cpan.org/modules/by-module/Mail/Mail-SpamAssassin-3.1.0.readme

Says the __*__ stuff is set thusly:

They are set on install time and can be overridden with the Makefile.PL
command line options DATADIR (for __def_rules_dir__) and CONFDIR (for
__local_rules_dir__).  If none of these options were given, FHS-compliant
locations based on the PREFIX (which becomes __prefix__) are chosen.
These are:

  __prefix__    __def_rules_dir__              __local_rules_dir__
  -------------------------------------------------------------------------
  /usr          /usr/share/spamassassin        /etc/mail/spamassassin
  /usr/local    /usr/local/share/spamassassin  /etc/mail/spamassassin
  /opt/$DIR     /opt/$DIR/share/spamassassin   /etc/opt/mail/spamassassin
  $DIR          $DIR/share/spamassassin        $DIR/etc/mail/spamassassin

Now if someone us using $DIR then they should know where they told the
installer to put it.

So if you were to use the attached revision of the script I posted earlier
it will look in all the possible dirs except /opt/$DIR or $DIR (no way to
tell what $DIR is). If it finds the local.cf, great, if not it will try and
find spamassassin and ask it, if it can't find spamassassin then it will ask
the user where spamassassin is and ask it again.

BTW: I did it as a shell script because I believe Julian's installer is a
shell script.

My two cents on the whole issue is, sure there are some things that could be
changed in the spamassassin.prefs.conf file to bring things up to date,
however I use a link in /etc/mail/spamassassin to spamassassin.prefs.conf ->
local.cf. I also force no DNS tests because, and I haven't checked 3.1.0,
SA's DNS tests suck. I had to shells running side by side, one shell looping
through host checks on the hosts SA check and one running --lint. SA failed
the DNS tests at least 3 out of 5 times but host never missed. I never
bothered to try and find why since the SA authors were well aware of this
problem and added the config var to disable tests and force use.

Perhaps the best thing is get a consensus as to what should be in a
spamassassin.prefs.conf file for the wide masses of novice admins and allow
those who know what they are doing modify as they desire. Kind of like the
basic exim.conf, it is safe and functional out of the box without having to
know technical details to get the mail system up and running. Novices will
*always* try and run mail systems without learning what they are doing first
and it's best to default to least knowledge required to operate, IMHO


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: "testsafind-new.sh")  4KB. ]
    [ Unable to print this part. ]




More information about the MailScanner mailing list