You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2013/02/01 17:27:50 UTC
svn commit: r1441511 - in /spamassassin/trunk/lib/Mail/SpamAssassin: Conf.pm
DnsResolver.pm
Author: mmartinec
Date: Fri Feb 1 16:27:50 2013
New Revision: 1441511
URL: http://svn.apache.org/viewvc?rev=1441511&view=rev
Log:
documentation detail, debugging detail
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm?rev=1441511&r1=1441510&r2=1441511&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Fri Feb 1 16:27:50 2013
@@ -1785,25 +1785,27 @@ remaining arguments are domains names.
Most DNS queries (with some exceptions) are subject to dns_query_restriction.
A domain to be queried is successively stripped-off of its leading labels
-(thus yielding a series of its parent domains), and on each iterations a
+(thus yielding a series of its parent domains), and on each iteration a
check is made against an associative array generated by dns_query_restriction
-options. Search stops at the first match (i.e. a tightest match), and the
-matching entry with its C<allow> or C<deny> value then controls if a DNS query
-is allowed to be launched.
-
-If no match is found an implicit default is to allow all queries. The purpose
-of an explicit C<allow> entry is to be able to override a previously configured
-C<deny> on the same domain or to override an entry (possibly still to be
-configured) on one of its parent domains. Thus an 'allow zen.spamhaus.org'
-with a 'deny spamhaus.org' would permit DNS queries on a specific DNS BL zone
-but deny queries to other zones under the same parent domain 'spamhaus.org'.
+options. Search stops at the first match (i.e. the tightest match), and the
+matching entry with its C<allow> or C<deny> value then controls whether a
+DNS query is allowed to be launched.
+
+If no match is found an implicit default is to allow a query. The purpose of
+an explicit C<allow> entry is to be able to override a previously configured
+C<deny> on the same domain or to override an entry (possibly yet to be
+configured in subsequent config directives) on one of its parent domains.
+Thus an 'allow zen.spamhaus.org' with a 'deny spamhaus.org' would permit
+DNS queries on a specific DNS BL zone but deny queries to other zones under
+the same parent domain.
Domains are matched case-insensitively, no wildcards are recognized,
there should be no leading or trailing dot.
-Specifying blocked domains has a similar effect as setting a score of such
-rules to zero, and can be a handy alternative to hunting for such rules
-when a site policy does not allow certain DNS block lists to be queried.
+Specifying a block on querying a domain name has a similar effect as setting
+a score of corresponding DNSBL and URIBL rules to zero, and can be a handy
+alternative to hunting for such rules when a site policy does not allow
+certain DNS block lists to be queried.
Example:
dns_query_restriction deny dnswl.org surbl.org
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm?rev=1441511&r1=1441510&r2=1441511&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm Fri Feb 1 16:27:50 2013
@@ -750,16 +750,22 @@ sub poll_responses {
} else {
my $rcode = $header->rcode;
my $packet_id = $header->id;
- if ($rcode ne 'NOERROR') {
- # some failure, e.g. NXDOMAIN, SERVFAIL, FORMERR, REFUSED, ...
+ if ($rcode eq 'NOERROR') { # success
+ # NOERROR, may or may not have answer records
+ dbg("dns: dns response %s is OK, %d answer records",
+ $packet_id, $header->ancount);
+ } elsif ($rcode eq 'NXDOMAIN') { # fairly common, no big deal
# NOTE: qname is encoded in RFC 1035 zone format, decode it
dbg("dns: dns response %s, %s, %s", $packet_id, $rcode,
join(', ', map(join('/', fmt_dns_question_entry($_)),
$packet->question)));
} else {
- # NOERROR, may or may not have answer records
- dbg("dns: dns response %s is OK, %d answer records",
- $packet_id, $header->ancount);
+ # some failure, e.g. SERVFAIL, FORMERR, REFUSED, ...
+ # btw, one reason for SERVFAIL is an RR signature failure in DNSSEC
+ # NOTE: qname is encoded in RFC 1035 zone format, decode it
+ info("dns: dns response %s, %s, %s", $packet_id, $rcode,
+ join(', ', map(join('/', fmt_dns_question_entry($_)),
+ $packet->question)));
}
my $id = $self->_packet_id($packet);
my $cb = delete $self->{id_to_callback}->{$id};