diff --git a/roles/mailserver_dovecot/tasks/main.yml b/roles/mailserver_dovecot/tasks/main.yml index 74007af..4d7347d 100644 --- a/roles/mailserver_dovecot/tasks/main.yml +++ b/roles/mailserver_dovecot/tasks/main.yml @@ -174,26 +174,36 @@ mode: "644" notify: Compile spam-to-folder.sieve -- name: Add autoexpunge mailbox config +- name: Add autoexpunge mailbox config (Junk) become: true ansible.builtin.lineinfile: path: /etc/dovecot/conf.d/15-mailboxes.conf line: " autoexpunge = 30d" - insertafter: "mailbox {{ item }}" - loop: - - Junk - - Trash + insertafter: "mailbox Junk" notify: Reload dovecot service -- name: Add subscribed mailbox config +- name: Add autoexpunge mailbox config (Trash) become: true ansible.builtin.lineinfile: path: /etc/dovecot/conf.d/15-mailboxes.conf - line: " auto = subscribed" - insertafter: 'special_use = \\{{ item }}' - loop: - - Junk - - Trash + line: " autoexpunge = 30d" + insertafter: "mailbox Trash" + notify: Reload dovecot service + +- name: Add subscribe mailbox config (Junk) + become: true + ansible.builtin.lineinfile: + path: /etc/dovecot/conf.d/15-mailboxes.conf + line: " auto = subscribe" + insertafter: 'special_use =.*Junk' + notify: Reload dovecot service + +- name: Add subscribe mailbox config (Trash) + become: true + ansible.builtin.lineinfile: + path: /etc/dovecot/conf.d/15-mailboxes.conf + line: " auto = subscribe" + insertafter: 'special_use =.*Trash' notify: Reload dovecot service - name: Add imap_sieve plugin