From 043a914faccd94618840dae1c66ff48b1ed3ac80 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 23 Mar 2016 22:19:16 +0000 Subject: [PATCH] spam.m4: Capture extracting a field from `$address_data' in a macro. This makes things a little easier to read anyway, and we're going to be doing this more soon. --- spam.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spam.m4 b/spam.m4 index 18e4d17..14596b4 100644 --- a/spam.m4 +++ b/spam.m4 @@ -64,6 +64,9 @@ m4_define(<:SPAMLIMIT_USERV:>, SHQUOTE($2) SHQUOTE(@$3)} \ {SPAMLIMIT_CHECK($value)}}:>):>) +m4_define(<:GET_ADDRDATA:>, + <:extract{<:$1:>}{${if def:address_data{$address_data}{}}}:>) + SECTION(global, policy)m4_dnl spamd_address = CONF_spamd_address CONF_spamd_port @@ -113,10 +116,7 @@ rcpt_spam: ## during recipient verification. (This just saves duplicating this ## enormous expression.) warn set acl_m_this_spam_limit = \ - ${sg {${extract {spam_limit} \ - {${if def:address_data \ - {$address_data}{}}} \ - {$value}{nil}}} \ + ${sg {${GET_ADDRDATA(spam_limit){$value}{nil}}} \ {^(|.*\\D.*)\$}{CONF_spam_max}} ## If there's a spam limit already established, and it's different -- 2.11.0