On 4 Nov 2018, at 8:36, [email protected] wrote:

Author: hege
Date: Sun Nov  4 13:36:22 2018
New Revision: 1845736

URL: http://svn.apache.org/viewvc?rev=1845736&view=rev
Log:
Skip duplicate lookups

I'm uneasy about adding a de facto DNS caching change in 3.4.3. (And generally about apps caching name lookups, but that's a larger discussion...)

Are we absolutely sure that the pms object isn't EVER going to be reused for another message? e.g. in tools like MIMEDefang that spawn long-running workers to handle multiple messages?

Does the duplicate lookup really matter if the system resolver should have the result in a cache that presumably honors TTLs, making replies very fast for queries that should be cached?


Modified:
    spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm

Modified: spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm?rev=1845736&r1=1845735&r2=1845736&view=diff
==============================================================================
--- spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm (original) +++ spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm Sun Nov 4 13:36:22 2018
@@ -1059,6 +1059,10 @@ sub lookup_dnsbl_for_ip {
 sub lookup_single_dnsbl {
   my ($self, $pms, $obj, $rulename, $lookupstr, $dnsbl, $qtype) = @_;

+  my $qkey = "$rulename:$lookupstr:$dnsbl:$qtype";
+  return if exists $pms->{uridnsbl_seen_lookups}{$qkey};
+  $pms->{uridnsbl_seen_lookups}{$qkey} = 1;
+
   my $key = "DNSBL:" . $lookupstr . ':' . $dnsbl;
   my $ent = {
     key => $key, zone => $dnsbl, obj => $obj, type => 'URI-DNSBL',


--
Bill Cole

Reply via email to