SOURCES: spamassassin-bug-4619.patch (NEW) - add fix for ipv6 disa...
glen
glen at pld-linux.org
Sun Oct 16 14:24:08 CEST 2005
Author: glen Date: Sun Oct 16 12:24:08 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- add fix for ipv6 disabled in kernel
---- Files affected:
SOURCES:
spamassassin-bug-4619.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/spamassassin-bug-4619.patch
diff -u /dev/null SOURCES/spamassassin-bug-4619.patch:1.1
--- /dev/null Sun Oct 16 14:24:08 2005
+++ SOURCES/spamassassin-bug-4619.patch Sun Oct 16 14:24:02 2005
@@ -0,0 +1,191 @@
+Index: lib/Mail/SpamAssassin.pm
+===================================================================
+--- lib/Mail/SpamAssassin.pm (revision 322461)
++++ lib/Mail/SpamAssassin.pm (working copy)
+@@ -206,6 +206,11 @@
+ override the settings for C<rules_filename>, C<site_rules_filename>,
+ and C<userprefs_filename>.
+
++=item force_ipv4
++
++If set to 1, DNS tests will not attempt to use IPv6. Use if the existing tests
++for IPv6 availablity produce incorrect results or crashes.
++
+ =item languages_filename
+
+ If you want to be able to use the language-guessing rule
+Index: lib/Mail/SpamAssassin/DnsResolver.pm
+===================================================================
+--- lib/Mail/SpamAssassin/DnsResolver.pm (revision 322461)
++++ lib/Mail/SpamAssassin/DnsResolver.pm (working copy)
+@@ -44,7 +44,7 @@
+ use IO::Socket::INET;
+ use Errno qw(EINVAL EADDRINUSE);
+
+-use constant HAS_SOCKET_INET6 => eval { require IO::Socket::INET6 };
++use constant HAS_SOCKET_INET6 => eval { require IO::Socket::INET6; defined AF_INET6 };
+
+ our @ISA = qw();
+
+@@ -81,13 +81,26 @@
+
+ if (defined $self->{res}) { return 1; }
+ $self->{no_resolver} = 1;
+-
++ # force only ipv4 if no IO::Socket::INET6 or ipv6 doesn't work
++ my $force_ipv4 = (!HAS_SOCKET_INET6) || $self->{main}->{force_ipv4} ||
++ !eval {
++ my $sock6 = IO::Socket::INET6->new(
++ LocalAddr => "::",
++ Proto => 'udp',
++ );
++ if ($sock6) {
++ $sock6->close();
++ 1;
++ }
++ };
++
+ eval {
+ require Net::DNS;
+ $self->{res} = Net::DNS::Resolver->new;
+ if (defined $self->{res}) {
+ $self->{no_resolver} = 0;
+- $self->{retry} = 1; # retries for non-nackgrounded query
++ $self->{force_ipv4} = $force_ipv4;
++ $self->{retry} = 1; # retries for non-backgrounded query
+ $self->{retrans} = 3; # initial timeout for "non-backgrounded" query run in background
+ $self->{res}->retry(1); # If it fails, it fails
+ $self->{res}->retrans(0); # If it fails, it fails
+@@ -97,10 +110,12 @@
+ $self->{res}->udp_timeout(3); # timeout of 3 seconds only
+ $self->{res}->persistent_tcp(0); # bug 3997
+ $self->{res}->persistent_udp(0); # bug 3997
++ $self->{res}->force_v4($force_ipv4);
+ }
+ 1;
+ }; # or warn "dns: eval failed: $@ $!\n";
+
++ dbg("dns: no ipv6") if $force_ipv4;
+ dbg("dns: is Net::DNS::Resolver available? " .
+ ($self->{no_resolver} ? "no" : "yes"));
+ if (!$self->{no_resolver} && defined $Net::DNS::VERSION) {
+@@ -123,7 +138,7 @@
+
+ =item $res->nameservers()
+
+-Wrapper for Net::DNS::Reslolver->nameservers to get or set list of nameservers
++Wrapper for Net::DNS::Resolver->nameservers to get or set list of nameservers
+
+ =cut
+
+@@ -156,13 +171,14 @@
+ my $ip64 = IP_ADDRESS;
+ my $ip4 = IPV4_ADDRESS;
+ my $ns = $self->{res}->{nameservers}[0];
+- my $ipv6 = 0;
++ my $ipv6 = 0; # this will be set if we have an ipv6 nameserver
++ my $ipv6opt = !($self->{force_ipv4});
+
+ # now, attempt to set the family to AF_INET6 if we can. Some
+ # platforms don't have it (bug 4412 comment 29)...
+ # also, only set $ipv6 to true if that succeeds.
+ my $family;
+- if (HAS_SOCKET_INET6 && $ns=~/^${ip64}$/o && $ns!~/^${ip4}$/o) {
++ if ($ipv6opt && $ns=~/^${ip64}$/o && $ns!~/^${ip4}$/o) {
+ eval '$family = AF_INET6; $ipv6 = 1;';
+ }
+ if (!defined $family) {
+@@ -186,7 +202,7 @@
+ Domain => $family,
+ );
+
+- if (HAS_SOCKET_INET6) {
++ if ($ipv6opt) {
+ $sock = IO::Socket::INET6->new(%args);
+ } else {
+ $sock = IO::Socket::INET->new(%args);
+Index: lib/spamassassin-run.pod
+===================================================================
+--- lib/spamassassin-run.pod (revision 322461)
++++ lib/spamassassin-run.pod (working copy)
+@@ -59,6 +59,7 @@
+ --add-addr-to-whitelist=addr Add addr to persistent address whitelist
+ --add-addr-to-blacklist=addr Add addr to persistent address blacklist
+ --remove-addr-from-whitelist=addr Remove addr from persistent address list
++ --ipv4only, --ipv4-only, --ipv4 Disable attempted use of ipv6 for DNS
+ --progress Print progress bar
+ -D, --debug [area=n,...] Print debugging messages
+ -V, --version Print version
+@@ -198,6 +199,12 @@
+ you must be running C<spamassassin> or C<spamd> with a persistent address
+ list plugin enabled for this to work.
+
++=item B< --ipv4only>, B<--ipv4-only>, B<--ipv4>
++
++Do not use IPv6 for DNS tests. Normally, SpamAssassin will try to detect if
++IPv6 is available, using only IPv4 if it is not. Use if the existing tests
++for IPv6 availablity produce incorrect results or crashes.
++
+ =item B<-L>, B<--local>
+
+ Do only the ''local'' tests, ones that do not require an internet connection to
+Index: spamassassin.raw
+===================================================================
+--- spamassassin.raw (revision 322461)
++++ spamassassin.raw (working copy)
+@@ -175,6 +175,7 @@
+ 'debug|D:s' => \$opt{'debug'},
+ 'error-code|exit-code|e:i' => \$opt{'error-code'},
+ 'help|h|?' => \$opt{'help'},
++ 'ipv4only|ipv4-only|ipv4' => \$opt{'force_ipv4'},
+ 'lint' => \$opt{'lint'},
+ 'local-only|local|L' => \$opt{'local'},
+ 'mbox' => sub { $opt{'format'} = 'mbox'; },
+@@ -240,6 +241,7 @@
+ rules_filename => $opt{'configpath'},
+ site_rules_filename => $opt{'siteconfigpath'},
+ userprefs_filename => $opt{'prefspath'},
++ force_ipv4 => $opt{'force_ipv4'},
+ local_tests_only => $opt{'local'},
+ debug => $opt{'debug'},
+ dont_copy_prefs => ( $opt{'create-prefs'} ? 0 : 1 ),
+Index: spamd/spamd.raw
+===================================================================
+--- spamd/spamd.raw (revision 322461)
++++ spamd/spamd.raw (working copy)
+@@ -166,6 +166,7 @@
+ 'helper-home-dir|H:s' => \$opt{'home_dir_for_helpers'},
+ 'help|h' => \$opt{'help'},
+ 'ident-timeout=f' => \$opt{'ident-timeout'},
++ 'ipv4only|ipv4-only|ipv4' => \$opt{'force_ipv4'},
+ 'ldap-config!' => \$opt{'ldap-config'},
+ 'listen-ip|ip-address|i:s' => \$opt{'listen-ip'},
+ 'local!' => \$opt{'local'},
+@@ -685,6 +686,7 @@
+ dont_copy_prefs => $dontcopy,
+ rules_filename => ( $opt{'configpath'} || 0 ),
+ site_rules_filename => ( $opt{'siteconfigpath'} || 0 ),
++ force_ipv4 => ( $opt{'force_ipv4'} || 0 ),
+ local_tests_only => ( $opt{'local'} || 0 ),
+ debug => ( $opt{'debug'} || 0 ),
+ paranoid => ( $opt{'paranoid'} || 0 ),
+@@ -2181,6 +2183,7 @@
+ -d, --daemonize Daemonize
+ -h, --help Print usage message.
+ -i [ipaddr], --listen-ip=ipaddr Listen on the IP ipaddr
++ --ipv4only, --ipv4-only, --ipv4 Disable attempted use of ipv6 for DNS
+ -p port, --port=port Listen on specified port
+ -m num, --max-children=num Allow maximum num children
+ --min-children=num Allow minimum num children
+@@ -2499,6 +2502,11 @@
+ Higher priority informational messages that are suitable for logging in normal
+ circumstances are available with an area of "info".
+
++=item B< --ipv4only>, B<--ipv4-only>, B<--ipv4>
++
++Do not use IPv6 for DNS tests. Use if the existing tests
++for IPv6 availablity produce incorrect results or crashes.
++
+ =item B<-L>, B<--local>
+
+ Perform only local tests on all mail. In other words, skip DNS and other
================================================================
More information about the pld-cvs-commit
mailing list