cd /root
wget http://files1.directadmin.com/services/custombuild/patches/dns_resolver.patch
patch -p0 < dns_resolver.patch
###################################below
[root@user SpamAssassin]# cat dns_resolver.patch
--- spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm 2014/06/18 16:47:04 1603517
+++ spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm 2014/06/18 16:48:04 1603518
@@ -204,8 +204,10 @@
@ns_addr_port = @{$self->{conf}->{dns_servers}};
dbg("dns: servers set by config to: %s", join(', ',@ns_addr_port));
} elsif ($res) { # default as provided by Net::DNS, e.g. /etc/resolv.conf
- @ns_addr_port = map(untaint_var("[$_]:" . $res->{port}),
- @{$res->{nameservers}});
+ my @ns = $res->UNIVERSAL::can('nameservers') ? $res->nameservers
+ : @{$res->{nameservers}};
+ my $port = $res->UNIVERSAL::can('port') ? $res->port : $res->{port};
+ @ns_addr_port = map(untaint_var("[$_]:" . $port), @ns);
dbg("dns: servers obtained from Net::DNS : %s", join(', ',@ns_addr_port));
}
return @ns_addr_port;
阅读(964) | 评论(0) | 转发(0) |