From c439a7fadf50fa32622aec37a5dab0f98bcdec76 Mon Sep 17 00:00:00 2001 From: Phil Pennock Date: Wed, 26 Jan 2022 01:22:46 -0500 Subject: [PATCH] Replace IO::Socket::INET6 with IO::Socket::IP @dbevans points out that `IO::Socket::INET6` is deprecated. The `IO::Socket::IP` constructor is mostly compatible; the one thing it usually ignores is `MultiHomed`, but that's because the module is always doing the right thing anyway without my needing to ask for the right thing. This has seen light testing in my own setup. Fixes #16 --- sieve-connect.pre.pl | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sieve-connect.pre.pl b/sieve-connect.pre.pl index 902c60c..fa4ea8a 100755 --- sieve-connect.pl +++ sieve-connect.pl @@ -110,7 +110,7 @@ use File::Temp qw/ tempfile /; use Getopt::Long; use IO::File; -use IO::Socket::INET6; +use IO::Socket::IP; use IO::Socket::SSL 1.14; # first version with automatic verification use MIME::Base64; use Net::DNS; @@ -157,7 +157,7 @@ sub do_version_display { foreach my $mod ( 'Authen::SASL', 'Authen::SASL::Perl', - 'IO::Socket::INET6', + 'IO::Socket::IP', 'IO::Socket::SSL', 'Mozilla::PublicSuffix', 'Net::DNS', @@ -445,12 +445,11 @@ sub do_version_display { } debug "connection: trying <${debug_host}:${port_candidate}>$debug_extra"; - my $s = IO::Socket::INET6->new( + my $s = IO::Socket::IP->new( PeerHost => $host_candidate, PeerPort => $port_candidate, Proto => 'tcp', Domain => $net_domain, - MultiHomed => 1, # try multiple IPs (IPv4 works, v6 doesn't?) ); unless (defined $s) { my $extra = ''; @@ -2583,10 +2582,6 @@ =head1 BUGS even though the results are defined as line-break separated -- that would mean that some linebreaks are special. Hopefully no server will do this. -If B fails to connect to an IPv4 server without the B<-4> -option being explicitly passed, then you've encountered a portability -issue in the F Perl library and need to upgrade that. - Most historical implementations used port 2000 for ManageSieve. RFC5804 allocates port 4190. This tool uses a port-spec of "sieve(4190)" as the default port, which means that an F (or substitute) entry for @@ -2667,7 +2662,7 @@ =head1 AVAILABILITY =head1 PREREQUISITES -Perl. F. F. +Perl. F. F. F (at least version 1.14). F. F for SRV lookup. F for built-in man command (optional).