summaryrefslogtreecommitdiff
path: root/cpan/libnet/lib/Net/POP3.pm
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2015-07-19 12:01:48 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2015-07-19 12:01:48 +0100
commitdb95646430f250935e9615b04eecb9c0d138c515 (patch)
treee0e92d97f92e7809cdc59dcb37c5bf90206fd6ef /cpan/libnet/lib/Net/POP3.pm
parent4d5d35d9def298c0adab2e34a187efa998cea923 (diff)
downloadperl-db95646430f250935e9615b04eecb9c0d138c515.tar.gz
Update libnet to CPAN version 3.07
[DELTA] 3.07 2015-07-17 - Net::FTP::rmdir() has been made more robust by making use of the MLSD command in addition to the NLST command since the latter is known not to be processed correctly by some FTP servers. [Chris Lindee, CPAN RT#100694] - Net::FTP, Net::NNTP, Net::POP3 and Net::SMTP can now restrict domain to IPv4 even if IPv6 is available by using the new Domain or Family argument. Net::NNTP now supports the LocalPort argument in addition to LocalAddr. Net::POP3 now supports the LocalAddr and LocalPort arguments in addition to ResvPort (which is retained for backwards compatibility). [Steffen Ullrich, PR#18] - Fixed a bug in Net::Cmd::datasend() which caused octets in [\x80-\xFF] stored in a "binary string" to be replaced with their UTF-8 encodings if the string happened to be stored internally in an "upgraded" state (i.e. with the UTF-8 flag on). (As noted below, strings passed to datasend() should always be encoded first, and therefore not stored in such a state anyway, but it is all too easy for perl to change this internal state unless the encodeing is done at the very last minute before calling datasend(), so it helps if datasend() plays more nicely in this case. In particular, it was wrong of datasend() to treat upgraded and downgraded strings differently when their contents were identical at the Perl level.) This bugfix results in a breaking change to the case of a "text string" with characters in U+0080..U+00FF stored internally in an upgraded state since those characters are likewise no longer encoded to UTF-8 by datasend(), but callers of datasend() should not have been relying on this behaviour anyway: In general, datasend() has no idea what encoding is required for output so callers should always encode the data to be output to whatever encoding is required first. This has now been clarified in the documentation. Finally, a text string with characters >= U+0100 will now cause a "Wide character in print" warning from datasend() since such characters cannot be output as bytes and datasend() no longer encodes to UTF-8. In this case, UTF-8 bytes will still be output as before since that happens to be the internal representation of such characters, but the warning is new. Callers should heed this warning and encode such strings to whatever encoding is required before calling datasend(), as noted above. [Ricardo Signes, CPAN RT#104433]
Diffstat (limited to 'cpan/libnet/lib/Net/POP3.pm')
-rw-r--r--cpan/libnet/lib/Net/POP3.pm33
1 files changed, 23 insertions, 10 deletions
diff --git a/cpan/libnet/lib/Net/POP3.pm b/cpan/libnet/lib/Net/POP3.pm
index 2c38819f98..791b1d28d5 100644
--- a/cpan/libnet/lib/Net/POP3.pm
+++ b/cpan/libnet/lib/Net/POP3.pm
@@ -2,7 +2,7 @@
#
# Versions up to 2.29 Copyright (c) 1995-2004 Graham Barr <gbarr@pobox.com>.
# All rights reserved.
-# Changes in Version 2.29_01 onwards Copyright (C) 2013-2014 Steve Hay. All
+# Changes in Version 2.29_01 onwards Copyright (C) 2013-2015 Steve Hay. All
# rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
@@ -20,7 +20,7 @@ use IO::Socket;
use Net::Cmd;
use Net::Config;
-our $VERSION = "3.06";
+our $VERSION = "3.07";
# Code for detecting if we can use SSL
my $ssl_class = eval {
@@ -34,16 +34,19 @@ my $nossl_warn = !$ssl_class &&
'To use SSL please install IO::Socket::SSL with version>=2.007';
# Code for detecting if we can use IPv6
+my $family_key = 'Domain';
my $inet6_class = eval {
require IO::Socket::IP;
no warnings 'numeric';
- IO::Socket::IP->VERSION(0.20);
+ IO::Socket::IP->VERSION(0.20) || die;
+ $family_key = 'Family';
} && 'IO::Socket::IP' || eval {
require IO::Socket::INET6;
no warnings 'numeric';
IO::Socket::INET6->VERSION(2.62);
} && 'IO::Socket::INET6';
+
sub can_ssl { $ssl_class };
sub can_inet6 { $inet6_class };
@@ -63,7 +66,6 @@ sub new {
}
my $hosts = defined $host ? [$host] : $NetConfig{pop3_hosts};
my $obj;
- my @localport = exists $arg{ResvPort} ? (LocalPort => $arg{ResvPort}) : ();
if ($arg{SSL}) {
# SSL from start
@@ -78,7 +80,9 @@ sub new {
PeerAddr => ($host = $h),
PeerPort => $arg{Port} || 'pop3(110)',
Proto => 'tcp',
- @localport,
+ $family_key => $arg{Domain} || $arg{Family},
+ LocalAddr => $arg{LocalAddr},
+ LocalPort => exists($arg{ResvPort}) ? $arg{ResvPort} : $arg{LocalPort},
Timeout => $arg{Timeout},
)
and last;
@@ -623,12 +627,16 @@ Net::POP3 - Post Office Protocol 3 Client class (RFC1939)
This module implements a client interface to the POP3 protocol, enabling
a perl5 application to talk to POP3 servers. This documentation assumes
that you are familiar with the POP3 protocol described in RFC1939.
+With L<IO::Socket::SSL> installed it also provides support for implicit and
+explicit TLS encryption, i.e. POP3S or POP3+STARTTLS.
A new Net::POP3 object must be created with the I<new> method. Once
this has been done, all POP3 commands are accessed via method calls
on the object.
-The Net::POP3 class is a subclass of Net::Cmd and IO::Socket::INET.
+The Net::POP3 class is a subclass of Net::Cmd and (depending on avaibility) of
+IO::Socket::IP, IO::Socket::INET6 or IO::Socket::INET.
+
=head1 CONSTRUCTOR
@@ -659,9 +667,14 @@ upgrade with C<starttls>.
You can use SSL arguments as documented in L<IO::Socket::SSL>, but it will
usually use the right arguments already.
-B<ResvPort> - If given then the socket for the C<Net::POP3> object
-will be bound to the local port given using C<bind> when the socket is
-created.
+B<LocalAddr> and B<LocalPort> - These parameters are passed directly
+to IO::Socket to allow binding the socket to a specific local address and port.
+For compatibility with older versions B<ResvPort> can be used instead of
+B<LocalPort>.
+
+B<Domain> - This parameter is passed directly to IO::Socket and makes it
+possible to enforce IPv4 connections even if L<IO::Socket::IP> is used as super
+class. Alternatively B<Family> can be used.
B<Timeout> - Maximum time, in seconds, to wait for a response from the
POP3 server (default: 120)
@@ -840,7 +853,7 @@ Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
=head1 COPYRIGHT
Versions up to 2.29 Copyright (c) 1995-2004 Graham Barr. All rights reserved.
-Changes in Version 2.29_01 onwards Copyright (C) 2013-2014 Steve Hay. All
+Changes in Version 2.29_01 onwards Copyright (C) 2013-2015 Steve Hay. All
rights reserved.
This module is free software; you can redistribute it and/or modify it under the