diff -Nru libnet-imap-client-perl-0.9505/Changes libnet-imap-client-perl-0.9507/Changes --- libnet-imap-client-perl-0.9505/Changes 2014-01-18 14:09:06.000000000 +0000 +++ libnet-imap-client-perl-0.9507/Changes 2023-02-05 23:25:13.000000000 +0000 @@ -1,5 +1,39 @@ Revision history for Net-IMAP-Client +0.9507 Apr 22, 2016 + + - avoid uninitialized warning (fixes RT#98616) + - avoid null args in search (fixes RT#113816) + - DESTROY() preserves $@ + - add missing whatis entry (fixes RT#97513) + +0.9506 July 23, 2014 + + - check for Red Hat certs directory location + +0.9505 July 23, 2014 + + - check for existence of SSL cert directory and throw exception if it is not found + +0.9504 Jan 19, 2014 + + - don't quote $charset var (fixes RT#77372, Broken SORT) + +0.9503 Jan 18, 2014 + + - search command discards in-progress messages (fixes RT#84623) + - add 'ssl_options' argument (fixes RT#84309) + +0.9502 Jan 18, 2014 + + - fix Net::Socket::SSL deprecated call warning by add some constructor arguments + +0.9501 Aug 7, 2011 + + - search() method: Don't quote UID criteria (fixes RT#46245) + - fix synopsis: search() method returns array reference (fixes RT #69464) + + 0.95 Apr 9, 2011 - fix #48163 error after logout diff -Nru libnet-imap-client-perl-0.9505/debian/changelog libnet-imap-client-perl-0.9507/debian/changelog --- libnet-imap-client-perl-0.9505/debian/changelog 2022-06-16 15:40:58.000000000 +0000 +++ libnet-imap-client-perl-0.9507/debian/changelog 2023-02-07 21:10:11.000000000 +0000 @@ -1,3 +1,14 @@ +libnet-imap-client-perl (0.9507-1) unstable; urgency=medium + + * Import upstream version 0.9507. + * Drop fix-pod.patch, applied upstream. + * Update years of packaging copyright. + * Declare compliance with Debian Policy 4.6.2. + * Set Rules-Requires-Root: no. + * Annotate test-only build dependencies with . + + -- gregor herrmann Tue, 07 Feb 2023 22:10:11 +0100 + libnet-imap-client-perl (0.9505-2) unstable; urgency=medium [ Salvatore Bonaccorso ] diff -Nru libnet-imap-client-perl-0.9505/debian/control libnet-imap-client-perl-0.9507/debian/control --- libnet-imap-client-perl-0.9505/debian/control 2022-06-16 15:40:58.000000000 +0000 +++ libnet-imap-client-perl-0.9507/debian/control 2023-02-07 21:10:11.000000000 +0000 @@ -6,20 +6,21 @@ Testsuite: autopkgtest-pkg-perl Priority: optional Build-Depends: debhelper-compat (= 13) -Build-Depends-Indep: perl, - libio-socket-ssl-perl, - liblist-moreutils-perl, - libtest-pod-coverage-perl, - libtest-pod-perl -Standards-Version: 3.9.5 +Build-Depends-Indep: libio-socket-ssl-perl , + liblist-moreutils-perl , + libtest-pod-coverage-perl , + libtest-pod-perl , + perl +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libnet-imap-client-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libnet-imap-client-perl.git Homepage: https://metacpan.org/release/Net-IMAP-Client +Rules-Requires-Root: no Package: libnet-imap-client-perl Architecture: all -Depends: ${perl:Depends}, - ${misc:Depends}, +Depends: ${misc:Depends}, + ${perl:Depends}, libio-socket-ssl-perl, liblist-moreutils-perl Description: Perl module to communicate with IMAP servers diff -Nru libnet-imap-client-perl-0.9505/debian/copyright libnet-imap-client-perl-0.9507/debian/copyright --- libnet-imap-client-perl-0.9505/debian/copyright 2022-06-16 15:40:58.000000000 +0000 +++ libnet-imap-client-perl-0.9507/debian/copyright 2023-02-07 21:10:11.000000000 +0000 @@ -12,7 +12,7 @@ 2009, Christoph Berg 2009, Jonathan Yu 2011, Nicholas Bamber - 2011-2014, gregor herrmann + 2011-2023, gregor herrmann 2014, Florian Schlichting License: Artistic or GPL-1+ diff -Nru libnet-imap-client-perl-0.9505/debian/patches/fix-pod.patch libnet-imap-client-perl-0.9507/debian/patches/fix-pod.patch --- libnet-imap-client-perl-0.9505/debian/patches/fix-pod.patch 2022-06-16 15:40:58.000000000 +0000 +++ libnet-imap-client-perl-0.9507/debian/patches/fix-pod.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Description: add missing whatis entry -Author: gregor herrmann -Last-Update: 2014-07-25 -Forwarded: https://rt.cpan.org/Ticket/Display.html?id=97513 -Bug: https://rt.cpan.org/Ticket/Display.html?id=97513 - ---- a/lib/Net/IMAP/Client/MsgAddress.pm -+++ b/lib/Net/IMAP/Client/MsgAddress.pm -@@ -52,7 +52,7 @@ - - =head1 NAME - --Net::IMAP::Client::MsgAddress -+Net::IMAP::Client::MsgAddress - email address object - - =head1 DESCRIPTION - diff -Nru libnet-imap-client-perl-0.9505/debian/patches/series libnet-imap-client-perl-0.9507/debian/patches/series --- libnet-imap-client-perl-0.9505/debian/patches/series 2022-06-16 15:40:58.000000000 +0000 +++ libnet-imap-client-perl-0.9507/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -fix-pod.patch diff -Nru libnet-imap-client-perl-0.9505/lib/Net/IMAP/Client/MsgAddress.pm libnet-imap-client-perl-0.9507/lib/Net/IMAP/Client/MsgAddress.pm --- libnet-imap-client-perl-0.9505/lib/Net/IMAP/Client/MsgAddress.pm 2008-12-03 10:16:15.000000000 +0000 +++ libnet-imap-client-perl-0.9507/lib/Net/IMAP/Client/MsgAddress.pm 2014-07-25 22:30:07.000000000 +0000 @@ -52,7 +52,7 @@ =head1 NAME -Net::IMAP::Client::MsgAddress +Net::IMAP::Client::MsgAddress - email address object =head1 DESCRIPTION diff -Nru libnet-imap-client-perl-0.9505/lib/Net/IMAP/Client.pm libnet-imap-client-perl-0.9507/lib/Net/IMAP/Client.pm --- libnet-imap-client-perl-0.9505/lib/Net/IMAP/Client.pm 2014-07-18 17:36:17.000000000 +0000 +++ libnet-imap-client-perl-0.9507/lib/Net/IMAP/Client.pm 2016-04-22 22:39:25.000000000 +0000 @@ -1,7 +1,7 @@ package Net::IMAP::Client; use vars qw[$VERSION]; -$VERSION = '0.9505'; +$VERSION = '0.9507'; use strict; use warnings; @@ -25,6 +25,7 @@ pass => undef, ssl => 0, ssl_verify_peer => 1, + tls => 0, socket => undef, _cmd_id => 0, ssl_options => {}, @@ -37,17 +38,21 @@ $_ => exists $args{$_} ? $args{$_} : $DEFAULT_ARGS{$_} } keys %DEFAULT_ARGS }; + die "Cannot enable both ssl and tls" if ($self->{tls} and $self->{ssl}); + bless $self, $class; $self->{notifications} = []; eval { - $self->{greeting} = $self->_socket_getline; + $self->_get_socket; # set up the socket }; + return $@ ? undef : $self; } sub DESTROY { my ($self) = @_; + local $@; eval { $self->quit if $self->{socket}->opened; @@ -279,6 +284,22 @@ return undef; } +{ my %no_args = map{ $_, 1} qw( + ALL + ANSWERED + DELETED + DRAFT + FLAGGED + NEW + OLD + RECENT + SEEN + UNANSWERED + UNDELETED + UNDRAFT + UNFLAGGED + UNSEEN + ); sub search { my ($self, $criteria, $sort, $charset) = @_; @@ -301,10 +322,13 @@ if (ref($criteria) eq 'HASH') { my @a; while (my ($key, $val) = each %$criteria) { + $key = uc $key; + push @a, $key; + next if $no_args{$key}; + # don't quote range my $quoted = $val; - # don't quote range - _string_quote($quoted) unless uc $key eq 'UID'; - push @a, uc $key, $quoted; + _string_quote($quoted) unless $key eq 'UID'; + push @a, $quoted; } $criteria = '(' . join(' ', @a) . ')'; } @@ -323,6 +347,7 @@ return undef; } +} sub get_rfc822_body { my ($self, $msg) = @_; @@ -595,6 +620,7 @@ sub last_error { my ($self) = @_; + defined $self->{_error} or return; $self->{_error} =~ s/\s+$//s; # remove trailing carriage return return $self->{_error}; } @@ -635,7 +661,9 @@ my %ssl_config = ( SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_PEER ); if ($^O eq 'linux' && !$self->{ssl_ca_path} && !$self->{ssl_ca_file}) { - $ssl_config{SSL_ca_path} = '/etc/ssl/certs/'; + $ssl_config{SSL_ca_path} = + -d '/etc/ssl/certs/' ? '/etc/ssl/certs/' : '/etc/pki/tls/certs/'; + -d $ssl_config{SSL_ca_path} or die "$ssl_config{SSL_ca_path}: SSL certification directory not found"; } @@ -646,7 +674,11 @@ } sub _get_socket { my ($self) = @_; - my $socket = $self->{socket} ||= ($self->{ssl} ? 'IO::Socket::SSL' : 'IO::Socket::INET')->new( + + my $socket = $self->{socket}; + return $socket if (defined($socket) and ($socket->isa('IO::Socket::SSL')or $socket->isa('IO::Socket::INET'))); + + $self->{socket} = ($self->{ssl} ? 'IO::Socket::SSL' : 'IO::Socket::INET')->new( ( ( %{$self->{ssl_options}} ) x !!$self->{ssl} ), PeerAddr => $self->_get_server, PeerPort => $self->_get_port, @@ -655,8 +687,44 @@ Blocking => 1, $self->_get_ssl_config, ) or die "failed connect or ssl handshake: $!,$IO::Socket::SSL::SSL_ERROR"; - $socket->sockopt(SO_KEEPALIVE, 1); - return $socket; + $self->{socket}->sockopt(SO_KEEPALIVE, 1); + + $self->{greeting} = $self->_socket_getline; # get the initial greeting + + $self->_starttls if ($self->{tls}); # upgrade to TLS if needed + + return $self->{socket}; +} + +sub _starttls { + my ($self) = @_; + + # ask for the capabilities directly at this level, make sure we can do STARTTLS + my $can_do_starttls = 0; + my ($ok, $lines) = $self->_tell_imap('CAPABILITY'); + if ($ok) { + my $line = $lines->[0][0]; + $can_do_starttls ||= 1 if ($line =~ /^\*\s+CAPABILITY.*\s+STARTTLS/); + } else { + die "IMAP server failed CAPABILITY query" + } + die "IMAP server does not have STARTTLS capability" unless ($can_do_starttls); + + # request STARTTLS + ($ok, $lines) = $self->_tell_imap('STARTTLS'); + if ($ok) { + my @sni_args; + push(@sni_args, SSL_hostname => $self->_get_server) if (IO::Socket::SSL->can_client_sni()); + IO::Socket::SSL->start_SSL( + $self->{socket}, + $self->_get_ssl_config, + @sni_args, + ) or die $IO::Socket::SSL::SSL_ERROR; + } else { + die "IMAP server failed STARTTLS command" + } + + return $self->{socket}; } sub _get_next_id { @@ -1199,7 +1267,16 @@ =item - B (BOOL, optional, default FALSE) -Pass a true value if you want to use IO::Socket::SSL +Pass a true value if you want to use L +You may not set both C and C at the same time. + +=item - B (BOOL, optional, default FALSE) + +Pass a true value if you want to use connect without SSL and then use +C to upgrade the connection to an encrypted session using +L. The other C options also apply. + +You may not set both C and C at the same time. =item - B (BOOL, optional, default TRUE) diff -Nru libnet-imap-client-perl-0.9505/META.json libnet-imap-client-perl-0.9507/META.json --- libnet-imap-client-perl-0.9505/META.json 2014-07-18 17:36:54.000000000 +0000 +++ libnet-imap-client-perl-0.9507/META.json 2023-02-05 23:25:41.000000000 +0000 @@ -4,7 +4,7 @@ "Mihai Bazon " ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.140640", + "generated_by" : "ExtUtils::MakeMaker version 7.56, CPAN::Meta::Converter version 2.150001", "license" : [ "unknown" ], @@ -43,5 +43,5 @@ } }, "release_status" : "stable", - "version" : "0.9505" + "version" : "0.9507" } diff -Nru libnet-imap-client-perl-0.9505/META.yml libnet-imap-client-perl-0.9507/META.yml --- libnet-imap-client-perl-0.9505/META.yml 2014-07-18 17:36:54.000000000 +0000 +++ libnet-imap-client-perl-0.9507/META.yml 2023-02-05 23:25:41.000000000 +0000 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.140640' +generated_by: 'ExtUtils::MakeMaker version 7.56, CPAN::Meta::Converter version 2.150001' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -25,4 +25,4 @@ List::MoreUtils: '0' List::Util: '0' Test::More: '0' -version: '0.9505' +version: '0.9507'