r70849 - in /trunk/libmail-imapclient-perl: Changes META.yml debian/changelog debian/compat debian/control lib/Mail/IMAPClient.pm lib/Mail/IMAPClient.pod t/fetch_hash.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Tue Mar 8 03:27:20 UTC 2011
Author: jawnsy-guest
Date: Tue Mar 8 03:27:07 2011
New Revision: 70849
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=70849
Log:
* New upstream release
* Bump to debhelper compat 8
Modified:
trunk/libmail-imapclient-perl/Changes
trunk/libmail-imapclient-perl/META.yml
trunk/libmail-imapclient-perl/debian/changelog
trunk/libmail-imapclient-perl/debian/compat
trunk/libmail-imapclient-perl/debian/control
trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm
trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod
trunk/libmail-imapclient-perl/t/fetch_hash.t
Modified: trunk/libmail-imapclient-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/Changes?rev=70849&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/Changes (original)
+++ trunk/libmail-imapclient-perl/Changes Tue Mar 8 03:27:07 2011
@@ -4,6 +4,21 @@
Changes from 2.99_01 to 3.16 made by Mark Overmeer
Changes from 0.09 to 2.99_01 made by David Kernen
- Potential compatibility issues from 3.17+ highlighted with '*'
+
+version 3.28_04: Fri Mar 4 00:17:38 EST 2011
+ - rt.cpan.org#66004: internaldate() return undef if no internaldate in reply
+ [Jason Long]
+ - rt.cpan.org#66367: fetch_hash uses Escaped_results() in 3.26/3.27
+ (redo) rt.cpan.org#63524: fetch_hash() parse errors
+ [Mathias Reitinger]
+ + fetch_hash: only Escape() data in parenthesized list
+ + update fetch_hash test and add a new test
+ - do not touch CRLF in Escape()/Unescape()
+ - added Escape() method
+ - rt.cpan.org#66287: flags results truncated due to Maxcommandlength
+ [Erik Colson]
+ - rt.cpan.org#65694: SASL PLAIN: bad order of login data
+ [Willi Mann]
version 3.27: Sun Feb 13 14:37:27 EST 2011
- rt.cpan.org#65694: migrate fails
Modified: trunk/libmail-imapclient-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/META.yml?rev=70849&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/META.yml (original)
+++ trunk/libmail-imapclient-perl/META.yml Tue Mar 8 03:27:07 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Mail-IMAPClient
-version: 3.27
+version: 3.28
abstract: IMAP4 client library
author:
- Phil Pearl (Lobbes) <phil at zimbra.com>
Modified: trunk/libmail-imapclient-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/debian/changelog?rev=70849&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/debian/changelog (original)
+++ trunk/libmail-imapclient-perl/debian/changelog Tue Mar 8 03:27:07 2011
@@ -1,3 +1,10 @@
+libmail-imapclient-perl (3.28-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Bump to debhelper compat 8
+
+ -- Jonathan Yu <jawnsy at cpan.org> Mon, 07 Mar 2011 22:51:46 -0500
+
libmail-imapclient-perl (3.27-1) unstable; urgency=low
[ Jonathan Yu ]
Modified: trunk/libmail-imapclient-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/debian/compat?rev=70849&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/debian/compat (original)
+++ trunk/libmail-imapclient-perl/debian/compat Tue Mar 8 03:27:07 2011
@@ -1,1 +1,1 @@
-7
+8
Modified: trunk/libmail-imapclient-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/debian/control?rev=70849&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/debian/control (original)
+++ trunk/libmail-imapclient-perl/debian/control Tue Mar 8 03:27:07 2011
@@ -1,8 +1,10 @@
Source: libmail-imapclient-perl
Priority: optional
Section: perl
-Build-Depends: debhelper (>= 7.0.50~)
-Build-Depends-Indep: perl, libparse-recdescent-perl, libtest-pod-perl
+Build-Depends: debhelper (>= 8)
+Build-Depends-Indep: perl,
+ libparse-recdescent-perl,
+ libtest-pod-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Salvatore Bonaccorso <carnil at debian.org>,
Ansgar Burchardt <ansgar at debian.org>, Rene Mayorga <rmayorga at debian.org>,
@@ -16,7 +18,8 @@
Package: libmail-imapclient-perl
Architecture: all
-Depends: ${perl:Depends}, ${misc:Depends}, libparse-recdescent-perl
+Depends: ${perl:Depends}, ${misc:Depends},
+ libparse-recdescent-perl
Recommends: libio-socket-ssl-perl, libdigest-hmac-perl
Suggests: libauthen-sasl-perl
Description: Perl library for manipulating IMAP mail stores
Modified: trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm?rev=70849&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm (original)
+++ trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm Tue Mar 8 03:27:07 2011
@@ -7,7 +7,7 @@
use warnings;
package Mail::IMAPClient;
-our $VERSION = '3.27';
+our $VERSION = '3.28';
use Mail::IMAPClient::MessageSet;
@@ -1708,7 +1708,7 @@
# literal is appended to previous data
if ( $self->_is_literal($line) ) {
- $data =~ s/([\\\(\)"$CRLF])/\\$1/og;
+ $data = $self->Escape($data);
$a[-1] .= qq( "$data");
$prevwasliteral = 1;
}
@@ -1726,10 +1726,16 @@
return wantarray ? @a : \@a;
}
+sub Escape {
+ my $data = $_[1];
+ $data =~ s/([\\\"])/\\$1/og;
+ return $data;
+}
+
sub Unescape {
- my $whatever = $_[1];
- $whatever =~ s/\\([\\\(\)"$CRLF])/$1/og;
- $whatever;
+ my $data = $_[1];
+ $data =~ s/\\([\\\"])/$1/og;
+ return $data;
}
sub logout {
@@ -2001,7 +2007,7 @@
}
my %words = map { uc($_) => 1 } @words;
- my $output = $self->fetch( { escaped => 1 }, $msgs, "($what)" )
+ my $output = $self->fetch( $msgs, "($what)" )
or return undef;
while ( my $l = shift @$output ) {
@@ -2025,7 +2031,7 @@
$l = shift @$output;
next ATTR;
}
- elsif ( $l =~ m/\G(?:"([^"]+)"|([^()\s]+))\s*/gc ) {
+ elsif ( $l =~ m/\G(?:"(.*?)(?:(?<!\\)")|([^()\s]+))\s*/gc ) {
$value = defined $1 ? $1 : $2;
$entry->{$key} = $value;
next ATTR;
@@ -2050,6 +2056,13 @@
else {
$value .= $stuff;
}
+
+ # consume literal data if any
+ if ( $l =~ m/\G\s*$/gc and scalar(@$output) ) {
+ my $elit = $self->Escape( shift @$output );
+ $l = shift @$output;
+ $value .= ( length($value) ? " " : "" ) . qq{"$elit"};
+ }
}
$l =~ m/\G\s*/gc;
}
@@ -2207,13 +2220,13 @@
$msg->cat(@_) if @_;
# Send command
- $self->fetch( $msg, "FLAGS" ) or return undef;
+ my $ref = $self->fetch( $msg, "FLAGS" ) or return undef;
my $u_f = $self->Uid;
my $flagset = {};
# Parse results, setting entry in result hash for each line
- foreach my $line ( $self->Results ) {
+ foreach my $line (@$ref) {
$self->_debug("flags: line = '$line'");
if (
$line =~ /\* \s+ (\d+) \s+ FETCH \s+ # * nnn FETCH
@@ -2661,10 +2674,8 @@
my ( $self, $msg ) = @_;
$self->_imap_uid_command( FETCH => $msg, 'INTERNALDATE' )
or return undef;
- my $internalDate = join '', $self->History;
- $internalDate =~ s/^.*INTERNALDATE "//si;
- $internalDate =~ s/\".*$//s;
- $internalDate;
+ my $hist = join '', $self->History;
+ return $hist =~ /\bINTERNALDATE "([^"]*)"/i ? $1 : undef;
}
sub is_parent {
@@ -2973,13 +2984,14 @@
elsif ( $scheme eq 'PLAIN' ) { # PLAIN SASL
$response ||= sub {
my ( $code, $client ) = @_;
- encode_base64(
- $client->User
- . chr(0)
- . $client->Proxy
- . chr(0)
- . $client->Password,
- ''
+ encode_base64( # [authname] user password
+ join(
+ chr(0),
+ defined $client->Proxy
+ ? ( $client->User, $client->Proxy )
+ : ( "", $client->User ),
+ defined $client->Password ? $client->Password : "",
+ ),
);
};
}
Modified: trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod?rev=70849&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod (original)
+++ trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod Tue Mar 8 03:27:07 2011
@@ -94,7 +94,13 @@
=item PLAIN (SASL)
-PLAIN (SASL) authentication requires the use of the L</Proxy> parameter.
+PLAIN (SASL) authentication allows the optional use of the L</Proxy>
+parameter. RFC 4616 documents this syntax for SASL PLAIN:
+
+ message = [authzid] UTF8NUL authcid UTF8NUL passwd
+
+When L</Proxy> is defined, L</User> is used as 'authzid' and L</Proxy>
+is used as 'authcid'. Otherwise, L</User> is used as 'authcid'.
=item NTLM
@@ -1056,16 +1062,14 @@
}
};
-By itself this method may be useful for, say, speeding up programs that
-want the size of every message in a folder. It issues one command and
-receives one (possibly long!) response from the server. However, it's
-true power lies in the as-yet-unwritten methods that will rely on this
-method to deliver even more powerful result hashes. Look for more new
-function in later releases.
-
-This method is new with version 2.2.3 and is thus still experimental.
-If you decide to try this method and run into problems, please see the
-section on L</REPORTING BUGS>.
+By itself this method may be useful for tasks like obtaining the size
+of every message in a folder. It issues one command and receives one
+(possibly long!) response from the server.
+
+If the fetch request causes the server to return data in a
+parenthesized list, the data within the parenthesized list may be
+escaped via the Escape() method. Use the Unescape() method to get the
+raw values back in this case.
=head2 flags
@@ -1308,7 +1312,8 @@
or die "Could not internaldate: $@\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.
+L</Uid> parameter is true), and returns that message's internal date
+or undef if the call fails or internal date is not returned.
=head2 get_bodystructure
Modified: trunk/libmail-imapclient-perl/t/fetch_hash.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/t/fetch_hash.t?rev=70849&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/t/fetch_hash.t (original)
+++ trunk/libmail-imapclient-perl/t/fetch_hash.t Tue Mar 8 03:27:07 2011
@@ -9,7 +9,7 @@
use strict;
use warnings;
-use Test::More tests => 19;
+use Test::More tests => 20;
BEGIN { use_ok('Mail::IMAPClient') or exit; }
@@ -100,26 +100,56 @@
],
[
"BODY.PEEK[] requests match BODY[] responses",
- [ q{* 1 FETCH (BODY[] foo)} ],
+ [q{* 1 FETCH (BODY[] foo)}],
[ [1], qw(BODY.PEEK[]) ],
{ "1" => { "BODY[]" => q{foo}, }, },
],
[
"BODY.PEEK[] requests match BODY.PEEK[] responses also",
- [ q{* 1 FETCH (BODY.PEEK[] foo)} ],
+ [q{* 1 FETCH (BODY.PEEK[] foo)}],
[ [1], qw(BODY.PEEK[]) ],
{ "1" => { "BODY.PEEK[]" => q{foo}, }, },
],
[
- "escaped subject",
- [ q{* 1 FETCH (UID 1 X-SAVEDATE "28-Jan-2011 16:52:31 -0500" FLAGS (\Seen) ENVELOPE ("Fri, 28 Jan 2011 00:03:30 -0500" "foo \\"bar\\" baz\'s" (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) ((NIL NIL "phil" "dom.loc")) NIL NIL NIL "<msgid>")) } ],
+ "escaped ENVELOPE subject",
+ [
+q{* 1 FETCH (UID 1 X-SAVEDATE "28-Jan-2011 16:52:31 -0500" FLAGS (\Seen) ENVELOPE ("Fri, 28 Jan 2011 00:03:30 -0500"},
+ q{foo "bar\\" (baz\\)},
+q{ (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) ((NIL NIL "phil" "dom.loc")) NIL NIL NIL "<msgid>")) }
+ ],
[ [1], qw(UID X-SAVEDATE FLAGS ENVELOPE) ],
{
"1" => {
'X-SAVEDATE' => '28-Jan-2011 16:52:31 -0500',
- 'UID' => '1',
- 'FLAGS' => '\\Seen',
- 'ENVELOPE' => q{"Fri, 28 Jan 2011 00:03:30 -0500" "foo \\"bar\\" baz\'s" (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) ((NIL NIL "phil" "dom.loc")) NIL NIL NIL "<msgid>"}
+ 'UID' => '1',
+ 'FLAGS' => '\\Seen',
+ 'ENVELOPE' =>
+q{"Fri, 28 Jan 2011 00:03:30 -0500" "foo \\"bar\\\\\\" (baz\\\\)" (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) ((NIL NIL "phil" "dom.loc")) NIL NIL NIL "<msgid>"}
+ },
+ },
+ ],
+ [
+ "non-escaped BODY[HEADER.FIELDS (...)]",
+ [
+q{* 1 FETCH (UID 1 FLAGS () BODY[HEADER.FIELDS (TO FROM SUBJECT DATE)]},
+ 'From: Phil Pearl (Lobbes) <phil+from at perkpartners.com>
+To: phil+to at 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) <phil+from at perkpartners.com>
+To: phil+to at perkpartners.com
+Subject: foo "bar\" (baz\)
+Date: Sat, 22 Jan 2011 20:43:58 -0500
+
+',
+ 'FLAGS' => '',
},
},
],
@@ -225,6 +255,7 @@
my ( $self, @args ) = @_;
return $self->{_next_fetch_response} || [];
}
+
sub Escaped_results {
my ( $self, @args ) = @_;
return $self->{_next_fetch_response} || [];
More information about the Pkg-perl-cvs-commits
mailing list