Clive Dove wrote:

I was thinking of adding configuration for it,

From the looks of it I think that I will find it easier to download the tarballs for SpamAssasin and MailScanner and set them up together as shown in the mailscanner site.

But for a distribution intended for general consumer use, it would be great if the default install had a spam filter installed by default as most people will want one but will not be willing to go to the trouble of learning how to configure it.



Here's what I've got (9.1 based):


The rpms:
perl-Mail-SpamAssassin
spamassassin
perl-Digest-Nilsimsa
perl-Digest-SHA1
perl-MailTools
perl-Net-DNS
perl-Razor-Agent


Configuring Spamassassin: -----------------------

# adduser spamfilter
# passwd -l spamfilter
# mkdir /var/spool/spamfilter
# chown spamfilter:spamfilter /var/spool/spamfilter

- Modify the /etc/postfix/master.cf, by commenting out the two current smtp lines, and adding the following:
# SpamAssassin-start
spamfilter unix - n n - - pipe
user=spamfilter argv=/etc/mail/spamfilter.sh -f ${sender} -- ${recipient}
smtp inet n - y - - smtpd
-o content_filter=spamfilter:
smtp unix - - y - - smtp
-o content_filter=spamfilter:
# SpamAssassin-end


- Modify /etc/mail/spamassassin/local.cf by uncommenting ‘defang_mime 0’ and adding the following:
skip_rbl_checks 0
required_hits 4.5
- Adjust this to suit your needs (higher value filters less spam).


** Note: review the documentation and adjust above to meet your needs.

- Create the file /etc/mail/spamfilter.sh, containing the following:
<--start-spamfilter.sh-->
#!/bin/sh

INSPECT_DIR=/var/spool/spamfilter
SENDMAIL="/usr/sbin/sendmail.postfix -i"
SPAMASSASSIN=/usr/bin/spamc

# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69

cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }

# Clean up when done or when aborting.
trap "rm -f in.$$; rm -f out.$$" 0 1 2 3 15

cat | $SPAMASSASSIN > out.$$ || { echo Message content rejected; exit $EX_UNAVAILABLE; }

$SENDMAIL "$@" < out.$$

exit $?
<--end-spamfilter.sh-->

- Make the file executable, restart spamd & postfix
# chmod +x /etc/mail/spamfilter.sh

** Note: Review SpamAssassin configuration options (/etc/mail/spamassassin/local.cf)


Vipul’s Razor (Distributed Anti-SPAM) configuration
---------------------------------------------------
- Create default config file (razor log & conf files: /home/spamfilter/.razor/)
# su spamfilter
$ cd
$ razor-admin –create
$ exit


- Create the file /etc/logrotate.d/razor, containing the following:
<--start-razor-->
/home/spamfilter/.razor/razor-agent.log {
rotate 10
daily
postrotate
/etc/rc.d/init.d/spamassassin restart
endscript
}
<--end-razor-->

- Restart spamd
# service spamassassin restart
# service postfix restart






Reply via email to