- ${if exists {CONF_userconf_dir/spam-limit} \
- {${lookup {$local_part_prefix\
- $local_part\
- $local_part_suffix\
- @$domain/\
- $sender_address} \
- nwildlsearch {CONF_userconf_dir/spam-limit} \
- {spam_limit=$value} \
- {}}} \
- {}} \
- ${if exists {CONF_userconf_dir/spam-limit.userv} \
- {${run {timeout 5s -- \
- userv $local_part exim-spam-limit \
- $sender_address \
- $local_part_prefix \
- $local_part \
- $local_part_suffix \
- @$domain} \
- {${if match{$value}{\N^[0-9]+$\N} \
- {spam_limit=$value} \
- {}}} \
- {}}} \
- {}}
+ m4_ifelse(<:$2:>, <::>, <::>, <:$2 \
+ :>)$1:>)
+
+m4_define(<:SPAMLIMIT_LOOKUP:>,
+ <:condition = ${if exists{$1}}
+ SPAMLIMIT_SET(<:${lookup {$2@$3/$4} nwildlsearch {$1} \
+ {SPAMLIMIT_CHECK(<:$value:>)}}:>, <:$5:>):>)
+
+m4_define(<:SPAMLIMIT_USERV:>,
+ <:SPAMLIMIT_SET(<:${run {/usr/bin/timeout 5s \
+ /usr/bin/userv CONF_userv_opts \
+ SHQUOTE($1) exim-spam-limit \
+ SHQUOTE($4) \
+ SHQUOTE($2) SHQUOTE(@$3)} \
+ {SPAMLIMIT_CHECK(<:$value:>)}}:>, <:$5:>):>)
+
+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