clone from private repo
This commit is contained in:
commit
c0ae983acb
48 changed files with 2766 additions and 0 deletions
81
mail_system/tasks/rspamd.yml
Normal file
81
mail_system/tasks/rspamd.yml
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
- name: apt install rspamd
|
||||
apt:
|
||||
name: rspamd
|
||||
state: present
|
||||
|
||||
# postfix integration
|
||||
|
||||
- name: postfix setting milter_mail_macros
|
||||
lineinfile:
|
||||
path: /etc/postfix/main.cf
|
||||
regexp: '^milter_mail_macros='
|
||||
line: 'milter_mail_macros=i {mail_addr} {client_addr} {client_name} {auth_authen}'
|
||||
insertafter: '^# rspamd'
|
||||
|
||||
- name: postfix setting milter_protocol
|
||||
lineinfile:
|
||||
path: /etc/postfix/main.cf
|
||||
regexp: '^milter_protocol='
|
||||
line: 'milter_protocol=6'
|
||||
insertafter: '^# rspamd'
|
||||
|
||||
- name: postfix setting non_smtpd_milters
|
||||
lineinfile:
|
||||
path: /etc/postfix/main.cf
|
||||
regexp: '^non_smtpd_milters='
|
||||
line: 'non_smtpd_milters=inet:127.0.0.1:11332'
|
||||
insertafter: '^# rspamd'
|
||||
|
||||
- name: postfix setting smtpd_milters
|
||||
lineinfile:
|
||||
path: /etc/postfix/main.cf
|
||||
regexp: '^smtpd_milters='
|
||||
line: 'smtpd_milters=inet:127.0.0.1:11332'
|
||||
insertafter: '^# rspamd'
|
||||
|
||||
- name: restart postfix
|
||||
systemd:
|
||||
name: postfix
|
||||
state: restarted
|
||||
|
||||
# rspamd configuration
|
||||
|
||||
- name: rspamd configure extended_spam_headers true
|
||||
template:
|
||||
src: "rspamd/{{ item }}"
|
||||
dest: "/etc/rspamd/override.d/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
loop:
|
||||
- milter_headers.conf
|
||||
- classifier-bayes.conf
|
||||
- antivirus.conf
|
||||
|
||||
# install dkim
|
||||
|
||||
- name: mkdir /var/lib/rspamd/dkim
|
||||
file:
|
||||
path: /var/lib/rspamd/dkim
|
||||
state: directory
|
||||
owner: _rspamd
|
||||
group: _rspamd
|
||||
mode: '0755'
|
||||
|
||||
- name: rspamd config dkim_signing.conf and arc.conf
|
||||
template:
|
||||
src: "rspamd/{{ item }}"
|
||||
dest: "/etc/rspamd/local.d/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
loop:
|
||||
- dkim_signing.conf
|
||||
- arc.conf
|
||||
|
||||
# restart rspamd
|
||||
|
||||
- name: restart rspamd
|
||||
systemd:
|
||||
name: rspamd
|
||||
state: restarted
|
||||
Loading…
Add table
Add a link
Reference in a new issue