eximconf: enable greylisting for users with default options
authorAdam D. Barratt <adam@adam-barratt.org.uk>
Sat, 12 Oct 2019 12:09:07 +0000 (13:09 +0100)
committerAdam D. Barratt <adam@adam-barratt.org.uk>
Sat, 12 Oct 2019 12:09:07 +0000 (13:09 +0100)
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
modules/exim/templates/eximconf.erb

index 10038ad..bb7c756 100644 (file)
@@ -781,7 +781,11 @@ check_recipient:
   defer
     message  = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
     log_message = greylisted.
   defer
     message  = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
     log_message = greylisted.
-    local_parts    = GREYLIST_LOCAL_PARTS
+    condition      = ${if or { \
+                                 {match_local_part{$local_part}{GREYLIST_LOCAL_PARTS}} \
+                                 {HAS_DEFAULT_OPTIONS} \
+                             } \
+                     }
     !senders       = :
     !hosts         = : +debianhosts : WHITELIST : \
                      ${if exists {/etc/greylistd/whitelist-hosts}\
     !senders       = :
     !hosts         = : +debianhosts : WHITELIST : \
                      ${if exists {/etc/greylistd/whitelist-hosts}\
@@ -815,7 +819,11 @@ check_recipient:
     condition      = ${if !eq {$acl_m_prf}{PopconMail}}
     !authenticated = *
     domains        = +handled_domains
     condition      = ${if !eq {$acl_m_prf}{PopconMail}}
     !authenticated = *
     domains        = +handled_domains
-    local_parts    = GREYLIST_LOCAL_PARTS
+    condition      = ${if or { \
+                                 {match_local_part{$local_part}{GREYLIST_LOCAL_PARTS}} \
+                                 {HAS_DEFAULT_OPTIONS} \
+                             } \
+                     }
     set acl_m_pgr  = request=smtpd_access_policy\n\
                      protocol_state=RCPT\n\
                      protocol_name=${uc:$received_protocol}\n\
     set acl_m_pgr  = request=smtpd_access_policy\n\
                      protocol_state=RCPT\n\
                      protocol_name=${uc:$received_protocol}\n\
@@ -840,7 +848,11 @@ check_recipient:
     condition      = ${if !eq {$acl_m_prf}{PopconMail}}
     !authenticated = *
     domains        = +handled_domains
     condition      = ${if !eq {$acl_m_prf}{PopconMail}}
     !authenticated = *
     domains        = +handled_domains
-    local_parts    = GREYLIST_LOCAL_PARTS
+    condition      = ${if or { \
+                                 {match_local_part{$local_part}{GREYLIST_LOCAL_PARTS}} \
+                                 {HAS_DEFAULT_OPTIONS} \
+                             } \
+                     }
     condition      = ${if eq{${uc:${substr_0_7:$acl_m_pgr}}}{PREPEND}}
     message        = ${sg{$acl_m_pgr}{\N^\w+\s*\N}{}}
 
     condition      = ${if eq{${uc:${substr_0_7:$acl_m_pgr}}}{PREPEND}}
     message        = ${sg{$acl_m_pgr}{\N^\w+\s*\N}{}}