summaryrefslogtreecommitdiffstats
path: root/roles/IMAP/tasks
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2013-12-02 22:43:44 +0100
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:51:09 +0200
commit9ff98e18e5dd6967bce1457cff1884ec632cf2b5 (patch)
tree99adb4054b83f975dec12753d8d76a80d3c1d64a /roles/IMAP/tasks
parentc7080c68fb4594f01a2edc98a2014c109a5afe16 (diff)
Configure the Mail Delivery Agent.
Diffstat (limited to 'roles/IMAP/tasks')
-rw-r--r--roles/IMAP/tasks/main.yml1
-rw-r--r--roles/IMAP/tasks/mda.yml36
2 files changed, 37 insertions, 0 deletions
diff --git a/roles/IMAP/tasks/main.yml b/roles/IMAP/tasks/main.yml
index d71573e..df21dd2 100644
--- a/roles/IMAP/tasks/main.yml
+++ b/roles/IMAP/tasks/main.yml
@@ -1,2 +1,3 @@
---
- include: imap.yml tags=imap,dovecot
+- include: mda.yml tags=mda,mail,postfix
diff --git a/roles/IMAP/tasks/mda.yml b/roles/IMAP/tasks/mda.yml
new file mode 100644
index 0000000..39938fd
--- /dev/null
+++ b/roles/IMAP/tasks/mda.yml
@@ -0,0 +1,36 @@
+- name: Install Postfix
+ apt: pkg={{ item }}
+ with_items:
+ - postfix
+ - postfix-ldap
+
+- name: Configure Postfix
+ template: src=etc/postfix/main.cf.j2
+ dest=/etc/postfix-{{ postfix_instance[inst].name }}/main.cf
+ owner=root group=root
+ mode=0644
+ register: r
+ notify:
+ - Restart Postfix
+
+- name: Create directory /etc/postfix-.../virtual
+ file: path=/etc/postfix-{{ postfix_instance[inst].name }}/virtual
+ owner=root group=root
+ state=directory
+ mode=0755
+
+- name: Copy lookups tables
+ copy: src=etc/postfix/virtual/{{ item }}
+ dest=/etc/postfix-{{ postfix_instance[inst].name }}/virtual/{{ item }}
+ owner=root group=root
+ mode=0644
+ with_items:
+ - mailbox_domains.cf
+ - mailbox_maps.cf
+ - transport_content_filter_maps.cf
+
+- name: Start Postfix
+ service: name=postfix state=started
+ when: not r.changed
+
+- meta: flush_handlers