|
Line 0
Link Here
|
|
|
1 |
--- lib/Mail/SpamAssassin/DnsResolver.pm-orig 2014-06-20 10:02:34.000000000 +0200 |
| 2 |
+++ lib/Mail/SpamAssassin/DnsResolver.pm 2014-06-20 10:04:20.000000000 +0200 |
| 3 |
@@ -204,8 +204,10 @@ |
| 4 |
@ns_addr_port = @{$self->{conf}->{dns_servers}}; |
| 5 |
dbg("dns: servers set by config to: %s", join(', ',@ns_addr_port)); |
| 6 |
} elsif ($res) { # default as provided by Net::DNS, e.g. /etc/resolv.conf |
| 7 |
- @ns_addr_port = map(untaint_var("[$_]:" . $res->{port}), |
| 8 |
- @{$res->{nameservers}}); |
| 9 |
+ my @ns = $res->UNIVERSAL::can('nameservers') ? $res->nameservers |
| 10 |
+ : @{$res->{nameservers}}; |
| 11 |
+ my $port = $res->UNIVERSAL::can('port') ? $res->port : $res->{port}; |
| 12 |
+ @ns_addr_port = map(untaint_var("[$_]:" . $port), @ns); |
| 13 |
dbg("dns: servers obtained from Net::DNS : %s", join(', ',@ns_addr_port)); |
| 14 |
} |
| 15 |
return @ns_addr_port; |