From c766eddedaeb34db3cc139806ea37dfd15a642ce Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Fri, 10 May 2024 08:36:37 +0100 Subject: [PATCH] Route email From: *.acm.org via Mailroute. --- pillar/secrets/smtpauth.sls.sample | 9 +++++++++ states/email/exim4.sls | 8 ++++++++ states/email/exim4/update-exim4.conf.conf | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 pillar/secrets/smtpauth.sls.sample diff --git a/pillar/secrets/smtpauth.sls.sample b/pillar/secrets/smtpauth.sls.sample new file mode 100644 index 0000000..72938de --- /dev/null +++ b/pillar/secrets/smtpauth.sls.sample @@ -0,0 +1,9 @@ +smtpauth: + smtpauth_passwd_client: | + # password file used when the local exim is authenticating to a remote + # host as a client. + # + # see exim4_passwd_client(5) for more documentation + # + # Example: + ### target.mail.server.example:login:password diff --git a/states/email/exim4.sls b/states/email/exim4.sls index dde8028..62fbc6e 100644 --- a/states/email/exim4.sls +++ b/states/email/exim4.sls @@ -17,6 +17,14 @@ exim4_certs_group: - addusers: - Debian-exim +exim4_smtpauth_passwd: + file.managed: + - mode: 0640 + - group: Debian-exim + - names: + - /etc/exim4/passwd.client: + - contents_pillar: smtpauth:smtpauth_passwd_client + exim4_dkim_private_keys: file.managed: - mode: 0640 diff --git a/states/email/exim4/update-exim4.conf.conf b/states/email/exim4/update-exim4.conf.conf index 918d448..5e397f1 100644 --- a/states/email/exim4/update-exim4.conf.conf +++ b/states/email/exim4/update-exim4.conf.conf @@ -23,7 +23,7 @@ dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' -dc_smarthost='smtpout.mythic-beasts.com' +dc_smarthost='"${if match{${lc:$header_from:}}{.*acm.org}{smtpauth.mailroute.net::587}{smtpout.mythic-beasts.com}}"' CFILEMODE='644' dc_use_split_config='true' dc_hide_mailname='false'