diff --git a/roles/mailserver_dovecot/tasks/main.yml b/roles/mailserver_dovecot/tasks/main.yml index 24f66ec..b06e91b 100644 --- a/roles/mailserver_dovecot/tasks/main.yml +++ b/roles/mailserver_dovecot/tasks/main.yml @@ -170,3 +170,25 @@ group: root mode: "644" notify: Compile spam-to-folder.sieve + +- name: Add autoexpunge mailbox config + become: true + ansible.builtin.lineinfile: + path: /etc/dovecot/conf.d/15-mailboxes.conf + line: " autoexpunge = 30d" + insertafter: "mailbox {{ item }}" + loop: + - Junk + - Trash + notify: Reload dovecot service + +- name: Add subscribed mailbox config + become: true + ansible.builtin.lineinfile: + path: /etc/dovecot/conf.d/15-mailboxes.conf + line: " auto = subscribed" + insertafter: 'special_use = \\{{ item }}' + loop: + - Junk + - Trash + notify: Reload dovecot service