Skip to content
Snippets Groups Projects
Commit ec24ccc5 authored by Lars Beckers's avatar Lars Beckers
Browse files

spamassassin: refactor role

parent 20a1bc5f
Branches
No related tags found
No related merge requests found
---
spamassassin_rewrite_subject: no
spamassassin_required_score: '3.0'
#!/bin/sh
# you can also use tcp/ip here, consult spamc(1)
exec /usr/bin/spamc -u ${1} -L ham -C report
#!/bin/sh
# you can also use tcp/ip here, consult spamc(1)
exec /usr/bin/spamc -u ${1} -L spam -C report
---
- name: ensure spamassassin is installed
apt: name={{ item }} state=present
apt:
name: "{{ item }}"
state: present
with_items:
- spamassassin
- spamc
......@@ -10,34 +12,32 @@
- spamassassin
- name: ensure spamassassin is configured
copy: src=files/local.cf dest=/etc/spamassassin/local.cf mode=0644 owner=root group=root
template:
src: local.cf.j2
dest: /etc/spamassassin/local.cf
owner: root
group: root
mode: 0644
tags:
- mail
- spamassassin
- name: ensure spamassassin is enabled -- the nasty debian way
copy: src=files/defaults dest=/etc/default/spamassassin mode=0644 owner=root group=root
copy:
src: defaults
dest: /etc/default/spamassassin
owner: root
group: root
mode: 0644
tags:
- mail
- spamassassin
- name: ensure spamassasin is started and enanbled -- the usual way
service: name=spamassassin state=started enabled=yes
tags:
- mail
- spamassassin
#- name: ensure there is sync cronjob for the learned filters
- name: ensure scripts for learning spam are present.
copy: src="files/{{ item }}" dest=/var/lib/dovecot/sieve.d/{{ item }} mode=0750 owner=dovecot group=vmail
with_items:
- sa-learn-ham.sh
- sa-learn-spam.sh
service:
name: spamassassin
state: started
enabled: yes
tags:
- mail
- spamassassin
......@@ -9,7 +9,7 @@
# Add *****SPAM***** to the Subject header of spam e-mails
#
rewrite_header Subject *****SPAM*****
{{ '' if spamassassin_rewrite_subject else '#' }}rewrite_header Subject *****SPAM*****
# Save spam messages as a message/rfc822 MIME attachment instead of
......@@ -31,7 +31,7 @@ report_safe 0
# Set the threshold at which a message is considered spam (default: 5.0)
#
required_score 3.0
required_score {{ spamassassin_required_score }}
# Use Bayesian classifier (default: 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment