From 716c1f79acfc5ff976e954c71b53ccb1b5fd729d Mon Sep 17 00:00:00 2001 From: Y Date: Sat, 11 May 2019 18:46:17 +0200 Subject: [PATCH] exim: new upstream configuration of smarthosts --- roles/dmz_exim/tasks/main.yml | 44 ++++++++++------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/roles/dmz_exim/tasks/main.yml b/roles/dmz_exim/tasks/main.yml index ec21899..b90f112 100644 --- a/roles/dmz_exim/tasks/main.yml +++ b/roles/dmz_exim/tasks/main.yml @@ -203,6 +203,15 @@ notify: - restart exim.service +- name: set smarthost name + lineinfile: + path: /etc/mail/exim.conf + regexp: '^(?:#\s*)?ROUTER_SMARTHOST\s*=' + line: | + ROUTER_SMARTHOST={{mail_smtp_smarthost}} + notify: + - restart exim.service + - name: set log destination lineinfile: path: /etc/mail/exim.conf @@ -383,41 +392,12 @@ # TODO: https://github.com/Exim/exim/wiki/SimpleGreylisting (with SPAM≥1.0) -- name: disable the dnslookup router - replace: - path: /etc/mail/exim.conf - regexp: '^dnslookup:\n(?:.+\n)*' - replace: | - # dnslookup: - # driver = dnslookup - # domains = ! +local_domains - # transport = remote_smtp - # ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1 - # no_more - notify: - - restart exim.service - -- name: enable the smarthost router - replace: - path: /etc/mail/exim.conf - regexp: '^#\s*smarthost:\n(?:.+\n)*' - replace: | - smarthost: - driver = manualroute - domains = ! +local_domains - transport = remote_smtp - route_list = * ISP.SMART.HOST - ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1 - no_more - notify: - - restart exim.service - -- name: set the smarthost hostname +- name: use remote_smtp for smarthost delivery lineinfile: path: /etc/mail/exim.conf - regexp: '^(\s*route_list\s*=)' + regexp: '^(\s*transport\s*=)' backrefs: true - line: "\\1 * {{mail_smtp_smarthost}}" + line: "\\1 remote_smtp" notify: - restart exim.service