From 55e9b2a0ebc87a353f9c9496a77b313e41e47bd4 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 9 Jul 2014 01:23:01 +0200 Subject: Perform the alias resolution and address validation solely on the MX:es. We can therefore spare some lookups on the MDA, and use static:all instead. --- roles/IMAP/tasks/mda.yml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'roles/IMAP/tasks') diff --git a/roles/IMAP/tasks/mda.yml b/roles/IMAP/tasks/mda.yml index 698fd4f..897a61d 100644 --- a/roles/IMAP/tasks/mda.yml +++ b/roles/IMAP/tasks/mda.yml @@ -12,28 +12,15 @@ notify: - Reload Postfix -- name: Create directory /etc/postfix-.../virtual - file: path=/etc/postfix-{{ postfix_instance[inst].name }}/virtual - state=directory - owner=root group=root - mode=0755 - -- name: Copy lookup tables - copy: src=etc/postfix/virtual/{{ item }} - dest=/etc/postfix-{{ postfix_instance[inst].name }}/virtual/{{ item }} +- name: Copy the transport and recipient canonical maps + copy: src=etc/postfix/{{ item }} + dest=/etc/postfix-{{ postfix_instance[inst].name }}/{{ item }} owner=root group=root mode=0644 with_items: - - mailbox_domains.cf - - mailbox.cf - - transport_content_filter.cf - -- name: Copy recipient canonical - # no need to reload upon change, as cleanup(8) is short-running - copy: src=etc/postfix/recipient_canonical.pcre - dest=/etc/postfix-{{ postfix_instance[inst].name }}/recipient_canonical.pcre - owner=root group=root - mode=0644 + # no need to reload upon change, as cleanup(8) is short-running + - recipient_canonical.pcre + - transport - name: Build the Postfix relay clientcerts map sudo: False @@ -60,6 +47,14 @@ tags: - tls_policy +- name: Compile the Postfix transport maps + # trivial-rewrite(8) is a long-running process, so it's safer to reload + postmap: cmd=postmap src=/etc/postfix-{{ postfix_instance[inst].name }}/transport db=cdb + owner=root group=root + mode=0644 + notify: + - Reload Postfix + - meta: flush_handlers - name: Start Postfix -- cgit v1.2.3