aboutsummaryrefslogtreecommitdiffstats
path: root/roles/mail/tasks
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-05 22:50:50 +0800
committerAaron LI <aly@aaronly.me>2018-03-14 11:35:08 +0800
commitddc53fbccc185bc52adf1050a98531c3750bf1fd (patch)
treee44662ce7e67655e28a248bb72b083a92c781e8e /roles/mail/tasks
parentfb9e90d84ab1eb50c6f0702316a67bcad6db8524 (diff)
downloadansible-dfly-vps-ddc53fbccc185bc52adf1050a98531c3750bf1fd.tar.bz2
mail: setup dovecot sevice
Diffstat (limited to 'roles/mail/tasks')
-rw-r--r--roles/mail/tasks/main.yml36
1 files changed, 36 insertions, 0 deletions
diff --git a/roles/mail/tasks/main.yml b/roles/mail/tasks/main.yml
index 8191c0d..f7163fd 100644
--- a/roles/mail/tasks/main.yml
+++ b/roles/mail/tasks/main.yml
@@ -74,6 +74,42 @@
- name: opendkim - enable and start
command: rcenable milter-opendkim
+
+#
+# Dovecot
+#
+
+- name: dovecot - copy sieve filters
+ copy:
+ src: sieve/ # trailing '/' -> directory contents
+ dest: /usr/local/etc/dovecot/sieve/
+ tags: dovecot
+
+- name: dovecot - compile sieve filters
+ command: >
+ find /usr/local/etc/dovecot/sieve/
+ -name '*.sieve'
+ -exec sievec '{}' ';'
+ tags: dovecot
+
+- name: dovecot - copy passwd
+ copy:
+ src: "{{ playbook_dir }}/private/dovecot/passwd"
+ dest: /usr/local/etc/dovecot/passwd
+ group: dovecot
+ mode: 0440
+ tags: dovecot
+
+- name: opendkim - generate config file
+ template:
+ src: dovecot.conf.j2
+ dest: /usr/local/etc/dovecot/dovecot.conf
+ notify: reload-dovecot
+ tags: dovecot
+
+- name: dovecot - enable and start
+ command: rcenable dovecot
+
- name: aliases - forward root mails
lineinfile:
path: /etc/mail/aliases