r67515 - in /branches/upstream/libnet-imap-client-perl/current: Changes META.yml lib/Net/IMAP/Client.pm lib/Net/IMAP/Client/MsgSummary.pm
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Tue Jan 18 22:44:21 UTC 2011
Author: periapt-guest
Date: Tue Jan 18 22:44:08 2011
New Revision: 67515
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=67515
Log:
[svn-upgrade] new version libnet-imap-client-perl (0.94)
Modified:
branches/upstream/libnet-imap-client-perl/current/Changes
branches/upstream/libnet-imap-client-perl/current/META.yml
branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client.pm
branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client/MsgSummary.pm
Modified: branches/upstream/libnet-imap-client-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-imap-client-perl/current/Changes?rev=67515&op=diff
==============================================================================
--- branches/upstream/libnet-imap-client-perl/current/Changes (original)
+++ branches/upstream/libnet-imap-client-perl/current/Changes Tue Jan 18 22:44:08 2011
@@ -1,4 +1,20 @@
Revision history for Net-IMAP-Client
+
+0.94 Dec 22, 2010
+
+ - fix #56647 rfc822 attachment mishandling
+ - fix #43046 Does not strip \r from error messages
+ - fix #59462, #43047 creation of non-modifiable array attempted
+ - fix #43049 append() method's documentation
+ - fix status(): avoid returning data from undef key
+
+0.93
+ - add namespace() method
+ - modify get_summaries() to always return array ref
+
+0.92 Feb 28, 2009
+
+ - Doc updates
0.91 Feb 27, 2009
Modified: branches/upstream/libnet-imap-client-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-imap-client-perl/current/META.yml?rev=67515&op=diff
==============================================================================
--- branches/upstream/libnet-imap-client-perl/current/META.yml (original)
+++ branches/upstream/libnet-imap-client-perl/current/META.yml Tue Jan 18 22:44:08 2011
@@ -1,20 +1,28 @@
--- #YAML:1.0
-name: Net-IMAP-Client
-version: 0.93
-abstract: Not so simple IMAP client library
-license: ~
-author:
+name: Net-IMAP-Client
+version: 0.94
+abstract: Not so simple IMAP client library
+author:
- Mihai Bazon <mihai.bazon at gmail.com>
-generated_by: ExtUtils::MakeMaker version 6.42
-distribution_type: module
-requires:
- Encode: 0
- Encode::MIME::Header: 0
- IO::Socket::INET: 0
- IO::Socket::SSL: 0
- List::MoreUtils: 0
- List::Util: 0
- Test::More: 0
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Encode: 0
+ Encode::MIME::Header: 0
+ IO::Socket::INET: 0
+ IO::Socket::SSL: 0
+ List::MoreUtils: 0
+ List::Util: 0
+ Test::More: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.55_02
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client.pm?rev=67515&op=diff
==============================================================================
--- branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client.pm (original)
+++ branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client.pm Tue Jan 18 22:44:08 2011
@@ -1,7 +1,7 @@
package Net::IMAP::Client;
use vars qw[$VERSION];
-$VERSION = '0.93';
+$VERSION = '0.94';
use strict;
use warnings;
@@ -139,7 +139,9 @@
$ret{$name} = \%tmp;
}
}
- return $wants_one ? $ret{$name} : \%ret;
+ return $wants_one
+ ? (defined $name and $ret{$name}) # avoid data on undef key
+ : \%ret;
}
sub select {
@@ -452,6 +454,8 @@
sub append {
my ($self, $folder, $rfc822, $flags, $date) = @_;
+ die 'message body passed to append() must be a SCALAR reference'
+ unless ref $rfc822 eq 'SCALAR';
my $quoted = $folder;
_string_quote($quoted);
my $args = [ "$quoted " ];
@@ -577,6 +581,7 @@
sub last_error {
my ($self) = @_;
+ $self->{_error} =~ s/\s+$//s; # remove trailing carriage return
return $self->{_error};
}
@@ -709,7 +714,7 @@
return 1;
} elsif ($res =~ /^NIC$id\s+(?:NO|BAD)(?:\s+(.+))?/i) {
my $error = $1 || 'unknown error';
- $self->{_error} = $error;
+ $self->{_error} = $error;
return 0;
}
return undef;
@@ -758,15 +763,21 @@
redo RETRY1 if $self->_reconnect_if_needed;
}
- $lineparts = [];
+ $lineparts = []; # holds results in boxes
+ my $accumulator = []; # box for collecting results
while ($res = $self->_socket_getline) {
# print STDERR ">>>>$res<<<<<\n";
+
if ($res =~ /^\*/) {
- push @$lineparts, []; # this is a new line interesting in itself
+
+ # store previous box and start a new one
+
+ push @$lineparts, $accumulator if @$accumulator;
+ $accumulator = [];
}
if ($res =~ /(.*)\{(\d+)\}\r\n/) {
my ($line, $len) = ($1, $2 + 0);
- push @{$lineparts->[-1]},
+ push @$accumulator,
$line,
$self->_read_literal($len);
} else {
@@ -774,10 +785,13 @@
if (defined($ok)) {
last;
} else {
- push @{$lineparts->[-1]}, $res;
+ push @$accumulator, $res;
}
}
}
+ # store last box
+ push @$lineparts, $accumulator if @$accumulator;
+
unless (defined $res) {
goto RETRY1 if $self->_reconnect_if_needed(1);
}
@@ -835,15 +849,17 @@
%results = ();
for (0..$#cmd) {
my $lineparts = [];
+ my $accumulator = [];
my $res;
while ($res = $self->_socket_getline) {
# print STDERR "2: $res";
if ($res =~ /^\*/) {
- push @$lineparts, []; # this is a new line interesting in itself
+ push @$lineparts, $accumulator if @$accumulator;
+ $accumulator = [];
}
if ($res =~ /(.*)\{(\d+)\}\r\n/) {
my ($line, $len) = ($1, $2);
- push @{$lineparts->[-1]},
+ push @$accumulator,
$line,
$self->_read_literal($len);
} else {
@@ -852,10 +868,11 @@
$results{$cmdid} = [ $ok, $lineparts, $error ];
last;
} else {
- push @{$lineparts->[-1]}, $res;
+ push @$accumulator, $res;
}
}
}
+ push @$lineparts, $accumulator if @$accumulator;
unless (defined $res) {
goto RETRY2 if $self->_reconnect_if_needed(1);
}
@@ -929,7 +946,7 @@
push @{$stack[-1]}, $str; # found string
} elsif ($text =~ m/\G(\d+)/gc) {
push @{$stack[-1]}, $1 + 0; # found numeric
- } elsif ($text =~ m/\G([a-zA-Z0-9_\$\\.+\/*-]+)/gc) {
+ } elsif ($text =~ m/\G([a-zA-Z0-9_\$\\.+\/*&-]+)/gc) {
my $atom = $1;
if (lc $atom eq 'nil') {
$atom = undef;
@@ -1736,7 +1753,7 @@
on "EXISTS" to tell when new messages have arrived. Therefore I can
only say that "RECENT" is useless and I advise you to ignore it.
-=head2 append($folder, $rfc822, $flags, $date)
+=head2 append($folder, \$rfc822, $flags, $date)
Appends a message to the given C<$folder>. You must pass the full
RFC822 body in C<$rfc822>. C<$flags> and C<$date> are optional. If
Modified: branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client/MsgSummary.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client/MsgSummary.pm?rev=67515&op=diff
==============================================================================
--- branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client/MsgSummary.pm (original)
+++ branches/upstream/libnet-imap-client-perl/current/lib/Net/IMAP/Client/MsgSummary.pm Tue Jan 18 22:44:08 2011
@@ -164,6 +164,8 @@
}
sub is_message { $_[0]->content_type eq 'message/rfc822' }
+
+sub message { $_[0]->{message} }
sub _parse_body {
my ($self, $struct) = @_;
@@ -192,8 +194,10 @@
if ($self->is_message && $struct->[7] && $struct->[8]) {
# continue parsing attached message
- $self->_parse_envelope($struct->[7]);
- $self->_parse_body($struct->[8]);
+ $self->{message} = __PACKAGE__->new({
+ ENVELOPE => $struct->[7],
+ BODY => $struct->[8],
+ });
}
}
}
@@ -235,8 +239,10 @@
if ($self->is_message && $struct->[7] && $struct->[8]) {
# continue parsing attached message
- $self->_parse_envelope($struct->[7]);
- $self->_parse_bodystructure($struct->[8]);
+ $self->{message} = __PACKAGE__->new({
+ ENVELOPE => $struct->[7],
+ BODYSTRUCTURE => $struct->[8],
+ });
} elsif ($self->type ne 'text') {
$self->{md5} = $struct->[7];
my $a = $struct->[8];
@@ -528,6 +534,10 @@
the toplevel part, but you B<know> that that part represents a
message. ;-)
+=item C<message>
+
+Returns the attached rfc822 message
+
=item C<headers>
Returns (unparsed, as plain text) additional message headers if they
More information about the Pkg-perl-cvs-commits
mailing list