diff options
Diffstat (limited to 'roles/spamassassin')
-rw-r--r-- | roles/spamassassin/defaults/main.yml | 0 | ||||
-rw-r--r-- | roles/spamassassin/files/defaults | 9 | ||||
-rw-r--r-- | roles/spamassassin/handlers/main.yml | 0 | ||||
-rw-r--r-- | roles/spamassassin/tasks/main.yml | 40 | ||||
-rw-r--r-- | roles/spamassassin/templates/local.cf.j2 | 18 |
5 files changed, 67 insertions, 0 deletions
diff --git a/roles/spamassassin/defaults/main.yml b/roles/spamassassin/defaults/main.yml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/roles/spamassassin/defaults/main.yml | |||
diff --git a/roles/spamassassin/files/defaults b/roles/spamassassin/files/defaults new file mode 100644 index 0000000..a38795c --- /dev/null +++ b/roles/spamassassin/files/defaults | |||
@@ -0,0 +1,9 @@ | |||
1 | OPTIONS="--listen /var/run/spamd.sock --max-children 5 --socketpath=/var/spool/postfix/spamd/spamd.sock --socketowner root --socketgroup root --socketmode 0666" | ||
2 | |||
3 | PIDFILE=/var/run/spamd.pid | ||
4 | |||
5 | # Cronjob | ||
6 | # Set to anything but 0 to enable the cron job to automatically update | ||
7 | # spamassassin's rules on a nightly basis | ||
8 | CRON=1 | ||
9 | |||
diff --git a/roles/spamassassin/handlers/main.yml b/roles/spamassassin/handlers/main.yml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/roles/spamassassin/handlers/main.yml | |||
diff --git a/roles/spamassassin/tasks/main.yml b/roles/spamassassin/tasks/main.yml new file mode 100644 index 0000000..4c69be5 --- /dev/null +++ b/roles/spamassassin/tasks/main.yml | |||
@@ -0,0 +1,40 @@ | |||
1 | - name: install packages | ||
2 | package: | ||
3 | name: | ||
4 | - spamassassin | ||
5 | state: latest | ||
6 | |||
7 | - name: make directory in postfix chroot | ||
8 | file: | ||
9 | path: /var/spool/postfix/spamd | ||
10 | owner: root | ||
11 | group: root | ||
12 | mode: '0755' | ||
13 | state: directory | ||
14 | |||
15 | - name: deploy configuration | ||
16 | template: | ||
17 | src: local.cf.j2 | ||
18 | dest: /etc/spamassassin/local.cf | ||
19 | owner: root | ||
20 | group: root | ||
21 | mode: '0644' | ||
22 | |||
23 | - name: deploy defaults file | ||
24 | copy: | ||
25 | src: defaults | ||
26 | dest: /etc/default/spamd | ||
27 | owner: root | ||
28 | group: root | ||
29 | mode: '0644' | ||
30 | |||
31 | - name: enable spamassassin | ||
32 | systemd: | ||
33 | enabled: yes | ||
34 | masked: no | ||
35 | name: spamd | ||
36 | |||
37 | - name: restart spamassassin | ||
38 | service: | ||
39 | name: spamd | ||
40 | state: restarted | ||
diff --git a/roles/spamassassin/templates/local.cf.j2 b/roles/spamassassin/templates/local.cf.j2 new file mode 100644 index 0000000..1fdc978 --- /dev/null +++ b/roles/spamassassin/templates/local.cf.j2 | |||
@@ -0,0 +1,18 @@ | |||
1 | # SpamAssassin Configuration | ||
2 | # Clearly indicate message is spam to user | ||
3 | rewrite_header Subject *****SPAM***** | ||
4 | rewrite_header From *****SPAM***** | ||
5 | |||
6 | # Halves default spam score thus implementing a very strict spam policy | ||
7 | # Comment or edit as needed for your deployment | ||
8 | required_score {{ spam_score }} | ||
9 | |||
10 | # Attach original messages as text/plain instead of message/rfc822 to spam reports | ||
11 | # This is basically a safety net to prevent mail clients from automatically loading | ||
12 | # attached spam messages. Note though that this makes the original message harder to recover | ||
13 | # If this is not something you are worried about, comment the next line to use the default. | ||
14 | report_safe 2 | ||
15 | |||
16 | # This specifies languages considered OK for incoming mail | ||
17 | # If you expect to receive mail in non-western character sets, comment or edit as needed | ||
18 | ok_locales {{ sa_locales }} | ||