diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2014-06-27 06:19:53 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:51:58 +0200 |
commit | ed152395737dc411c4d9fef32b54e2008ba4c31f (patch) | |
tree | ba6de89b7d319bec7ac48586b4a91405d4234c34 | |
parent | a8a4d198906e27a9183b1eba6c6c72fdbd390963 (diff) |
chown root:root /home/mail && chmod 0755 /home/mail
This ensures that Dovecot won't deliver messages if the disk hasn't been
mounted, for instance.
-rw-r--r-- | roles/IMAP/tasks/imap.yml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/roles/IMAP/tasks/imap.yml b/roles/IMAP/tasks/imap.yml index 67c2bcc..e1f005d 100644 --- a/roles/IMAP/tasks/imap.yml +++ b/roles/IMAP/tasks/imap.yml @@ -2,42 +2,44 @@ apt: pkg={{ item }} with_items: - dovecot-core - dovecot-ldap - dovecot-imapd - dovecot-lmtpd - dovecot-antispam - dovecot-managesieved - dovecot-sieve - name: Create a user 'vmail' user: name=vmail system=yes home=/home/mail shell=/bin/false password=! state=present - name: Create a home directory for user 'vmail' file: path=/home/mail state=directory - owner=vmail group=vmail - mode=0700 + # The ownership and permissions ensure that dovecot won't try to + # deliver mails under an umounted mountpoint. + owner=root group=root + mode=0755 - name: Create virtual mailbox directories file: path=/etc/dovecot/virtual/{{ item }} state=directory owner=root group=root mode=0755 with_items: - all - flagged - recent - unseen - name: Create virtual mailboxes copy: src=etc/dovecot/virtual/{{ item }}/dovecot-virtual dest=/etc/dovecot/virtual/{{ item }}/dovecot-virtual owner=root group=root mode=0644 with_items: - all - flagged |