[root@mail ~]# yum install spamassassin
[root@mail ~]# cat /etc/mail/spamassassin/local.cf # These values can be overridden by editing ~/.spamassassin/user_prefs.cf # (see spamassassin(1) for details) # These should be safe assumptions and allow for simple visual sifting # without risking lost emails. required_hits 5 report_safe 0 rewrite_header Subject [SPAM] blacklist_from *@yahoo-inc.com blacklist_from *@goisa.it blacklist_from *@moopex.cz
[root@mail ~]# man Mail::SpamAssassin::Conf
[root@mail ~]# groupadd spamd [root@mail ~]# useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd [root@mail ~]# chown spamd:spamd /var/log/spamassassin
[root@mail ~]# vim /etc/postfix/master.cf [root@mail ~]# grep 'spamassassin' /etc/postfix/master.cf -B4 # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) # ========================================================================== smtp inet n - n - - smtpd -o content_filter=spamassassin -- # #mailman unix - n n - - pipe # flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py # ${nexthop} ${user} spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
[root@mail ~]# sa-update && /etc/init.d/spamassassin restart
[root@mail ~]# /etc/init.d/postfix reload Reloading postfix: [ OK ] [root@mail ~]# /etc/init.d/spamassassin restart Stopping spamd: [ OK ] Starting spamd: [ OK ]
[root@mail1 ~]# vim /etc/mail/spamassassin/custom_rule.cf header LOCAL_EVERYTHINGYOUNEED_RULE Subject=~ /Everything you need, you can find here/i score LOCAL_EVERYTHINGYOUNEED_RULE 3.0 describe LOCAL_EVERYTHINGYOUNEED_RULE Everything you need [root@mail1 ~]# spamassassin -D --lint