r25036 - in /branches/upstream/libimap-admin-perl/current: Admin.pm Changes META.yml

rmayorga-guest at users.alioth.debian.org rmayorga-guest at users.alioth.debian.org
Sat Sep 13 08:06:22 UTC 2008


Author: rmayorga-guest
Date: Sat Sep 13 08:06:15 2008
New Revision: 25036

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=25036
Log:
[svn-upgrade] Integrating new upstream version, libimap-admin-perl (1.6.6)

Modified:
    branches/upstream/libimap-admin-perl/current/Admin.pm
    branches/upstream/libimap-admin-perl/current/Changes
    branches/upstream/libimap-admin-perl/current/META.yml

Modified: branches/upstream/libimap-admin-perl/current/Admin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libimap-admin-perl/current/Admin.pm?rev=25036&op=diff
==============================================================================
--- branches/upstream/libimap-admin-perl/current/Admin.pm (original)
+++ branches/upstream/libimap-admin-perl/current/Admin.pm Sat Sep 13 08:06:15 2008
@@ -11,7 +11,7 @@
 
 use vars qw($VERSION);
 
-$VERSION = '1.6.4';
+$VERSION = '1.6.6';
 
 sub new {
   my $class = shift;
@@ -91,19 +91,30 @@
 	    return;
     }
   } else {
-    if (!eval {
-	    $self->{'Socket'} = 
-      IO::Socket::INET->new(PeerAddr => $self->{'Server'},
-                            PeerPort => $self->{'Port'},
-                            Proto => 'tcp',
-                            Reuse => 1,
-                            Timeout => 5); })
-      {
-        delete $self->{'Socket'};
-        $self->_error("initialize", "couldn't establish connection to",
-                      $self->{'Server'});
-        return;
-			  
+    if ($self->{'Server'} =~ /^\//) {
+        if (!eval {
+            $self->{'Socket'} = 
+        IO::Socket::UNIX->new(Peer => $self->{'Server'}); })
+        {
+            delete $self->{'Socket'};
+            $self->_error("initialize", "couldn't establish connection to",
+                        $self->{'Server'});
+            return;
+        }
+      } else {
+          if (!eval {
+              $self->{'Socket'} = 
+          IO::Socket::INET->new(PeerAddr => $self->{'Server'},
+                                  PeerPort => $self->{'Port'},
+                                  Proto => 'tcp',
+                                  Reuse => 1,
+                                  Timeout => 5); })
+          {
+              delete $self->{'Socket'};
+              $self->_error("initialize", "couldn't establish connection to",
+                          $self->{'Server'});
+              return;
+          }
       }
   }
   my $fh = $self->{'Socket'};
@@ -486,6 +497,61 @@
   return 0;
 }
 
+sub select { # returns an array or undef
+  my $self = shift;
+  my @info;
+
+  if (!defined($self->{'Socket'})) {
+    return 1;
+  }
+  if (scalar(@_) != 1) {
+    $self->_error("select", "incorrect number of arguments");
+    return;
+  }
+
+  my $mailbox = shift;
+  my $fh = $self->{'Socket'};
+  print $fh qq{try SELECT "$mailbox"\n};
+  my $try = $self->_read;
+  while ($try =~ /^\* (.*)/) { # danger danger (could lock up needs timeout)
+    push @info, $1;
+    $try = $self->_read;
+  }
+  if ($try =~ /^try OK/) {
+    return @info;
+  } else {
+    $self->_error("select", "couldn't select", $mailbox, ":", $try);
+    return;
+  }
+}
+
+sub expunge { # returns an array or undef
+  my $self = shift;
+  my @info;
+
+  if (!defined($self->{'Socket'})) {
+    return 1;
+  }
+  if (scalar(@_) != 0) {
+    $self->_error("expunge", "incorrect number of arguments");
+    return;
+  }
+
+  my $mailbox = shift;
+  my $fh = $self->{'Socket'};
+  print $fh qq{try EXPUNGE\n};
+  my $try = $self->_read;
+  while ($try =~ /^\* (.*)/) { # danger danger (could lock up needs timeout)
+    push @info, $1;
+    $try = $self->_read;
+  }
+  if ($try =~ /^try OK/) {
+    return @info;
+  } else {
+    $self->_error("expunge", "couldn't expunge", $mailbox, ":", $try);
+    return;
+  }
+}
 
 sub get_acl { # returns an array or undef
   my $self = shift;
@@ -683,6 +749,8 @@
 
 SSL on the new call will attempt to make an SSL connection to the imap server.  It does not fallback to a regular connection if it fails.  It is off by default.  IO::Socket::SSL requires a ca certificate, a client certificate, and a client private key. By default these are in current_directory/certs, respectively named ca-cert.pem, client-cert.pem, and client-key.pem.  The location of this can be overridden by setting SSL_ca_file, SSL_cert_file, and SSL_key_file (you'll probably want to also set SSL_ca_path).
 
+If you start the name of the server with a / instead of using tcp/ip it'll attempt to use a unix socket.
+
 I generated my ca cert and ca key with openssl:
  openssl req -x509 -newkey rsa:1024 -keyout ca-key.pem -out ca-cert.pem
 
@@ -724,6 +792,26 @@
 subscribe/unsubscribe does this action on given mailbox.
 
 rename renames a mailbox.  IMAP servers seem to be peculiar about how they implement this, so I wouldn't necessarily expect it to do what you think it should.
+
+select selects a mailbox to work on. You need the 'r' acl to select a mailbox.
+This command selects a mailbox that mailbox related commands will be performed on.  This is not a recursive command so sub-mailboxes/folders will not be affected unless for some bizarre reason the IMAP server has it implemented as recursive.  It returns an error or an array that contains information about the mailbox.  For example:
+FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Forwarded $MDNSent NonJunk Junk $Label7)
+OK [PERMANENTFLAGS (\Deleted)]  
+2285 EXISTS
+2285 RECENT
+OK [UNSEEN 1]  
+OK [UIDVALIDITY 1019141395]  
+OK [UIDNEXT 293665]  
+OK [READ-WRITE] Completed
+
+expunge permanently removes messages flagged with \Deleted out of the current selected mailbox.
+It returns a list of message sequence numbers that it deleted.  You need to select a mailbox before you expunge. You need to read section 7.4.1 of RFC2060 to interpret the output.  Essentially each time a message is deleted the sequence numbers all get decremented so you can see the same message sequence number several times in the list of deleted messages.  In the following example (taken from the RFC) messages 3, 4, 7, and 11 were deleted:
+* 3 EXPUNGE
+* 3 EXPUNGE
+* 5 EXPUNGE
+* 8 EXPUNGE
+. OK EXPUNGE completed
+
 
 =head2 QUOTA FUNCTIONS
 

Modified: branches/upstream/libimap-admin-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libimap-admin-perl/current/Changes?rev=25036&op=diff
==============================================================================
--- branches/upstream/libimap-admin-perl/current/Changes (original)
+++ branches/upstream/libimap-admin-perl/current/Changes Sat Sep 13 08:06:15 2008
@@ -159,3 +159,8 @@
   - I screwed the pooch on 1.6.3, blatant typo pointed out to me by matrix200
     guess I forgot to run make test before releasing.
 
+1.6.5 apparently a mystery release
+
+1.6.6 Sun Sep 07 10:20:22 CST 2008
+  - Thomas Jarosch sent a patch that adds unix socket support for those
+    who have their admin restricted to unix socket instead of tcp

Modified: branches/upstream/libimap-admin-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libimap-admin-perl/current/META.yml?rev=25036&op=diff
==============================================================================
--- branches/upstream/libimap-admin-perl/current/META.yml (original)
+++ branches/upstream/libimap-admin-perl/current/META.yml Sat Sep 13 08:06:15 2008
@@ -1,10 +1,12 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         IMAP-Admin
-version:      1.6.4
-version_from: Admin.pm
-installdirs:  site
-requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+--- #YAML:1.0
+name:                IMAP-Admin
+version:             1.6.6
+abstract:            ~
+license:             ~
+author:              ~
+generated_by:        ExtUtils::MakeMaker version 6.42
+distribution_type:   module
+requires:     
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3




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