Improve the SpamAssassin config
This commit is contained in:
parent
6d3d810683
commit
ebbd5c7851
5 changed files with 88 additions and 2 deletions
55
roles/spamassassin/files/local.cf
Normal file
55
roles/spamassassin/files/local.cf
Normal file
|
@ -0,0 +1,55 @@
|
|||
# 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
|
||||
bayes_auto_learn_threshold_nonspam -4
|
||||
|
||||
# disable certain kinds of blacklists since their dns checks were timing out
|
||||
score RCVD_IN_BL_SPAMCOP_NET 0
|
||||
score RCVD_IN_RP_RNBL 0
|
||||
score RCVD_IN_RP_CERTIFIED 0
|
||||
score RCVD_IN_RP_SAFE 0
|
||||
|
||||
# Red Hat's private PSBL zone mirror
|
||||
header RCVD_IN_PSBL eval:check_rbl('psbl-lastexternal', 'psbl.redhat.com.')
|
||||
|
||||
# Red Hat's private spamhaus mirror
|
||||
header __RCVD_IN_ZEN eval:check_rbl('zen', 'sh-zen.redhat.com.')
|
||||
header RCVD_IN_XBL eval:check_rbl('zen-lastexternal', 'sh-zen.redhat.com.', '127.0.0.[45678]')
|
||||
header RCVD_IN_PBL eval:check_rbl('zen-lastexternal', 'sh-zen.redhat.com.', '127.0.0.1[01]')
|
||||
header RCVD_IN_CSS eval:check_rbl_sub('zen', 'sh-zen.redhat.com.', '127.0.0.3')
|
||||
uridnsbl URIBL_SBL sh-sbl.redhat.com. TXT
|
||||
|
||||
# Red Hat's private anubis mirror
|
||||
header __RCVD_IN_ANBREP eval:check_rbl('anubisrep-lastexternal', 'anb-rep.redhat.com.')
|
||||
tflags __RCVD_IN_ANBREP net
|
||||
|
||||
header RCVD_IN_ANBREP_Z eval:check_rbl_sub('anubisrep-lastexternal', '^127.0.0.2$')
|
||||
describe RCVD_IN_ANBREP_Z Spam wave participant
|
||||
tflags RCVD_IN_ANBREP_Z net
|
||||
header RCVD_IN_ANBREP_L5 eval:check_rbl_sub('anubisrep-lastexternal', '^127.0.0.10$')
|
||||
describe RCVD_IN_ANBREP_L5 Very bad reputation (-5)
|
||||
tflags RCVD_IN_ANBREP_L5 net
|
||||
header RCVD_IN_ANBREP_L4 eval:check_rbl_sub('anubisrep-lastexternal', '^127.0.0.11$')
|
||||
describe RCVD_IN_ANBREP_L4 Bad reputation (-4)
|
||||
tflags RCVD_IN_ANBREP_L4 net
|
||||
header RCVD_IN_ANBREP_L3 eval:check_rbl_sub('anubisrep-lastexternal', '^127.0.0.12$')
|
||||
describe RCVD_IN_ANBREP_L3 Low reputation (-3)
|
||||
tflags RCVD_IN_ANBREP_L3 net
|
||||
header RCVD_IN_ANBREP_L2 eval:check_rbl_sub('anubisrep-lastexternal', '^127.0.0.13$')
|
||||
describe RCVD_IN_ANBREP_L2 Suspicious sender (-2)
|
||||
tflags RCVD_IN_ANBREP_L2 net
|
||||
score RCVD_IN_ANBREP_Z 0.5
|
||||
score RCVD_IN_ANBREP_L5 0.9
|
||||
score RCVD_IN_ANBREP_L4 0.7
|
||||
score RCVD_IN_ANBREP_L3 0.6
|
||||
score RCVD_IN_ANBREP_L2 0.5
|
||||
|
||||
# disable razor2
|
||||
score RAZOR2_CF_RANGE_51_100 0
|
||||
score RAZOR2_CF_RANGE_E8_51_100 0
|
||||
score RAZOR2_CHECK 0
|
9
roles/spamassassin/files/sa-update
Normal file
9
roles/spamassassin/files/sa-update
Normal file
|
@ -0,0 +1,9 @@
|
|||
### OPTIONAL: Spamassassin Rules Updates ###
|
||||
#
|
||||
# http://wiki.apache.org/spamassassin/RuleUpdates
|
||||
# Highly recommended that you read the documentation before using this.
|
||||
# ENABLE UPDATES AT YOUR OWN RISK.
|
||||
#
|
||||
# /var/log/sa-update.log contains a history log of sa-update runs
|
||||
|
||||
10 4 * * * root /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log
|
|
@ -1,2 +1,2 @@
|
|||
# Options to spamd
|
||||
SPAMDOPTIONS="-d -c -m5 -H -u spammy -g spammy"
|
||||
SPAMDOPTIONS="-d -c -m10 -H -u spammy -g spammy"
|
||||
|
|
3
roles/spamassassin/handlers/main.yml
Normal file
3
roles/spamassassin/handlers/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
- name: restart spamassassin
|
||||
action: service name=spamassassin state=restarted
|
||||
|
|
@ -2,7 +2,10 @@
|
|||
# tasklist for setting up a SpamAssassin server
|
||||
|
||||
- name: install the package
|
||||
yum: pkg=spamassassin state=present
|
||||
yum: pkg={{ item }} state=present
|
||||
with_items:
|
||||
- spamassassin
|
||||
- perl-Razor-Agent
|
||||
tags:
|
||||
- packages
|
||||
|
||||
|
@ -18,8 +21,24 @@
|
|||
|
||||
- name: setup the sysconfig file
|
||||
copy: src=sysconfig dest=/etc/sysconfig/spamassassin
|
||||
notify:
|
||||
- restart spamassassin
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: setup the config file
|
||||
copy: src=local.cf dest=/etc/mail/spamassassin/local.cf
|
||||
notify:
|
||||
- restart spamassassin
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: setup the cron job
|
||||
copy: src=sa-update dest=/etc/cron.d/sa-update
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: set the service running/enabled
|
||||
service: name=spamassassin enabled=true state=running
|
||||
tags:
|
||||
- service
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue