summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2018-12-09 18:26:53 +0100
committerGuilhem Moulin <guilhem@fripost.org>2018-12-09 20:25:40 +0100
commit1b834eaf9983dc94cbdbee983c5f15e4f50b4d7c (patch)
tree3db6b4c2eb3bca79d03ccfe25a8196ff321e51d8
parent7403204208322ab2e46920a024e74700757c2665 (diff)
IMAP: Ensure /home/mail is mounted before creating sub-directories.
-rw-r--r--roles/IMAP/tasks/imap.yml7
1 files changed, 7 insertions, 0 deletions
diff --git a/roles/IMAP/tasks/imap.yml b/roles/IMAP/tasks/imap.yml
index 18aa910..29b449e 100644
--- a/roles/IMAP/tasks/imap.yml
+++ b/roles/IMAP/tasks/imap.yml
@@ -31,40 +31,47 @@
mode=0644
with_items:
- dovecot-auth-proxy.service
- dovecot-auth-proxy.socket
notify:
- systemctl daemon-reload
- meta: flush_handlers
- name: Enable dovecot auth proxy
service: name=dovecot-auth-proxy.socket state=started enabled=yes
# The ownership and permissions ensure that dovecot won't try to
# deliver mails under an umounted mountpoint.
- name: Create a home directory for user 'vmail'
file: path=/home/mail
state=directory
owner=root group=root
mode=0755
+- name: Mount /home/mail
+ mount: src=/dev/mapper/luksMail
+ path=/home/mail
+ fstype=ext4
+ opts=noauto
+ state=mounted
+
- name: Create /home/mail/{virtual,attachments,spamspool}
file: path=/home/mail/{{ item }}
state=directory
owner=vmail group=vmail
mode=0700
with_items:
- virtual
- attachments
- spamspool
- name: Create a cronjob for purging and SIS deduplication
copy: src=etc/cron.d/doveadm
dest=/etc/cron.d/doveadm
owner=root group=root
mode=0644
- name: Create virtual mailbox directories
file: path=/etc/dovecot/virtual/{{ item }}
state=directory
owner=root group=root