Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 122373
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: PLOBBES [...] cpan.org
Requestors: gilles.lamiral [...] laposte.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 3.40



Subject: Mail::IMAPClient doesn't work with ipv6 address
Date: Thu, 6 Jul 2017 04:15:28 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Gilles LAMIRAL <gilles.lamiral [...] laposte.net>
Hello Phil, Mail::IMAPClient doesn't work with hostname resolving only in an ipv6 address on standard port 143, or using directly an ipv6 address. The error message is usually "Invalid argument" But it works well when using SSL! The bug fix is quite easy, load IO::Socket::INET6 instead of IO::Socket::INET for all hostnames. Using IO::Socket::INET6 is ok with ipv4 addresses $ diff -u ./perl5/lib/perl5/Mail/IMAPClient.pm.orig ./perl5/lib/perl5/Mail/IMAPClient.pm --- ./perl5/lib/perl5/Mail/IMAPClient.pm.orig 2017-02-03 01:45:40.000000000 +0100 +++ ./perl5/lib/perl5/Mail/IMAPClient.pm 2017-07-06 03:42:35.000000000 +0200 @@ -46,7 +46,7 @@ # modules require(d) during runtime when applicable my %Load_Module = ( "Compress-Zlib" => "Compress::Zlib", - "INET" => "IO::Socket::INET", + "INET" => "IO::Socket::INET6", "SSL" => "IO::Socket::SSL", "UNIX" => "IO::Socket::UNIX", "BodyStructure" => "Mail::IMAPClient::BodyStructure", It begins to be a rough bug since more and more hosts are ipv6 only nowadays. The current workaround is to initiate a IO::Socket::INET6 socket before Mail::IMAPClient it's not very beautiful Don't wait two long, here are the statistic of imapsync Mail::IMAPClient releases usage this year 2017. You see than what you write now will still be used massively in four years (the 2013 3.35 is third, before fourth 3.39)! gilles@ks2:~/imapsync_stats 14$ statistics_Mail_IMAPClient_yearly 2017 3 3.27 4 3.19 7 3.29 10 3.21 13 3.23 23 2.2.9 78 3.28 262 3.25 362 3.34 393 3.32 461 3.31 491 3.30 503 3.33 2384 3.39 3709 3.35 7369 3.37 7738 3.38 Thanks in advance and keep up the good work! -- Au revoir, Gilles Lamiral. France, Baulon (35580) mob 06 19 22 03 54 tel 09 51 84 42 42
Subject: Re: [rt.cpan.org #122373] Mail::IMAPClient doesn't work with ipv6 address
Date: Tue, 18 Sep 2018 09:38:06 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Gilles LAMIRAL <gilles [...] lamiral.info>
Hi Phil, I'm not so sure about this fix... Show quoted text
> $ diff -u ./perl5/lib/perl5/Mail/IMAPClient.pm.orig ./perl5/lib/perl5/Mail/IMAPClient.pm > - "INET" => "IO::Socket::INET", > + "INET" => "IO::Socket::INET6",
-- Au revoir, Gilles Lamiral. France, Baulon (35580) mob 06 19 22 03 54 tel 09 51 84 42 42
CC: ;
Subject: Re: [rt.cpan.org #122373] Mail::IMAPClient doesn't work with ipv6 address
Date: Tue, 18 Sep 2018 10:04:40 +0200
To: Gilles LAMIRAL via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Gilles LAMIRAL via RT (bug-Mail-IMAPClient@rt.cpan.org) [180918 07:38]: Show quoted text
> Queue: Mail-IMAPClient > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=122373 > >
> > - "INET" => "IO::Socket::INET", > > + "INET" => "IO::Socket::INET6",
IO::Socket::IP is used by the main applications. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
CC: DJKERNEN__NO_SOLICITING__ [...] cpan.org
Subject: Re: [rt.cpan.org #122373] Mail::IMAPClient doesn't work with ipv6 address
Date: Tue, 18 Sep 2018 18:32:40 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Gilles LAMIRAL <gilles [...] lamiral.info>
Hi Mark, Thanks! You mean the one line use IO::Socket::IP is the way to go to have both ipv4 and ipv6 well supported in a script? Le 18/09/2018 à 10:21, Mark Overmeer via RT a écrit : Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=122373 > > > * Gilles LAMIRAL via RT (bug-Mail-IMAPClient@rt.cpan.org) [180918 07:38]:
>> Queue: Mail-IMAPClient >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=122373 > >>
>>> - "INET" => "IO::Socket::INET", >>> + "INET" => "IO::Socket::INET6",
> > IO::Socket::IP is used by the main applications. >
-- Au revoir, Gilles Lamiral. France, Baulon (35580) mob 06 19 22 03 54 tel 09 51 84 42 42
CC: ;
Subject: Re: [rt.cpan.org #122373] Mail::IMAPClient doesn't work with ipv6 address
Date: Wed, 19 Sep 2018 10:14:45 +0200
To: Gilles LAMIRAL via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Gilles LAMIRAL via RT (bug-Mail-IMAPClient@rt.cpan.org) [180918 16:33]: Show quoted text
> Queue: Mail-IMAPClient > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=122373 > > > You mean the one line > use IO::Socket::IP > > is the way to go to have both ipv4 and ipv6 well supported in a script?
RTFM, Yes. See the reverse dependencies at https://metacpan.org/requires/module/IO::Socket::IP?sort=[[2,1]] It is the module of choice for Mojolicious, MongoDB, Net::DNS, and many more. -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
I've added support for IPv6 by attempting to use IO::Socket::IP if available first before falling back to IO::Socket::INET. I'm hopeful that this is OK for 99.999% of all Mail::IMAPClient users out there if not all of them. The code change has been pushed out to sourceforge and github as a beta release - 3.40_02. Please give this a shot and let me know if this causes any problems for you. If all goes well, this could become the 3.40 release.
Subject: Re: [rt.cpan.org #122373] Mail::IMAPClient doesn't work with ipv6 address
Date: Mon, 22 Oct 2018 16:09:20 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org, gilles.lamiral [...] laposte.net
From: Gilles LAMIRAL <gilles [...] lamiral.info>
Hello Mark and Phil, Show quoted text
>> You mean the use of IO::Socket::IP >> is the way to go to have both ipv4 and ipv6 well supported in a script?
> > RTFM, Yes. > See the reverse dependencies at https://metacpan.org/requires/module/IO::Socket::IP?sort=[[2,1]] > It is the module of choice for Mojolicious, MongoDB, Net::DNS, and many > more.
So let's go for IO-Socket-IP in Mail::IMAPClient! -- Au revoir, Gilles Lamiral. France, Baulon (35580) mob 06 19 22 03 54 tel 09 51 84 42 42
Release 3.40 is out with the fix for this issue.
Subject: Re: [rt.cpan.org #122373] Mail::IMAPClient-3.40 new() + connect() => die
Date: Fri, 4 Jan 2019 01:18:43 +0100
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Gilles LAMIRAL <gilles [...] lamiral.info>
Hi Phil, I checked Mail::IMAPClient 3.40 over imapsync regression tests. It fails badly on a simple one. Badly because the calling program dies while it doesn't deserve such a harsh way out. It's a regression, 3.39 is ok with that. I understand it's not Mail::IMAPClient fault, the die doesn't come from it but the fix is easy to avoid that killer behavior. Thanks in advance! Here is an example called bug_Mail-IMAPClient-3.40_connect: #!/usr/bin/perl use strict ; use warnings ; use Mail::IMAPClient ; my $imap = Mail::IMAPClient->new( ) ; $imap->connect( ) ; print "I hope I'm not dead but...\n" ; Now the use of it, with both 3.40 and 3.39: $ perl -I../Mail-IMAPClient-3.40/lib/ bug_Mail-IMAPClient-3.40_connect Use of uninitialized value $sockargs[1] in join or string at ../Mail-IMAPClient-3.40/lib/Mail/IMAPClient.pm line 362. Expected 'PeerHost' at ../Mail-IMAPClient-3.40/lib/Mail/IMAPClient.pm line 363. $ perl -I../Mail-IMAPClient-3.39/lib/ bug_Mail-IMAPClient-3.40_connect Use of uninitialized value $sockargs[1] in join or string at ../Mail-IMAPClient-3.39/lib/Mail/IMAPClient.pm line 360. Use of uninitialized value $server in concatenation (.) or string at ../Mail-IMAPClient-3.39/lib/Mail/IMAPClient.pm line 365. I hope I'm not dead but... -- Au revoir, Gilles Lamiral. France, Baulon (35580) mob 06 19 22 03 54 tel 09 51 84 42 42
I think I have a reasonable workaround for connect(): - my $server = $self->Server; + # if no server, use " " to induce a non-fatal error + my $server = $self->Server || " "; I also have created a few tests. I'll commit in a bit and have that in the next release. Thanks for the report! FWIW, it's probably best to open a new ticket once things like this make it into a release for better tracking, but I understand it was probably easiest to just comment on the original ticket.
Subject: Re: [rt.cpan.org #122373] Mail::IMAPClient doesn't work with ipv6 address
Date: Fri, 4 Jan 2019 13:24:59 +0100
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Gilles LAMIRAL <gilles [...] lamiral.info>
Hi Phil, Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=122373 > > > I think I have a reasonable workaround for connect():
Thanks! I guess we could search and report to the criminal who kills us by a simple call but I'm lazy... Show quoted text
> FWIW, it's probably best to open a new ticket once things like this make it into a release for better tracking, > but I understand it was probably easiest to just comment on the original ticket.
I'll do that! -- Au revoir, Gilles Lamiral. France, Baulon (35580) mob 06 19 22 03 54 tel 09 51 84 42 42