dovecot: pkg.installed: - pkgs: - dovecot-core - dovecot-imapd - dovecot-sieve - dovecot-managesieved dovecot_certs_group: group.present: - name: ssl-cert - system: true - addusers: - dovecot dovecot_conf: file.managed: - mode: 0644 - names: - /etc/dovecot/local.conf: - source: salt://email/dovecot/dovecot_local.conf sieve_conf: file.recurse: - name: /var/lib/dovecot/sieve-before.d - dir_mode: '0755' - file_mode: '0644' - source: salt://email/dovecot/sieve-before.d sieve_conf_compile: cmd.run: - name: for i in /var/lib/dovecot/sieve-before.d/*.sieve; do sievec $i; done - onchanges: - file: sieve_conf dovecot_service: service.running: - name: dovecot - enable: true - watch: - pkg: dovecot - file: /etc/dovecot/local.conf