r30764 - in /trunk/libmail-imapclient-perl: Changes META.yml debian/changelog lib/Mail/IMAPClient.pm lib/Mail/IMAPClient.pod
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Mon Feb 16 18:28:03 UTC 2009
Author: ansgar-guest
Date: Mon Feb 16 18:28:00 2009
New Revision: 30764
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30764
Log:
New upstream release.
Modified:
trunk/libmail-imapclient-perl/Changes
trunk/libmail-imapclient-perl/META.yml
trunk/libmail-imapclient-perl/debian/changelog
trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm
trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod
Modified: trunk/libmail-imapclient-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/Changes?rev=30764&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/Changes (original)
+++ trunk/libmail-imapclient-perl/Changes Mon Feb 16 18:28:00 2009
@@ -2,6 +2,27 @@
== Revision History for Mail::IMAPClient
All changes from 2.99_01 upward are made by Mark Overmeer. The changes
before that are applied by David Kernen
+
+version 3.14: Mon Feb 16 14:18:09 CET 2009
+
+ Fixes:
+
+ - isparent() when list() returns nothing.
+ rt.cpan.org#42932 [Phil Lobbes]
+
+ - Quote more characters in Massage(): add CTL, [, ], % and *
+ rt.cpan.org#42932 [Phil Lobbes]
+
+ - message_string() will only complain about a difference between
+ reported message size and actually received size; it will not
+ try to correct it anymore.
+ rt.cpan.org#42987 [Phil Lobbes]
+
+ - No error when empty text in append_string()
+ rt.cpan.org#42987 [Phil Lobbes]
+
+ - login() should not try authenticate() if auth is empty or undef
+ rt.cpan.org#43277 [Phil Lobbes]
version 3.13: Thu Jan 15 10:29:04 CET 2009
Modified: trunk/libmail-imapclient-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/META.yml?rev=30764&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/META.yml (original)
+++ trunk/libmail-imapclient-perl/META.yml Mon Feb 16 18:28:00 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Mail-IMAPClient
-version: 3.13
+version: 3.14
abstract: IMAP4 client library
license: ~
author: ~
Modified: trunk/libmail-imapclient-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/debian/changelog?rev=30764&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/debian/changelog (original)
+++ trunk/libmail-imapclient-perl/debian/changelog Mon Feb 16 18:28:00 2009
@@ -1,3 +1,9 @@
+libmail-imapclient-perl (3.14-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Mon, 16 Feb 2009 19:27:50 +0100
+
libmail-imapclient-perl (3.13-1) unstable; urgency=low
[ Ansgar Burchardt ]
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=30764&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm (original)
+++ trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm Mon Feb 16 18:28:00 2009
@@ -5,7 +5,7 @@
use strict;
package Mail::IMAPClient;
-our $VERSION = '3.13';
+our $VERSION = '3.14';
use Mail::IMAPClient::MessageSet;
@@ -331,7 +331,7 @@
{ my $self = shift;
my $auth = $self->Authmechanism;
return $self->authenticate($auth, $self->Authcallback)
- if $auth ne 'LOGIN';
+ if $auth && $auth ne 'LOGIN';
my $passwd = $self->Password;
if($passwd =~ m/\W/) # need to quote
@@ -553,8 +553,6 @@
sub message_string
{ my ($self, $msg) = @_;
- my $expected_size = $self->size($msg);
- defined $expected_size or return undef; # unable to get size
my $peek = $self->Peek ? '.PEEK' : '';
my $cmd = $self->imap4rev1 ? "BODY$peek\[]" : "RFC822$peek";
@@ -565,19 +563,19 @@
my $string = $self->_transaction_literals;
unless($self->Ignoresizeerrors)
- { # Should this return undef if length != expected?
- # now, attempts are made to salvage parts of the message.
- if( length($string) != $expected_size )
+ { # Check size with expected size
+ my $expected_size = $self->size($msg);
+ unless(defined $expected_size)
+ { $self->LastError( "message_string() cannot get message size,"
+ . " you may need the IgnoreSizeErrors option");
+ return undef;
+ }
+
+ # RFC822.SIZE may be wrong.
+ # See RFC2683 3.4.5 "RFC822.SIZE"
+ if(length($string) != $expected_size)
{ $self->LastError("message_string() "
- . "expected $expected_size bytes but received ".length($string));
- }
-
- $string = substr $string, 0, $expected_size
- if length($string) > $expected_size;
-
- if( length($string) < $expected_size )
- { $self->LastError("message_string() expected ".
- "$expected_size bytes but received ".length($string));
+ . "expected $expected_size bytes but received ".length($string));
return undef;
}
}
@@ -1248,18 +1246,20 @@
}
$self->_debug("Sending: $string");
-
- my $total = 0;
- my $temperrs = 0;
- my $maxwrite = 0;
+ $self->_send_bytes(\$string);
+}
+
+sub _send_bytes($)
+{ my ($self, $byteref) = @_;
+ my ($total, $temperrs, $maxwrite) = (0, 0, 0);
my $waittime = .02;
my @previous_writes;
my $maxagain = $self->Maxtemperrors || 10;
undef $maxagain if $maxagain eq 'unlimited';
- while($total < length $string)
- { my $written = syswrite($self->Socket, $string, length($string)-$total,
+ while($total < length $$byteref)
+ { my $written = syswrite($self->Socket, $$byteref, length($$byteref)-$total,
$total);
if(defined $written)
@@ -2255,11 +2255,11 @@
sub is_parent
{ my ($self, $folder) = (shift, shift);
- my $list = $self->list(undef, $folder) || "NO NO BAD BAD";
+ my $list = $self->list(undef, $folder) or return 0;
my $line;
for(my $m = 0; $m < @$list; $m++)
- { return undef
+ { return 0
if $list->[$m] =~ /\bNoInferior\b/i;
if($list->[$m] =~ s/(\{\d+\})\r\n$// )
@@ -2300,7 +2300,8 @@
sub selectable
{ my ($self, $f) = @_;
- not( grep /NoSelect/i, $self->list("", $f) );
+ my $info = $self->list("", $f);
+ defined $info ? not(grep /NoSelect/i, @$info) : undef;
}
sub append
@@ -2316,6 +2317,7 @@
{ my $self = shift;
my $folder = $self->Massage(shift);
my ($text, $flags, $date) = @_;
+ defined $text or $text = '';
if(defined $flags)
{ $flags =~ s/^\s+//g;
@@ -2390,7 +2392,7 @@
return undef;
}
- my $fh = IO::File->new($file, 'rb');
+ my $fh = IO::File->new($file, 'r');
unless($fh)
{ $self->LastError("Unable to open $file: $!");
return undef;
@@ -2450,17 +2452,14 @@
}
# Now send the message itself
- local $/ = ref $control ? "\n" : $control ? $control : "\n";
my $buffer;
-
while($fh->sysread($buffer, APPEND_BUFFER_SIZE))
- { $buffer =~ s/\A\n/\r\n/;
- $buffer =~ s/(?<![^\r])\n/\r\n/g;
+ { $buffer =~ s/(?<!\r)\n/\r\n/g;
$self->_record( $count, [ $self->_next_index($count), "INPUT"
, '{'.length($buffer)." bytes from $file}" ] );
- my $bytes_written = $self->_send_line($buffer, 1);
+ my $bytes_written = $self->_send_bytes(\$buffer);
unless($bytes_written)
{ $self->LastError("Error sending append msg text to IMAP: $!");
$fh->close;
@@ -2763,12 +2762,21 @@
sub Quote($) { $_[0]->Massage($_[1], NonFolderArg) }
+# rfc3501:
+# atom-specials = "(" / ")" / "{" / SP / CTL / list-wildcards /
+# quoted-specials / resp-specials
+# list-wildcards = "%" / "*"
+# quoted-specials = DQUOTE / "\"
+# resp-specials = "]"
+# rfc2060:
+# CTL ::= <any ASCII control character and DEL, 0x00 - 0x1f, 0x7f>
+# Additionally, we encode strings with } and [, be less than minimal
sub Massage($;$)
{ my ($self, $name, $notFolder) = @_;
$name =~ s/^\"(.*)\"$/$1/ unless $notFolder;
$name =~ /["\\]/ ? "{".length($name)."}\r\n$name"
- : $name =~ /[\s{}()]/ ? qq["$name"]
+ : $name =~ /[(){}\s[:cntrl:]%*\[\]]/ ? qq["$name"]
: $name;
}
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=30764&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod (original)
+++ trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod Mon Feb 16 18:28:00 2009
@@ -1550,6 +1550,8 @@
command. (If you want your output adulterated then see the L<folders>
method, above.)
+An C<undef> value is returned in case of errors. Be sure to check for
+it.
=head2 listrights
More information about the Pkg-perl-cvs-commits
mailing list