- ---
- - name: Create the vmail group
- group: name=vmail gid=5000
- - name: Create the vmail user
- user: name=vmail uid=5000 group=vmail home=/var/vmail
- - name: Create mailbox directory
- file: path=/var/vmail state=directory owner=vmail group=vmail
- - name: Allow LOGIN authentication method for Outlook clients
- lineinfile: dest=/etc/dovecot/conf.d/10-auth.conf regexp='^auth_mechanisms =' line='auth_mechanisms = {{ispmail_dovecot_auth_mechanisms}}' backrefs=yes
- notify: restart dovecot
- - name: Disabling system authentication
- lineinfile: dest=/etc/dovecot/conf.d/10-auth.conf regexp='^!include auth-system.conf.ext' line='#!include auth-system.conf.ext' backrefs=yes
- notify: restart dovecot
- - name: Enabling SQL-based authentication
- lineinfile: dest=/etc/dovecot/conf.d/10-auth.conf regexp='^\#!include auth-sql.conf.ext' line='!include auth-sql.conf.ext' backrefs=yes
- notify: restart dovecot
- - name: Copying SQL authentication configuration (auth-sql.conf.ext)
- copy: src=auth-sql.conf.ext dest=/etc/dovecot/conf.d/auth-sql.conf.ext
- notify: restart dovecot
- - name: Copying mailbox and namespace configuration (10-mail.conf)
- copy: src=10-mail.conf dest=/etc/dovecot/conf.d/10-mail.conf
- notify: restart dovecot
- - name: Copying service configuration (10-master.conf)
- copy: src=10-master.conf dest=/etc/dovecot/conf.d/10-master.conf
- notify: restart dovecot
- - name: Copying SSL configuration (10-ssl.conf)
- copy: src=10-ssl.conf dest=/etc/dovecot/conf.d/10-ssl.conf
- notify: restart dovecot
- - name: Copying LMTP configuration (20-lmtp.conf - enable sieve plugin)
- copy: src=20-lmtp.conf dest=/etc/dovecot/conf.d/20-lmtp.conf
- notify: restart dovecot
- - name: Copying mailboxes configuration (15-mailboxes.conf - autocreate folders)
- copy: src=15-mailboxes.conf dest=/etc/dovecot/conf.d/15-mailboxes.conf
- notify: restart dovecot
- - name: Copying SQL access configuration (dovecot-ssql.conf.ext)
- template: src=dovecot-sql.conf.ext.j2 dest=/etc/dovecot/dovecot-sql.conf.ext
- notify: restart dovecot
- - name: Fixing ownership and mode of dovecot.conf
- file: path=/etc/dovecot/dovecot.conf group=vmail mode=0644
- notify: restart dovecot
- - name: Fixing ownership and mode of dovecot-sql.conf.ext
- file: path=/etc/dovecot/dovecot-sql.conf.ext owner=root group=root mode=0640
- notify: restart dovecot
- - name: Create directory for global sieve-after scripts
- file: path=/etc/dovecot/sieve-after state=directory
- - name: Create global sieve-after script to send spam to its mail folder
- copy: src=spam-to-folder.sieve dest=/etc/dovecot/sieve-after/spam-to-folder.sieve
- notify: recompile sieve script
- - name: Copying Sieve plugin configuration (90-sieve.conf)
- copy: src=90-sieve.conf dest=/etc/dovecot/conf.d/90-sieve.conf
- notify: restart dovecot
|