From 945bd869f428433d50fefaf523633ac76b699335 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Wed, 3 Feb 2016 09:37:37 -0600 Subject: [PATCH] Fix Postfix mynetworks if IPv6 is disabled If a deployer sets disable_ipv6 = yes, we should ensure that the mynetworks directive in /etc/postfix/main.cf contains only IPv4 addresses. The `newalias` command fails if IPv6 addresses appear in mynetworks but IPv6 is disable system-wide. Closes-bug: 1538268 Change-Id: I45f09d631e9b81554f8463851143fd27c9f51ead --- tasks/mail.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/mail.yml b/tasks/mail.yml index 7e30dd64..83f8df31 100644 --- a/tasks/mail.yml +++ b/tasks/mail.yml @@ -33,6 +33,17 @@ - cat3 - V-38669 +- name: V-38669 - Use only IPv4 addresses in mynetworks if IPv6 is disabled + lineinfile: + dest: /etc/postfix/main.cf + regexp: "^(#)?mynetworks" + line: "mynetworks = 127.0.0.0/8" + when: disable_ipv6 | bool + tags: + - mail + - cat3 + - V-38669 + # Be sure to set root_forward_email so that this task is executed. See the # documentation for more details. - name: V-38446 - Mail system must forward root's email