r18628 - in /trunk/libmail-imapclient-perl: Changes META.yml debian/changelog lib/Mail/IMAPClient.pm lib/Mail/IMAPClient.pod

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Tue Apr 15 16:09:50 UTC 2008


Author: gregoa-guest
Date: Tue Apr 15 16:09:49 2008
New Revision: 18628

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=18628
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=18628&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/Changes (original)
+++ trunk/libmail-imapclient-perl/Changes Tue Apr 15 16:09:49 2008
@@ -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.06: Mon Apr 14 23:44:03 CEST 2008
+
+	Fixes:
+
+	- expunge without argument must use selected folder. [John W]
+
+	- expunge with folder does not select it. [John W]
+
+	- the documentation still spoke about "autogenerated methods",
+	  but they were removed with 2.99 [John W]
+
+	- append_string needs LF -> CRLF translations, for some
+	  servers. rt.cpan.org #35031 [Jonathan Kamens]
+
+	- append_string needs LF -> CRLF translations, for some
+	  servers. rt.cpan.org #35032 [Jonathan Kamens]
+
+	Improvements:
+
+	- added ::setquota(), thanks to [Jappe Reuling]
 
 version 3.05: Wed Feb 20 08:59:37 CET 2008
 

Modified: trunk/libmail-imapclient-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/META.yml?rev=18628&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/META.yml (original)
+++ trunk/libmail-imapclient-perl/META.yml Tue Apr 15 16:09:49 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Mail-IMAPClient
-version:             3.05
+version:             3.06
 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=18628&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/debian/changelog (original)
+++ trunk/libmail-imapclient-perl/debian/changelog Tue Apr 15 16:09:49 2008
@@ -1,3 +1,9 @@
+libmail-imapclient-perl (3.06-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Tue, 15 Apr 2008 18:07:10 +0200
+
 libmail-imapclient-perl (3.05-1) unstable; urgency=low
 
   [ Gunnar Wolf ]

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=18628&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm (original)
+++ trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm Tue Apr 15 16:09:49 2008
@@ -2,7 +2,7 @@
 use strict;
 
 package Mail::IMAPClient;
-our $VERSION = '3.05';
+our $VERSION = '3.06';
 
 use Mail::IMAPClient::MessageSet;
 
@@ -1757,19 +1757,17 @@
 
 sub expunge
 {   my ($self, $folder) = @_;
-    defined $folder
-        or return;
-
-    my $old = $self->Folder;
+
+    my $old = $self->Folder || '';
     if(defined $old && $folder eq $old)
+    {   $self->_imap_command('EXPUNGE')
+            or return undef;
+    }
+    else
     {   $self->select($folder);
         my $succ = $self->_imap_command('EXPUNGE');
         $self->select($old);
         $succ or return undef;
-    }
-    else
-    {   $self->_imap_command('EXPUNGE')
-            or return undef;
     }
 
     wantarray ? $self->History : $self->Results;
@@ -2305,6 +2303,7 @@
         if $self->Count >= $clear and $clear > 0;
 
     my $count  = $self->Count($self->Count+1);
+    $text =~ s/\r?\n/\r\n/g;
 
     my $command = "$count APPEND $folder " . ($flags ? "$flags " : "") .
         ($date ? "$date " : "") .  "{" . length($text) . "}\r\n";
@@ -2715,10 +2714,23 @@
     $self->_imap_command("GETQUOTA $who") ? $self->Results : undef;
 }
 
+# usage: $imap->setquota($folder, storage => 512)
+sub setquota(@)
+{   my ($self, $what) = (shift, shift);
+    my $who = $what ? $self->Massage($what) : "user/$self->{User}";
+    my @limits;
+    while(@_)
+    {   my $key = uc shift @_;
+        push @limits, $key => shift @_;
+    }
+    local $" = ' ';
+    $self->_imap_command("SETQUOTA $who (@limits)") ? $self->Results : undef;
+}
+
 sub quota
 {   my $self = shift;
     my $what = shift || "INBOX";
-    $self->_imap_command("GETQUOTA $what") || $self->getquotaroot($what);
+    $self->_imap_command("GETQUOTA $what") or $self->getquotaroot($what);
     (map { /.*STORAGE\s+\d+\s+(\d+).*\n$/ ? $1 : () } $self->Results)[0];
 }
 

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=18628&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod (original)
+++ trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pod Tue Apr 15 16:09:49 2008
@@ -654,15 +654,9 @@
 search encountered a problem (such as invalid parameters).
 
 A number of IMAP commands do not have corresponding B<Mail::IMAPClient>
-methods. Instead, they are implemented via a default method and Perl's 
-L<AUTOLOAD|perlsub/autoload> facility. If you are looking for a specific
-IMAP client command (or IMAP extension) and do not see it documented in this
-pod, then that does not necessarily mean you can not use B<Mail::IMAPClient> to
-issue the command. In fact, you can issue almost any IMAP client
-command simply by I<pretending> that there is a corresponding 
-B<Mail::IMAPClient> method.  See the section on 
-L<"Other IMAP Client Commands and the Default Object Method">
-below for details on the default method.
+methods.  Please contribute them.  In pre-2.99 releases of this module,
+they were automatically created, but that was very error-prone and stalled
+the progress of this module.
 
 =head1 Mailbox Control Methods
 
@@ -1210,11 +1204,7 @@
 exist. (Seriously, I'm not making any of this stuff up.)
 
 Or you could use the L<close> method, which de-selects as well as
-expunges and which likewise doesn't technically exist. As with any IMAP
-client command, that fact that these methods don't exist will not stop
-them from working anyway. This is a feature of the B<Mail::IMAPClient>
-module. (See L<"Other IMAP Client Commands and the Default Object Method"> 
-if you still don't believe me.)
+expunges and which likewise doesn't technically exist.
 
 =cut
 
@@ -2799,57 +2789,15 @@
 
 =cut
 
-=head1 Other IMAP Client Commands and the Default Object Method
-
-IMAP Client Commands not otherwise documented have been implemented via
-an AUTOLOAD hack and use a default method.
-
-If a program calls a method that is not defined (or inherited) by the
-B<IMAPClient> module then the B<IMAPClient> module will assume that it
-is an IMAP client command. It will prefix the command with the next
-available transaction number (or tag value), and append to it the
-space-delimited list of arguments supplied to the unimplemented method
-(if any). It will then read lines of output from the imap session until
-it finds a line containing the strings "OK" and "Completed", and return
-an array containing all of the lines of output (or, if called in scalar
-context, an array reference). If it finds "BAD" or "NO" instead of "OK"
-it returns C<undef>.
-
-Eg: 
-
-	my @results = $imap->FOO("bar","an example","of the default");
-
-
-results in:
-
-
-	99 FOO bar an example of the default\r\n 
-
-being sent to the IMAP server (assuming that 99 is the current
-transaction number).
-
-Notice that we used an uppercase method name "FOO" so as not to
-conflict with future implementations of that IMAP command. If you run
-your script with warnings turned on (always a good idea, at least
-during testing), then you will receive warnings whenever you use a
-lowercase method name that has not been implemented. An exception to
-this is when you use certain common (yet unimplemented) methods that,
-if ever explicitly implemented, are guaranteed to behave just like the
-default method. To date, those methods are either documented in the
-section labeled L<"OBJECT METHODS">, above, or listed here:
-
-B<Mail::IMAPClient>'s default method adds enormous flexibility and
-built-in extensibility but it is not psychic. It can handle almost
-any extension and truthfully tell you if the server successfully 
-performed your request. But it cannot predict how the command's
-output should be handled, beyond returning a true value on success
-and C<undef> on failure. So if you are running a command because
-you want the output then you may need to parse that output yourself.
-If you develop code that extends B<Mail::IMAPClient> in a way that
-you feel may be useful to others then please consider donating the
-code. Many of the methods in B<Mail::IMAPClient> were contributed
-by other programmers such as yourself. Their contributions are listed
-in the F<Changes> file as they occur.
+=head1 Other IMAP Client Commands
+
+Until release B<2.99>, when you called a method which did not exist,
+they where automatically translated into an IMAP call with the same
+name via an AUTOLOAD hack.  This "feature" was removed for various
+reasons: people made typos in the capatization of method names, and the
+program still seemed to work correctly.  Besides, it blocked further
+development of this module, because people did not contribute their
+private extensions to the protocol implementation.
 
 =head2 copy($msg,$folder)
 




More information about the Pkg-perl-cvs-commits mailing list