1 - name: install dovecot
2 apt: name=dovecot-imapd,dovecot-lmtpd,dovecot-mysql,dovecot-pop3d,dovecot-sieve,dovecot-managesieved,python3-mysqldb state=latest
4 service: name=dovecot enabled=yes
6 - name: check mail group
7 shell: "test \"$(id -g mail)\" -eq '{{postfix.dovecot.mail_gid}}'"
9 - name: create vmail user
13 uid: "{{postfix.dovecot.vmail_uid}}"
18 - name: create vmail dir
19 file: name=/var/vmail state=directory owner=vmail group=mail
20 - name: configure dovecot
23 dest: /etc/dovecot/{{ item }}
24 src: templates/dovecot/{{ item }}
25 mode: u=rw,g=r,o=r # changepw needs read access
30 - conf.d/10-master.conf
35 - conf.d/90-quota.conf
36 - conf.d/auth-sql.conf.ext
37 - name: configure dovecot secrets
40 dest: /etc/dovecot/{{ item }}
41 src: templates/dovecot/{{ item }}
45 - dovecot-sql.conf.ext
46 - name: install quota notification script
48 dest: /etc/dovecot/quota-warning.sh
49 src: templates/dovecot/quota-warning.sh
52 - name: create newmail dir
53 file: path=/root/newmail state=directory
54 - name: install newmail script
56 dest: /root/newmail/newmail
57 src: templates/newmail/newmail
59 - name: install newmail config
61 dest: /root/newmail/{{ item }}
62 src: templates/newmail/{{ item }}
66 - name: install changepw script
67 when: postfix.dovecot.changepw_cgi is defined
69 dest: "{{postfix.dovecot.changepw_cgi}}"
70 src: templates/changepw