[Bps-public-commit] Net-IMAP-Server branch, master, updated. 1.29-5-ge15d8b6

Alex Vandiver alexmv at bestpractical.com
Sun Mar 6 23:38:23 EST 2011


The branch, master has been updated
       via  e15d8b6181c289d2b791a283be0fd9bec3a46a09 (commit)
       via  f2c0360e7a55359be7e5fb046cb661c202b0a095 (commit)
       via  2b4a4207a4d56cd7f225a44a8b5201d61356e457 (commit)
       via  e18d05003c9c135d078956d55219fbcc49da6778 (commit)
      from  3e0f09c7694f2568621be7987f0f9e609f92ba38 (commit)

Summary of changes:
 Makefile.PL                                 |    2 +-
 ex/trivial-server.pl                        |    6 ++++--
 lib/Net/IMAP/Server/Command/Authenticate.pm |    5 ++++-
 lib/Net/IMAP/Server/Command/List.pm         |    8 +++-----
 lib/Net/IMAP/Server/Message.pm              |    8 +-------
 5 files changed, 13 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit e18d05003c9c135d078956d55219fbcc49da6778
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Nov 10 14:21:21 2010 -0500

    Avoid "Premature end of base64 data"; "no warnings" isn't sufficient?

diff --git a/lib/Net/IMAP/Server/Command/Authenticate.pm b/lib/Net/IMAP/Server/Command/Authenticate.pm
index 6b72730..d17a806 100644
--- a/lib/Net/IMAP/Server/Command/Authenticate.pm
+++ b/lib/Net/IMAP/Server/Command/Authenticate.pm
@@ -52,7 +52,10 @@ sub continue {
         return;
     }
 
-    $line = decode_base64($line);
+    {
+        local $^W; # Avoid "Premature end of base64 data", etc..
+        $line = decode_base64($line);
+    }
 
     my $response = $self->sasl->($line);
     if ( ref $response ) {

commit 2b4a4207a4d56cd7f225a44a8b5201d61356e457
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Nov 10 21:23:29 2010 -0500

    DateTime::Format::Strptime fixed the leading-whitespace bug in 1.3000
    
    This reverts 968eec66bd673c76283e67864081e2b1c77f1b08 and bumps the
    dependency accordingly.

diff --git a/Makefile.PL b/Makefile.PL
index 30713ac..a756b26 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -11,7 +11,7 @@ requires('Class::Accessor');
 requires('Coro');
 requires('DateTime');
 requires('DateTime::Format::Mail');
-requires('DateTime::Format::Strptime');
+requires('DateTime::Format::Strptime' => 1.3000);
 requires('Email::Address');
 requires('Email::MIME' => 1.862);
 requires('Email::MIME::ContentType');
diff --git a/lib/Net/IMAP/Server/Message.pm b/lib/Net/IMAP/Server/Message.pm
index 4657f91..c026263 100644
--- a/lib/Net/IMAP/Server/Message.pm
+++ b/lib/Net/IMAP/Server/Message.pm
@@ -78,13 +78,7 @@ sub internaldate {
     return $self->{internaldate} unless @_;
     my $value = shift;
 
-    my $dt;
-    if (ref $value) {
-        $dt = $value;
-    } else {
-        $value =~ s/^\s+//;
-        $dt = $self->INTERNALDATE_PARSER->parse_datetime($value);
-    }
+    my $dt = ref $value ? $value : $self->INTERNALDATE_PARSER->parse_datetime($value);
     return undef unless $dt;
 
     $self->{internaldate} = $dt->strftime("%e-%b-%Y %T %z");

commit f2c0360e7a55359be7e5fb046cb661c202b0a095
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Nov 10 21:05:20 2010 -0500

    Make the example code run unmodified as a non-root user by picking high ports, if need be

diff --git a/ex/trivial-server.pl b/ex/trivial-server.pl
index a089ebe..a3270f5 100644
--- a/ex/trivial-server.pl
+++ b/ex/trivial-server.pl
@@ -43,11 +43,13 @@ sub load_data {
     $self->add_message($msg);
 }
 
+my %ports = ( port => 143, ssl_port => 993 );
+$ports{$_} *= 10 for grep {$> > 0} keys %ports;
+
 Net::IMAP::Server->new(
     auth_class  => "Demo::IMAP::Auth",
     model_class => "Demo::IMAP::Model",
     user        => 'nobody',
-    port        => 143,
-    ssl_port    => 993
+    %ports,
 )->run();
 

commit e15d8b6181c289d2b791a283be0fd9bec3a46a09
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Mar 4 14:37:10 2011 -0500

    Use ->data_out() to properly escape mailbox names with quotes in list/lsub
    
    Reported-by: Vittal Aithal <vittal.id at aithal.org>

diff --git a/lib/Net/IMAP/Server/Command/List.pm b/lib/Net/IMAP/Server/Command/List.pm
index e0ede35..f90a6d3 100644
--- a/lib/Net/IMAP/Server/Command/List.pm
+++ b/lib/Net/IMAP/Server/Command/List.pm
@@ -52,11 +52,9 @@ sub list_out {
     my $node = shift;
     my @props = @_;
 
-    my $sep = (defined $self->connection->model->root->separator)
-        ? q{"}.$self->connection->model->root->separator.q{"} : "NIL";
-    my $name = q{"}.Encode::encode('IMAP-UTF-7',$node->full_path).q{"};
-
-    my $str = $self->data_out([map {\$_} @props]) . " $sep $name";
+    my $str = $self->data_out([map {\$_} @props]) . " "
+        . $self->data_out($self->connection->model->root->separator) . " "
+        . $self->data_out(Encode::encode('IMAP-UTF-7',$node->full_path));
     $self->tagged_response($str);
 }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list