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