From 9ff98e18e5dd6967bce1457cff1884ec632cf2b5 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Mon, 2 Dec 2013 22:43:44 +0100 Subject: Configure the Mail Delivery Agent. --- roles/IMAP/tasks/main.yml | 1 + roles/IMAP/tasks/mda.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 roles/IMAP/tasks/mda.yml (limited to 'roles/IMAP/tasks') 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 -- cgit v1.2.3