From 7b5cedfd910961e70e47ee862ef2d4789bf79d3d Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 23 May 2022 11:48:41 +0100 Subject: [PATCH] Add to known_resenders even if the retry comes from an already known resender Untested. --- include/acl-greylist-sqlite | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/acl-greylist-sqlite b/include/acl-greylist-sqlite index d3ac8e8..4ca2902 100644 --- a/include/acl-greylist-sqlite +++ b/include/acl-greylist-sqlite @@ -52,11 +52,13 @@ greylist_mail: accept hosts = : accept authenticated = * - # Secondly, there's _absolutely_ no point in greylisting mail from - # hosts which are known to resend their mail. Just accept it. - accept condition = ${lookup sqlite {GREYDB SELECT host from resenders \ + # There's _absolutely_ no point in greylisting mail from hosts which are + # known to resend their email. Clear the 'acl_m_greylistreasons' variable + # so that the mail isn't treated as suspicious. + warn condition = ${lookup sqlite {GREYDB SELECT host from resenders \ WHERE helo='${quote_sqlite:$sender_helo_name}' \ AND host='$sender_host_address';} {1}} + set acl_m_greylistreasons = # Generate a hashed 'identity' for the mail, as described above. warn set acl_m_greyident = ${hash{20}{62}{$sender_address$recipients$h_message-id:}} @@ -68,7 +70,8 @@ greylist_mail: WHERE id='${quote_sqlite:$acl_m_greyident}';}{$value}} - # If there's absolutely nothing suspicious about the email, accept it. BUT... + # If there's absolutely nothing suspicious about the email (or if it came from + # a known resender so we wiped the reasons), accept it. BUT... accept condition = ${if eq {$acl_m_greylistreasons}{} {1}} condition = ${if eq {$acl_m_greyexpiry}{} {1}} -- 2.49.0