You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2022/10/15 12:19:43 UTC

svn commit: r1904598 - /spamassassin/trunk/lib/Mail/SpamAssassin/AsyncLoop.pm

Author: hege
Date: Sat Oct 15 12:19:43 2022
New Revision: 1904598

URL: http://svn.apache.org/viewvc?rev=1904598&view=rev
Log:
Add missing debug logging for all rules in blocked DNS query, previously only first rule was logged.
(consider this safe and trivial enough to commit without voting)

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/AsyncLoop.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/AsyncLoop.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/AsyncLoop.pm?rev=1904598&r1=1904597&r2=1904598&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/AsyncLoop.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/AsyncLoop.pm Sat Oct 15 12:19:43 2022
@@ -256,8 +256,13 @@ sub bgsend_and_start_lookup {
   $self->{rules_for_key}->{$key}{$_} = 1 foreach (@rulenames);
 
   if ($dns_query_info) {  # DNS query already underway or completed
+    if ($dns_query_info->{blocked}) {
+      dbg("async: blocked by %s: %s, rules: %s", $dns_query_info->{blocked},
+          $dnskey, join(", ", @rulenames));
+      return;
+    }
     my $id = $ent->{id} = $dns_query_info->{id};  # re-use existing query
-    return if !defined $id;  # presumably blocked, or other fatal failure
+    return if !defined $id;  # presumably some fatal failure
     my $id_tail = $id; $id_tail =~ s{^\d+/IN/}{};
     lc($id_tail) eq lc($dnskey)
       or info("async: unmatched id %s, key=%s", $id, $dnskey);
@@ -330,6 +335,7 @@ sub bgsend_and_start_lookup {
     if ($blocked) {
       dbg("async: blocked by %s: %s, rules: %s", $blocked_by, $dnskey,
           join(", ", @rulenames));
+      $dns_query_info->{blocked} = $blocked_by;
     } else {
       dbg("async: launching %s, rules: %s", $dnskey, join(", ", @rulenames));
       $id = $self->{main}->{resolver}->bgsend($domain, $type, $class, sub {