Hello community,
here is the log from the commit of package perl-Mail-IMAPClient for openSUSE:Factory checked in at 2019-03-01 20:31:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mail-IMAPClient (Old)
and /work/SRC/openSUSE:Factory/.perl-Mail-IMAPClient.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mail-IMAPClient"
Fri Mar 1 20:31:01 2019 rev:3 rq:680364 version:3.41
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mail-IMAPClient/perl-Mail-IMAPClient.changes 2019-01-28 20:49:49.553817792 +0100
+++ /work/SRC/openSUSE:Factory/.perl-Mail-IMAPClient.new.28833/perl-Mail-IMAPClient.changes 2019-03-01 20:31:08.577986349 +0100
@@ -1,0 +2,29 @@
+Thu Feb 21 06:17:21 UTC 2019 - Stephan Kulow
+
+- updated to 3.41
+ see /usr/share/doc/packages/perl-Mail-IMAPClient/Changes
+
+ version 3.41: Thu Feb 21 01:47:42 UTC 2019
+ - rt.cpan.org#128220: unseen(), messages() and related POD cleanup
+ [Dan Jacobson]
+ - rt.cpan.org#128264: parse_message() minor code/POD cleanup
+ [Dan Jacobson]
+ - rt.cpan.org#128215: verb missing in messages() POD
+ [Gilles Lamiral and Dan Jacobson]
+ - rt.cpan.org#127271: simplify capability handling via has_capability enhancements
+ +* has_capability() success returns(true) with server response data, not always '1'
+ + enhanced t/capability.t test cases
+ + updated POD for capability() and has_capability()
+ [Gilles Lamiral and Mark Overmeer]
+ - rt.cpan.org#122373: use of IO::Socket::IP led to connect(empty args) regression
+ [Gilles Lamiral]
+ - rt.cpan.org#128127: fix minor POD typo for search()
+ [Gregor Herrmann]
+ - folders()/subscribed() remove mailboxes with \Noselect attribute
+ [Ashley Willis]
+ - fetch_hash() remove quotes around header names (seen w/outlook.com)
+ [Ashley Willis]
+ - use first over grep for minor efficiency gains
+ - other minor POD cleanup
+
+-------------------------------------------------------------------
Old:
----
Mail-IMAPClient-3.40.tar.gz
New:
----
Mail-IMAPClient-3.41.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mail-IMAPClient.spec ++++++
--- /var/tmp/diff_new_pack.kYDGqz/_old 2019-03-01 20:31:09.297986172 +0100
+++ /var/tmp/diff_new_pack.kYDGqz/_new 2019-03-01 20:31:09.301986171 +0100
@@ -17,7 +17,7 @@
Name: perl-Mail-IMAPClient
-Version: 3.40
+Version: 3.41
Release: 0
%define cpan_name Mail-IMAPClient
Summary: An IMAP Client API
@@ -55,11 +55,12 @@
%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
-# fix shebang
+# MANUAL BEGIN
for f in examples/*.pl
do
sed -i 's|^#!/usr/local/bin/perl|%{__perl}|' ${f}
done
+# MANUAL END
%build
perl Makefile.PL INSTALLDIRS=vendor
++++++ Mail-IMAPClient-3.40.tar.gz -> Mail-IMAPClient-3.41.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mail-IMAPClient-3.40/Changes new/Mail-IMAPClient-3.41/Changes
--- old/Mail-IMAPClient-3.40/Changes 2018-12-06 02:44:28.000000000 +0100
+++ new/Mail-IMAPClient-3.41/Changes 2019-02-21 02:48:11.000000000 +0100
@@ -5,12 +5,35 @@
Changes from 0.09 to 2.99_01 made by David Kernen
- Potential compatibility issues from 3.17+ highlighted with '*'
+version 3.41: Thu Feb 21 01:47:42 UTC 2019
+ - rt.cpan.org#128220: unseen(), messages() and related POD cleanup
+ [Dan Jacobson]
+ - rt.cpan.org#128264: parse_message() minor code/POD cleanup
+ [Dan Jacobson]
+ - rt.cpan.org#128215: verb missing in messages() POD
+ [Gilles Lamiral and Dan Jacobson]
+ - rt.cpan.org#127271: simplify capability handling via has_capability enhancements
+ +* has_capability() success returns(true) with server response data, not always '1'
+ + enhanced t/capability.t test cases
+ + updated POD for capability() and has_capability()
+ [Gilles Lamiral and Mark Overmeer]
+ - rt.cpan.org#122373: use of IO::Socket::IP led to connect(empty args) regression
+ [Gilles Lamiral]
+ - rt.cpan.org#128127: fix minor POD typo for search()
+ [Gregor Herrmann]
+ - folders()/subscribed() remove mailboxes with \Noselect attribute
+ [Ashley Willis]
+ - fetch_hash() remove quotes around header names (seen w/outlook.com)
+ [Ashley Willis]
+ - use first over grep for minor efficiency gains
+ - other minor POD cleanup
+
version 3.40: Thu Dec 6 01:44:16 UTC 2018
- - rt.cpan.org#122373 support IPv6 by using IO::Socket::IP over IO::Socket::INET
+ - rt.cpan.org#122373: support IPv6 by using IO::Socket::IP over IO::Socket::INET
[Gilles Lamiral and Mark Overmeer]
- - rt.cpan.org#127103 flags() undef value as an ARRAY reference on a bogus message
+ - rt.cpan.org#127103: flags() undef value as an ARRAY reference on a bogus message
[Gilles Lamiral]
- - rt.cpan.org#124523 update examples/populate_mailbox.pl timegm usage
+ - rt.cpan.org#124523: update examples/populate_mailbox.pl timegm usage
[Bernhard M. W.]
- t/capability.t: added first set of tests
- t/quota.t: minor fix when tests skipped
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mail-IMAPClient-3.40/META.json new/Mail-IMAPClient-3.41/META.json
--- old/Mail-IMAPClient-3.40/META.json 2018-12-06 02:51:08.000000000 +0100
+++ new/Mail-IMAPClient-3.41/META.json 2019-02-21 02:49:24.000000000 +0100
@@ -52,6 +52,6 @@
"resources" : {
"homepage" : "http://sourceforge.net/projects/mail-imapclient/"
},
- "version" : "3.40",
+ "version" : "3.41",
"x_serialization_backend" : "JSON::PP version 2.97001"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mail-IMAPClient-3.40/META.yml new/Mail-IMAPClient-3.41/META.yml
--- old/Mail-IMAPClient-3.40/META.yml 2018-12-06 02:51:08.000000000 +0100
+++ new/Mail-IMAPClient-3.41/META.yml 2019-02-21 02:49:24.000000000 +0100
@@ -33,5 +33,5 @@
perl: '5.008'
resources:
homepage: http://sourceforge.net/projects/mail-imapclient/
-version: '3.40'
+version: '3.41'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mail-IMAPClient-3.40/lib/Mail/IMAPClient.pm new/Mail-IMAPClient-3.41/lib/Mail/IMAPClient.pm
--- old/Mail-IMAPClient-3.40/lib/Mail/IMAPClient.pm 2018-12-06 02:45:45.000000000 +0100
+++ new/Mail-IMAPClient-3.41/lib/Mail/IMAPClient.pm 2019-02-21 02:48:16.000000000 +0100
@@ -7,7 +7,7 @@
use warnings;
package Mail::IMAPClient;
-our $VERSION = '3.40';
+our $VERSION = '3.41';
use Mail::IMAPClient::MessageSet;
@@ -331,7 +331,8 @@
push( @sockargs, @{ $self->Socketargs } );
}
- my $server = $self->Server;
+ # if no server, use " " to induce a non-fatal error
+ my $server = $self->Server || " ";
my $port = $self->Port || $self->Port( $self->Ssl ? "993" : "143" );
my ( $ioclass, $sock );
@@ -717,6 +718,7 @@
foreach my $resp (@list) {
my $rec = $self->_list_or_lsub_response_parse($resp);
next unless defined $rec->{name};
+ next if first { lc($_) eq '\noselect' } @{ $rec->{attrs} };
push @folders, $rec;
}
}
@@ -2248,6 +2250,11 @@
while ( $l and $l !~ m/\G\s*\)\s*$/gc ) {
if ( $l =~ m/\G\s*([^\s\[]+(?:\[[^\]]*\])?(?:<[^>]*>)?)\s*/gc ) {
$key = uc($1);
+
+ # strip quotes around header names - seen w/outlook.com
+ if ( $key =~ /^BODY\[HEADER\.FIELDS \("[^"]+".*?\)\]$/ ) {
+ $key =~ s/"//g;
+ }
}
elsif ( !defined $key ) {
@@ -2537,8 +2544,7 @@
{ # start new message header
( $msgid, my $msgattrs ) = ( $1, $2 );
$h = {};
- if ( $self->Uid ) # undef when win2003
- {
+ if ( $self->Uid ) { # undef when win2003
$msgid = $msgattrs =~ m/\b UID \s+ (\d+)/x ? $1 : undef;
}
$headers{$msgid} = $h if $msgid;
@@ -2821,6 +2827,7 @@
defined $line && $line =~ /\(UIDNEXT\s+([^\)]+)/ ? $1 : undef;
}
+# sort @caps for consistency?
sub capability {
my $self = shift;
@@ -2832,10 +2839,17 @@
$self->_imap_command('CAPABILITY')
or return undef;
- my @caps = map { split } grep s/^\*\s+CAPABILITY\s+//, $self->History;
- foreach (@caps) {
- $self->{CAPABILITY}{ uc $_ }++;
- $self->{ uc $1 } = uc $2 if /(.*?)\=(.*)/;
+ my @caps = map { split } grep /^\*\s+CAPABILITY\s+/, $self->History;
+ splice( @caps, 0, 2 ); # remove * CAPABILITY from array
+
+ # use iterator as we may append to @caps for CAPA=VALUE
+ for ( my $i = 0 ; $i < @caps ; $i++ ) {
+ $self->{CAPABILITY}->{ $caps[$i] } ||= [];
+ my ( $capa, $cval ) = split( /=/, $caps[$i], 2 );
+ if ( defined $cval ) {
+ push( @caps, $capa ) unless exists $self->{CAPABILITY}->{$capa};
+ push( @{ $self->{CAPABILITY}->{$capa} }, $cval );
+ }
}
return wantarray ? @caps : \@caps;
@@ -2846,7 +2860,20 @@
sub has_capability {
my ( $self, $which ) = @_;
$self->capability or return undef;
- $which ? $self->{CAPABILITY}{ uc $which } : "";
+ my $aref = [];
+
+ # exists in CAPABILITIES? possibly in CAPA=VALUE format?
+ if ( exists $self->{CAPABILITY}{$which} ) {
+ if ( @{ $self->{CAPABILITY}{$which} } ) {
+ $aref = $self->{CAPABILITY}{$which};
+ }
+ else {
+ $aref = [$which];
+ }
+ }
+
+ return @$aref if wantarray;
+ return scalar @$aref ? $aref : "";
}
sub imap4rev1 {
@@ -2926,9 +2953,9 @@
}
if ($attrs) {
- return undef if grep { /\A\\NoInferiors\Z/i } @$attrs;
- return 1 if grep { /\A\\HasChildren\Z/i } @$attrs;
- return 0 if grep { /\A\\HasNoChildren\Z/i } @$attrs;
+ return undef if first { lc($_) eq '\noinferiors' } @$attrs;
+ return 1 if first { lc($_) eq '\haschildren' } @$attrs;
+ return 0 if first { lc($_) eq '\hasnochildren' } @$attrs;
}
else {
$self->_debug( join( "\n\t", "no attrs for '$folder' in:", @$list ) );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mail-IMAPClient-3.40/lib/Mail/IMAPClient.pod new/Mail-IMAPClient-3.41/lib/Mail/IMAPClient.pod
--- old/Mail-IMAPClient-3.40/lib/Mail/IMAPClient.pod 2018-09-27 02:46:52.000000000 +0200
+++ new/Mail-IMAPClient-3.41/lib/Mail/IMAPClient.pod 2019-01-16 16:27:34.000000000 +0100
@@ -215,8 +215,7 @@
Password => $pass,
Clear => 5, # Unnecessary since '5' is the default
# ... # Other key=>value pairs go here
- )
- or die "Cannot connect to $host as $id: $@";
+ ) or die "Cannot connect to $host as $id: $@";
See also L</Parameters>, L</connect> and L</login> for more
information on how to manually connect and login after B<new>.
@@ -604,7 +603,7 @@
Example:
my $string = $imap->body_string($msgId)
- or die "Could not body_string: ", $imap->LastError;
+ or die "body_string failed: ", $imap->LastError;
The B method accepts a message sequence number (or a
message UID, if the L</Uid> parameter is set to true) as an argument
@@ -644,13 +643,13 @@
my $features = $imap->capability
or die "Could not determine capability: ", $imap->LastError;
-The B<capability> method returns an array of capabilities as returned
-by the CAPABILITY IMAP Client command, or a reference to an array of
-capabilities if called in scalar context. If the CAPABILITY IMAP
-Client command fails for any reason then the B<capability> method will
-return C<undef>. Supported capabilities are cached by the client,
-however, this cache is deleted after a connection is set to
-I<Authenticated> and when L</starttls> is called.
+The B<capability> method returns an array (or arrayref in scalar
+context) of capabilities as returned by the CAPABILITY IMAP client
+command. If the CAPABILITY IMAP client command fails for any reason
+then the B<capability> method will return C<undef>. Supported
+capabilities are cached by the client, however, this cache is deleted
+after a connection is set to I<Authenticated> and when L</starttls> is
+called.
See also L.
@@ -1107,8 +1106,8 @@
Example:
- my @flags = $imap->flags($msgid)
- or die "Could not flags: $@\n";
+ my $flags = $imap->flags($msgid)
+ or die "flags failed: $@\n";
The B<flags> method implements the FETCH IMAP client command to list a
single message's flags. It accepts one argument, a message sequence
@@ -1295,11 +1294,48 @@
my $has_feature = $imap->has_capability($feature)
or die "Could not do has_capability($feature): $@\n";
-Returns true if the IMAP server to which the IMAPClient object is
-connected has the capability specified as an argument to
-B. If the server does not have the capability then
-the empty string "" is returned, if the underlying L</capability>
-calls fails then undef is returned.
+Returns:
+
+=over 4
+
+=item C<undef>
+
+If the underlying L</capability> calls fails then C<undef> is
+returned.
+
+=item C<""> or C<()>
+
+If the server does not have the requested capability, then either an
+empty string (C<""> in scalar context) or an empty list (C<()> in list
+context) is returned.
+
+=item a I<true> value
+
+If the server has the requested capability, then a I<true> value is
+returned. The I<true> value depends upon the server response for the
+capability requested. The value will be an array reference in scalar
+context or an array in list context. The returned data is useful for
+understanding more about specific capabilities. For example, consider
+the following server CAPABILITY response:
+
+ * CAPABILITY IMAP4rev1 SORT SORT=DISPLAY I18NLEVEL=1 AUTH=PLAIN AUTH=XTEST
+
+Results are returned as shown by the trailing comments:
+
+ $c = $imap->has_capability("IMAP4rev1"); # [ "IMAP4rev1" ]
+ @c = $imap->has_capability("IMAP4rev1"); # ( "IMAP4rev1" )
+ $c = $imap->has_capability("SORT"); # [ "DISPLAY" ]
+ @c = $imap->has_capability("SORT=DISPLAY"); # ( "SORT=DISPLAY" )
+ $c = $imap->has_capability("AUTH"); # [ "PLAIN", "XTEST" ]
+ @c = $imap->has_capability("AUTH"); # ( "PLAIN", "XTEST" )
+ $c = $imap->has_capability("AUTH=XTEST"); # [ "AUTH=XTEST" ]
+ @c = $imap->has_capability("AUTH=XTEST"); # ( "AUTH=XTEST" )
+ $c = $imap->has_capability("AUTH=NADA"); # ''
+ @c = $imap->has_capability("AUTH=NADA"); # ()
+ $c = $imap->has_capability("NADA"); # ''
+ @c = $imap->has_capability("NADA"); # ()
+
+=back
=head2 idle
@@ -1385,7 +1421,7 @@
Example:
my $msg_internal_date = $imap->internaldate($msgid)
- or die "Could not internaldate: $@\n";
+ or die "internaldate failed: $@\n";
B<internaldate> accepts one argument, a message id (or UID if the
L</Uid> parameter is true), and returns that message's internal date
@@ -1736,7 +1772,7 @@
Example:
my $msgcount = $imap->message_count($folder);
- defined($msgcount) or die "Could not message_count: $@\n";
+ defined($msgcount) or die "message_count failed: $@\n";
The B method accepts the name of a folder as an
argument and returns the number of messages in that folder.
@@ -1760,7 +1796,7 @@
Example:
my $string = $imap->message_string($msgid)
- or die "Could not message_string: $@\n";
+ or die "message_string failed: $@\n";
The B method accepts a message sequence number (or
message UID if L</Uid> is true) as an argument and returns the message
@@ -1774,7 +1810,7 @@
Example:
$imap->message_to_file( $file, @msgs )
- or die "Could not message_to_file: $@\n";
+ or die "message_to_file failed: $@\n";
The B method accepts a filename or file handle and
one or more message sequence numbers (or message UIDs if L</Uid> is
@@ -1816,18 +1852,19 @@
Example:
# Get a list of messages in the current folder:
- my @msgs = $imap->messages or die "Could not messages: $@\n";
+ my @msgs = $imap->messages or warn "Could not list messages\n";
# Get a reference to an array of messages in the current folder:
- my $msgs = $imap->messages or die "Could not messages: $@\n";
+ my $msgs = $imap->messages or die "Get messages failed: $@\n";
If called in list context, the B<messages> method returns a list of
all the messages in the currently selected folder. If called in
scalar context, it returns a reference to an array containing all the
-messages in the folder. If you have the L</Uid> parameter turned off,
-then this is the same as specifying C<1 ... $imap-E<gt>L>;
-if you have UID set to true then this is the same as specifying
+messages in the folder. This is the same as specifying
C<$imap-E<gt>L</search>("ALL")>.
+An empty list is returned when no messages are found. On failure
+<undef> is returned and L</LastError> is set.
+
=head2 migrate
Example:
@@ -1943,7 +1980,7 @@
Example:
my $refs = $imap->namespace
- or die "Could not namespace: $@\n";
+ or die "namespace failed: $@\n";
The namespace method runs the NAMESPACE IMAP command (as defined in
RFC 2342). When called in a list context, it returns a list of three
@@ -2007,16 +2044,18 @@
Example:
- my $hashref = $imap->parse_headers($msg||\@msgs, "Date", "Subject")
+ my $hashref = $imap->parse_headers( $msg || \@msgs, "Date", "Subject" )
or die "Could not parse_headers: $@\n";
The B method accepts as arguments a message sequence
number and a list of header fields. It returns a hash reference in
which the keys are the header field names (without the colon) and the
-values are references to arrays of values. A picture would look
-something like this:
+values are references to arrays of values. On failure <undef> is
+returned and L</LastError> is set.
- $hashref = $imap->parse_headers(1,"Date","Received","Subject","To");
+A picture would look something like this:
+
+ $hashref = $imap->parse_headers( 1, "Date", "Received", "Subject", "To");
$hashref = {
"Date" => [ "Thu, 09 Sep 1999 09:49:04 -0400" ] ,
"Received" => [ q/
@@ -2063,7 +2102,7 @@
described above.
An example of using B to print the date and subject of
-every message in your smut folder could look like this:
+every message in your demo folder could look like this:
use Mail::IMAPClient;
my $imap = Mail::IMAPClient->new(
@@ -2108,7 +2147,7 @@
my $count = 0;
defined($count = $imap->recent_count($folder))
- or die "Could not recent_count: $@\n";
+ or die "recent_count failed: $@\n";
The B method accepts as an argument a folder name. It
returns the number of recent messages in the folder (as returned by
@@ -2148,8 +2187,8 @@
Example:
- $imap->rename($oldname,$nedwname)
- or die "Could not rename: $@\n";
+ $imap->rename( $oldname, $nedwname )
+ or die "rename failed: $@\n";
The B<rename> method accepts two arguments: the name of an existing
folder, and a new name for the folder. The existing folder will be
@@ -2161,7 +2200,7 @@
Example:
- $imap->restore_message(@msgs) or die "Could not restore_message: $@\n";
+ $imap->restore_message(@msgs) or die "restore_message failed: $@\n";
The B method is used to undo a previous
L operation (but not if there has been an intervening
@@ -2220,14 +2259,14 @@
Example:
- $imap->run(@args) or die "Could not run: $@\n";
+ $imap->run(@args) or die "run failed: $@\n";
The B<run> method is provided to make those uncommon things
possible... however, we would like you to contribute the knowledge of
missing features with us.
The B<run> method excepts one or two arguments. The first argument is
-a string containing an IMAP Client command, including a tag and all
+a string containing an IMAP client command, including a tag and all
required arguments. The optional second argument is a string to look
for that will indicate success. (The default is C). The
B<run> method returns an array (or arrayref in scalar context) of
@@ -2253,7 +2292,7 @@
Example:
my $msgs1 = $imap->search(@args);
- if ($msgs) {
+ if ($msgs1) {
print "search matches: @$msgs1";
}
else {
@@ -2321,7 +2360,7 @@
Example:
- $imap->see(@msgs) or die "Could not see: $@\n";
+ $imap->see(@msgs) or die "see failed: $@\n";
The B<see> method accepts a list of one or more messages sequence
numbers, or a single reference to an array of one or more message
@@ -2350,7 +2389,7 @@
Example:
- $imap->select($folder) or die "Could not select: $@\n";
+ $imap->select($folder) or die "select failed: $@\n";
The B<select> method selects a folder and changes the object's state
to I<Selected>. It accepts one argument, which is the name of the
@@ -2680,7 +2719,7 @@
or die "Could not tag_and_run: $@\n";
The B method accepts one or two arguments. The first
-argument is a string containing an IMAP Client command, without a tag
+argument is a string containing an IMAP client command, without a tag
but with all required arguments. The optional second argument is a
string to look for that will indicate success (without pattern
delimiters). The default is C.
@@ -2715,7 +2754,7 @@
Example:
- my $nextUid = $imap->uidnext($folder) or die "Could not uidnext: $@\n";
+ my $nextUid = $imap->uidnext($folder) or die "uidnext failed: $@\n";
The B<uidnext> method accepts one argument, the name of a folder, and
returns the numeric string that is the next available message UID for
@@ -2759,7 +2798,7 @@
Example:
my $validity = $imap->uidvalidity($folder)
- or die "Could not uidvalidity: $@\n";
+ or die "uidvalidity failed: $@\n";
The B<uidvalidity> method accepts one argument, the name of a folder,
and returns the numeric string that is the unique identifier validity
@@ -2801,9 +2840,6 @@
returned instead. If called in scalar context than a pointer to the
array (rather than the array itself) will be returned.
-Note that when specifying the flag in question, the preceding
-backslash (\) is entirely optional.
-
=head2 unseen_count
Example:
@@ -2823,7 +2859,7 @@
Example:
$imap->unset_flag( "\Seen", @msgs )
- or die "Could not unset_flag: $@\n";
+ or die "unset_flag failed: $@\n";
The B method accepts the name of a flag as its first
argument and a list of one or more messages sequence numbers, or a
@@ -3655,7 +3691,7 @@
}
In the second example, we used the default method to issue the UID
-IMAP Client command, being careful to use an all-uppercase method name
+IMAP client command, being careful to use an all-uppercase method name
so as not to inadvertently call the L</Uid> accessor method. Then we
parsed out the message UIDs manually, since we don't have the benefit
of the built-in L</search> method doing it for us.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mail-IMAPClient-3.40/t/basic.t new/Mail-IMAPClient-3.41/t/basic.t
--- old/Mail-IMAPClient-3.40/t/basic.t 2018-10-05 06:51:27.000000000 +0200
+++ new/Mail-IMAPClient-3.41/t/basic.t 2019-01-16 15:45:46.000000000 +0100
@@ -14,7 +14,7 @@
eval { $params = MyTest->new; };
$@
? plan skip_all => $@
- : plan tests => 107;
+ : plan tests => 111;
}
BEGIN { use_ok('Mail::IMAPClient') or exit; }
@@ -29,6 +29,16 @@
Debug => $debug,
);
+{
+ my $ret;
+ eval {
+ my $imap = Mail::IMAPClient->new();
+ $ret = $imap->connect();
+ };
+ ok( !$@, "allow no args to connect()" ) or diag( '$@:' . $@ );
+ ok( !defined $ret, "connect() returns undef" ) or diag("returned($ret)");
+}
+
# allow other options to be placed in test.txt
%new_args = ( %new_args, %${params} );
@@ -141,6 +151,9 @@
my $targetno = $target . "_noselect";
my $targetsubf = $targetno . "${sep}subfolder";
ok( $imap->create($targetsubf), "create target subfolder" );
+ my @f = $imap->folders();
+ ok( (!grep { $_ eq $targetno } @f), "folders() excludes /Noselect mailbox" )
+ or diag("folders() included $targetno");
ok( !$imap->selectable($targetno),
"not selectable (non-mailbox w/inferior)" );
ok( $imap->delete($targetsubf), "delete target subfolder" );
@@ -267,6 +280,11 @@
my $fields = $imap->search( "HEADER", "Message-id", "NOT_A_MESSAGE_ID" );
is( scalar @$fields, 0, 'bogus message id does not exist' );
+{
+ my $geth = $imap->get_header( 123456789, "Subject" );
+ is( $geth, undef, "get_header on bogus message returns undef" );
+}
+
my @seen = $imap->seen;
cmp_ok( scalar @seen, '==', 1, 'have seen 1' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mail-IMAPClient-3.40/t/fetch_hash.t new/Mail-IMAPClient-3.41/t/fetch_hash.t
--- old/Mail-IMAPClient-3.40/t/fetch_hash.t 2015-08-13 22:59:58.000000000 +0200
+++ new/Mail-IMAPClient-3.41/t/fetch_hash.t 2018-12-27 06:29:24.000000000 +0100
@@ -8,7 +8,7 @@
use strict;
use warnings;
-use Test::More tests => 27;
+use Test::More tests => 28;
BEGIN { use_ok('Mail::IMAPClient') or exit; }
@@ -152,6 +152,31 @@
'From: Phil Pearl (Lobbes)
To: phil+to@perkpartners.com
Subject: foo "bar\" (baz\)
+Date: Sat, 22 Jan 2011 20:43:58 -0500
+
+'
+ ],
+ [ [1], ( qw(FLAGS), 'BODY[HEADER.FIELDS (TO FROM SUBJECT DATE)]' ) ],
+ {
+ '1' => {
+ 'BODY[HEADER.FIELDS (TO FROM SUBJECT DATE)]' =>
+ 'From: Phil Pearl (Lobbes)
+To: phil+to@perkpartners.com
+Subject: foo "bar\" (baz\)
+Date: Sat, 22 Jan 2011 20:43:58 -0500
+
+',
+ 'FLAGS' => '',
+ },
+ },
+ ],
+ [
+ "with quotes BODY[HEADER.FIELDS (...)]",
+ [
+q{* 1 FETCH (FLAGS () BODY[HEADER.FIELDS ("TO" "FROM" "SUBJECT" "DATE")]},
+ 'From: Phil Pearl (Lobbes)
+To: phil+to@perkpartners.com
+Subject: foo "bar\" (baz\)
Date: Sat, 22 Jan 2011 20:43:58 -0500
'