diff --git a/roles/dovecot/files/shared-mailboxes b/roles/dovecot/files/shared-mailboxes new file mode 100644 index 0000000000000000000000000000000000000000..28d2ebe5801f35f52806522b5e6fb3f5d5870185 --- /dev/null +++ b/roles/dovecot/files/shared-mailboxes @@ -0,0 +1 @@ +mediation-team::::::: diff --git a/roles/dovecot/files/shared-mailboxes-acl b/roles/dovecot/files/shared-mailboxes-acl new file mode 100644 index 0000000000000000000000000000000000000000..479101f974f301b5a728bf98f3cda204a36c2bde --- /dev/null +++ b/roles/dovecot/files/shared-mailboxes-acl @@ -0,0 +1,3 @@ +denisse_mediation-team:::::/home/vmail/shared-mailboxes/mediation-team::user=denisse +dvzrv_mediation-team:::::/home/vmail/shared-mailboxes/mediation-team::user=dvzrv +morganamilo_mediation-team:::::/home/vmail/shared-mailboxes/mediation-team::user=morganamilo diff --git a/roles/dovecot/tasks/main.yml b/roles/dovecot/tasks/main.yml index 9ad91bbce1e0fe80eeef2cf54eef0dc977e4b234..dfdea666539b9b30701a7b10d9e54530316cb860 100644 --- a/roles/dovecot/tasks/main.yml +++ b/roles/dovecot/tasks/main.yml @@ -13,6 +13,14 @@ notify: - Reload dovecot +- name: Install shared-mailboxes{,-acl} + copy: src={{ item }} dest=/etc/dovecot/ owner=root group=root mode=0644 + loop: + - shared-mailboxes + - shared-mailboxes-acl + notify: + - Reload dovecot + - name: Add vmail group group: name=vmail gid=5000 diff --git a/roles/dovecot/templates/dovecot.conf.j2 b/roles/dovecot/templates/dovecot.conf.j2 index 4cc04689af3a29bb9ffaf78d28275f9ecfd5714c..4f7de9086ea9bd434775ac76c32d41ed0776843a 100644 --- a/roles/dovecot/templates/dovecot.conf.j2 +++ b/roles/dovecot/templates/dovecot.conf.j2 @@ -33,6 +33,10 @@ namespace inbox { } } +passdb { + driver = passwd-file + args = /etc/dovecot/shared-mailboxes-acl +} passdb { driver = pam } @@ -89,6 +93,18 @@ ssl_options = no_compression ssl_cipher_list = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 +userdb { + driver = passwd-file + args = /etc/dovecot/shared-mailboxes + # https://doc.dovecot.org/configuration_manual/config_file/config_variables/ + override_fields = uid=vmail gid=vmail home=/home/vmail/shared-mailboxes/%n +} +userdb { + driver = passwd-file + args = username_format=%{original_username} /etc/dovecot/shared-mailboxes-acl + # https://doc.dovecot.org/configuration_manual/config_file/config_variables/ + override_fields = uid=vmail gid=vmail mail=mdbox:~/.mdbox:INDEXPVT=~/indexes/%Ln +} userdb { driver = passwd # https://doc.dovecot.org/configuration_manual/config_file/config_variables/