From: Mark Wooding Date: Thu, 16 Jul 2015 20:34:01 +0000 (+0100) Subject: Add warning headers directly. X-Git-Url: https://git.distorted.org.uk/~mdw/exim-config/commitdiff_plain/61295d9c46bb3639fe3140ed645da5313d95e66f Add warning headers directly. This means we have to stop renaming them. But if we don't do this then we can't test the headers in the spam filter. --- diff --git a/base.m4 b/base.m4 index 39e302b..947f52d 100644 --- a/base.m4 +++ b/base.m4 @@ -160,11 +160,10 @@ mail: warn condition = $acl_c_helo_warning !condition = ${if eq{$acl_c_mode}{submission}} !hosts = +allnets - ADD_HEADER(<:X-CONF_header_token-Warning: \ - BADHELO \ - Client's HELO doesn't match its IP address.\n\t\ - helo-name=$sender_helo_name \ - address=$sender_host_address:>) + WARNING_HEADER(BADHELO, + <:Client's HELO doesn't match its IP address.\n\t\ + helo-name=$sender_helo_name \ + address=$sender_host_address:>) ## Always allow the empty sender, so that we can receive bounces. accept senders = : diff --git a/defs.m4 b/defs.m4 index 30d3fe9..69aa7b7 100644 --- a/defs.m4 +++ b/defs.m4 @@ -136,6 +136,12 @@ FOREACH(<:\ m4_define(<:RENAME_HEADERS_REMOVE:>, <:m4_dnl CLRSEP<::>FOREACH(<:SEP(:)$:><:1:>, <:$1:>):>) +## WARNING_HEADER(tag, msg) +## +## Add a warning header to the current mesage. +m4_define(<:WARNING_HEADER:>, +<:add_header = X-CONF_header_token-Warning: $1 $2:>) + ## LOOKUP_DOMAIN(dom, [if-found], [if-not-found]) ## ## Look up DOM in the master domains file. If it's found, put the diff --git a/exchange.m4 b/exchange.m4 index fe79ce3..b4cb02b 100644 --- a/exchange.m4 +++ b/exchange.m4 @@ -52,12 +52,11 @@ mail_client_addr: {${if match_domain {$sender_address_domain} \ {+public} \ {+allnets}{! +allnets}}})} - ADD_HEADER(<:X-CONF_header_token-Warning: \ - RCLNTLSNDR \ - Apparently local sender, but received from remote \ - server.\n\t\ - sender=$sender_address \ - host=$sender_host_address:>) + WARNING_HEADER(RCLNTLSNDR, + <:Apparently local sender, but received from remote \ + server.\n\t\ + sender=$sender_address \ + host=$sender_host_address:>) ## OK. accept @@ -67,8 +66,7 @@ DIVERT(null) ### Rename locally-meaningful headers in mail from outside. m4_define(<:DISTORTED_HEADERS:>, -<:X-CONF_header_token-Warning, -X-CONF_header_token-SpamAssassin-Score, +<:X-CONF_header_token-SpamAssassin-Score, X-CONF_header_token-SpamAssassin-Status:>) SECTION(acl, data)m4_dnl