Bug 7476 - SpamAssassin/DnsResolver.pm doesn't set recursion desired on DNS requests with newer Perl Net-DNS
Summary: SpamAssassin/DnsResolver.pm doesn't set recursion desired on DNS requests wit...
Status: RESOLVED DUPLICATE of bug 7223
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 3.4.1
Hardware: PC Linux
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
Depends on:
Reported: 2017-10-10 21:17 UTC by Ralf Friedl
Modified: 2017-10-11 01:56 UTC (History)
1 user (show)

Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Friedl 2017-10-10 21:17:43 UTC
I have SpamAssassin 3.4.1.

SpamAssassin/DnsResolver.pm:577 creates a new DNS request by calling Net::DNS::Packet->new().

Somewhere between http://cpansearch.perl.org/src/NLNETLABS/Net-DNS-0.83/lib/Net/DNS/Packet.pm and http://cpansearch.perl.org/src/NLNETLABS/Net-DNS-1.01/lib/Net/DNS/Packet.pm Net::DNS::Packet->new() was changed to no longer set recursion desired in the DNS request. As a result, SpamAssassin sends the DNS requests and waits for the answers, but the answers don't have a response, because recursion desired is not set.

This can be fixed by this patch. With older Net-DNS it is not necessary, but it doesn't hurt.
--- Mail/SpamAssassin/DnsResolver.pm
+++ Mail/SpamAssassin/DnsResolver.pm
@@ -575,6 +575,7 @@
                 { $1 eq '\\' ? "\\$1" : sprintf("\\%03d",ord($1)) }xgse;
     $packet = Net::DNS::Packet->new($domain, $type, $class);
+    $packet->header->rd (1);
     # a bit noisy, so commented by default...
     #dbg("dns: new DNS packet time=%.3f domain=%s type=%s id=%s",
Comment 1 Bill Cole 2017-10-11 01:56:06 UTC
Duplicate of Bug #7223. Fixed in both the current trunk (4.x-to-be) and the 3.4 branch (soon to be released as 3.4.2.)

*** This bug has been marked as a duplicate of bug 7223 ***