Update to trixie
This commit is contained in:
parent
3686d35108
commit
fbfb04717a
48 changed files with 914 additions and 2216 deletions
|
|
@ -1,126 +1,87 @@
|
|||
# here we assume that postfix.yml has run such that user 'mailstore' exists
|
||||
|
||||
- name: install dovecot packages
|
||||
apt:
|
||||
name: dovecot-imapd,dovecot-lmtpd,dovecot-pgsql,dovecot-managesieved,dovecot-lucene
|
||||
|
||||
# sieve scripts
|
||||
|
||||
|
||||
- name: Install dovecot packages
|
||||
ansible.builtin.apt:
|
||||
name: dovecot-core,dovecot-flatcurve,dovecot-imapd,dovecot-lmtpd,dovecot-managesieved,dovecot-pgsql,dovecot-sieve
|
||||
state: present
|
||||
|
||||
- name: install dovecot config files
|
||||
template:
|
||||
src: "dovecot/{{ item }}"
|
||||
dest: "/etc/dovecot/conf.d/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
force: yes
|
||||
loop:
|
||||
- 10-auth.conf
|
||||
- auth-sql.conf.ext
|
||||
- 10-mail.conf
|
||||
- 10-master.conf
|
||||
- 10-ssl.conf
|
||||
- 15-mailboxes.conf
|
||||
- 20-lmtp.conf
|
||||
- 20-imap.conf
|
||||
- 90-sieve.conf
|
||||
- 90-sieve-extprograms.conf
|
||||
- 90-plugin.conf
|
||||
- 90-acl.conf
|
||||
- 90-quota.conf
|
||||
- name: Remove inclusion of conf.d/*.conf from dovecot.conf
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/dovecot/dovecot.conf
|
||||
regexp: '^!include conf\.d/\*\.conf'
|
||||
line: '#!include conf.d/*.conf'
|
||||
|
||||
- name: install more dovecot config files
|
||||
template:
|
||||
- name: Set dovecot_config_version to 2.4.1
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/dovecot/dovecot.conf
|
||||
regexp: '^dovecot_config_version = .*'
|
||||
line: 'dovecot_config_version = 2.4.1'
|
||||
|
||||
- name: Set dovecot_storage_version to 2.4.1
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/dovecot/dovecot.conf
|
||||
regexp: '^dovecot_storage_version = .*'
|
||||
line: 'dovecot_storage_version = 2.4.1'
|
||||
|
||||
- name: Install /etc/dovecot/local.conf
|
||||
ansible.builtin.template:
|
||||
src: "dovecot/{{ item }}"
|
||||
dest: "/etc/dovecot/{{ item }}"
|
||||
owner: root
|
||||
group: dovecot
|
||||
mode: 0640
|
||||
force: yes
|
||||
group: root
|
||||
mode: "0600"
|
||||
force: true
|
||||
loop:
|
||||
- dovecot.conf
|
||||
- dovecot-sql.conf.ext
|
||||
- dovecot-dict-sql.conf.ext
|
||||
- local.conf
|
||||
|
||||
- name: directories /etc/dovecot/sieve_before /etc/dovecot/sieve_after
|
||||
file:
|
||||
path: "/etc/dovecot/{{ item }}"
|
||||
- name: File quota-warning.sh
|
||||
ansible.builtin.template:
|
||||
src: dovecot/quota-warning.sh
|
||||
dest: /usr/local/bin/quota-warning.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
force: true
|
||||
|
||||
- name: Directory /var/lib/dovecot/sieve
|
||||
ansible.builtin.file:
|
||||
path: "/var/lib/dovecot/sieve"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
loop:
|
||||
- sieve_pipes
|
||||
- sieve_filters
|
||||
- sieve_execute
|
||||
- sieve_before
|
||||
- sieve_after
|
||||
|
||||
- name: file /etc/dovecot/sieve_after/spam-to-folder.sieve
|
||||
template:
|
||||
src: dovecot/spam-to-folder.sieve
|
||||
dest: /etc/dovecot/sieve_after/spam-to-folder.sieve
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
force: yes
|
||||
|
||||
- name: files /etc/dovecot/sieve_pipes/*.sieve
|
||||
template:
|
||||
src: "dovecot/{{ item }}"
|
||||
dest: "/etc/dovecot/sieve_pipes/{{ item }}"
|
||||
owner: mailstore
|
||||
group: mailstore
|
||||
mode: 0600
|
||||
force: yes
|
||||
loop:
|
||||
- learn-spam.sieve
|
||||
- learn-ham.sieve
|
||||
mode: "0755"
|
||||
|
||||
- name: files /etc/dovecot/sieve_pipes/*.sh
|
||||
template:
|
||||
src: "dovecot/{{ item }}"
|
||||
dest: "/etc/dovecot/sieve_pipes/{{ item }}"
|
||||
- name: Copy sieve files
|
||||
ansible.builtin.copy:
|
||||
src: dovecot/sieve
|
||||
dest: /var/lib/dovecot/
|
||||
owner: mailstore
|
||||
group: mailstore
|
||||
mode: 0700
|
||||
force: yes
|
||||
mode: "0600"
|
||||
directory_mode: "0755"
|
||||
|
||||
- name: Directory permissions sieve pipes
|
||||
ansible.builtin.file:
|
||||
path: "/var/lib/dovecot/sieve/pipes"
|
||||
owner: mailstore
|
||||
group: mailstore
|
||||
mode: "0777"
|
||||
|
||||
- name: Execution flag for spam training scripts
|
||||
ansible.builtin.file:
|
||||
path: "/var/lib/dovecot/sieve/pipes/{{ item }}"
|
||||
owner: mailstore
|
||||
group: mailstore
|
||||
mode: "0700"
|
||||
loop:
|
||||
- rspamd-learn-spam.sh
|
||||
- rspamd-learn-ham.sh
|
||||
|
||||
- name: README files
|
||||
template:
|
||||
src: "dovecot/README_{{ item }}"
|
||||
dest: "/etc/dovecot/sieve_{{ item }}/README"
|
||||
owner: mailstore
|
||||
group: mailstore
|
||||
mode: 0600
|
||||
force: yes
|
||||
loop:
|
||||
- filters
|
||||
- execute
|
||||
- before
|
||||
- after
|
||||
|
||||
- name: restart dovecot
|
||||
systemd:
|
||||
- name: Restart dovecot
|
||||
ansible.builtin.systemd:
|
||||
name: dovecot
|
||||
state: restarted
|
||||
|
||||
- name: compile sieve files
|
||||
shell: "/usr/bin/sievec /etc/dovecot/{{ item }}"
|
||||
loop:
|
||||
- "sieve_after/spam-to-folder.sieve"
|
||||
- "sieve_pipes/learn-spam.sieve"
|
||||
- "sieve_pipes/learn-ham.sieve"
|
||||
|
||||
- name: permissions of .svbin
|
||||
file:
|
||||
path: "/etc/dovecot/{{ item }}"
|
||||
owner: mailstore
|
||||
group: mailstore
|
||||
mode: 0600
|
||||
loop:
|
||||
- "sieve_after/spam-to-folder.sieve"
|
||||
- "sieve_pipes/learn-spam.svbin"
|
||||
- "sieve_pipes/learn-ham.svbin"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue