[Bps-public-commit] r9538 - in Net-Server-IMAP: . lib/Net/Server/IMAP lib/Net/Server/IMAP/Command

alexmv at bestpractical.com alexmv at bestpractical.com
Fri Nov 2 14:00:35 EDT 2007


Author: alexmv
Date: Fri Nov  2 14:00:33 2007
New Revision: 9538

Modified:
   Net-Server-IMAP/   (props changed)
   Net-Server-IMAP/lib/Net/Server/IMAP.pm
   Net-Server-IMAP/lib/Net/Server/IMAP/Command/Search.pm
   Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm
   Net-Server-IMAP/lib/Net/Server/IMAP/Message.pm

Log:
 r24312 at zoq-fot-pik:  chmrr | 2007-11-02 13:59:48 -0400
  * Warnings prevention in SEARCH
  * The default ->expunge now marks the message as expunged.  It can
    still exist in temporary mailboxes after this has happened!  In
    fact, it is guarnateed to only be in temporary mailboxes.
  * Add 'model' onto the top-level accessors, for when ->connection is
    local'd out during polling.


Modified: Net-Server-IMAP/lib/Net/Server/IMAP.pm
==============================================================================
--- Net-Server-IMAP/lib/Net/Server/IMAP.pm	(original)
+++ Net-Server-IMAP/lib/Net/Server/IMAP.pm	Fri Nov  2 14:00:33 2007
@@ -97,6 +97,11 @@
     return $self->{auth};
 }
 
+sub model {
+    my $self = shift;
+    return $self->{model};
+}
+
 sub concurrent_connections {
     my $class = shift;
     my $self = ref $class ? $class : $Net::Server::IMAP::Server;

Modified: Net-Server-IMAP/lib/Net/Server/IMAP/Command/Search.pm
==============================================================================
--- Net-Server-IMAP/lib/Net/Server/IMAP/Command/Search.pm	(original)
+++ Net-Server-IMAP/lib/Net/Server/IMAP/Command/Search.pm	Fri Nov  2 14:00:33 2007
@@ -41,7 +41,7 @@
         } elsif ($token eq "BCC") {
             return $self->bad_command("Parse error") unless @tokens;
             my $bcc = shift @tokens;
-            push @{$filters}, sub {$_[0]->mime->header("Bcc") =~ /\Q$bcc\E/i};
+            push @{$filters}, sub {$_[0]->mime->header("Bcc")||"" =~ /\Q$bcc\E/i};
         # BEFORE
         } elsif ($token eq "BODY") {
             return $self->bad_command("Parse error") unless @tokens;
@@ -50,7 +50,7 @@
         } elsif ($token eq "CC") {
             return $self->bad_command("Parse error") unless @tokens;
             my $cc = shift @tokens;
-            push @{$filters}, sub {$_[0]->mime->header("Cc") =~ /\Q$cc\E/i};
+            push @{$filters}, sub {$_[0]->mime->header("Cc")||"" =~ /\Q$cc\E/i};
         } elsif ($token eq "DELETED") {
             push @{$filters}, sub {$_[0]->has_flag('\Deleted')};
         } elsif ($token eq "DRAFT") {
@@ -60,11 +60,11 @@
         } elsif ($token eq "FROM") {
             return $self->bad_command("Parse error") unless @tokens;
             my $from = shift @tokens;
-            push @{$filters}, sub {$_[0]->mime->header("From") =~ /\Q$from\E/i};
+            push @{$filters}, sub {$_[0]->mime->header("From")||"" =~ /\Q$from\E/i};
         } elsif ($token eq "HEADER") {
             return $self->bad_command("Parse error") unless @tokens >= 2;
             my ($header, $value) = splice(@tokens, 0, 2);
-            push @{$filters}, sub {$_[0]->mime->header($header) =~ /\Q$value\E/i};
+            push @{$filters}, sub {$_[0]->mime->header($header)||"" =~ /\Q$value\E/i};
         } elsif ($token eq "KEYWORD") {
             return $self->bad_command("Parse error") unless @tokens;
             my $keyword = shift @tokens;
@@ -111,7 +111,7 @@
         } elsif ($token eq "TO") {
             return $self->bad_command("Parse error") unless @tokens;
             my $to = shift @tokens;
-            push @{$filters}, sub {$_[0]->mime->header("To") =~ /\Q$to\E/i};
+            push @{$filters}, sub {$_[0]->mime->header("To")||"" =~ /\Q$to\E/i};
         } elsif ($token eq "UID") {
             return $self->bad_command("Parse error") unless @tokens;
             my $set = shift @tokens;

Modified: Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm
==============================================================================
--- Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm	(original)
+++ Net-Server-IMAP/lib/Net/Server/IMAP/Connection.pm	Fri Nov  2 14:00:33 2007
@@ -39,6 +39,7 @@
     my $content = shift;
 
     local $self->server->{connection} = $self;
+    local $self->server->{model} = $self->model;
     local $self->server->{auth} = $self->auth;
 
     $self->log("C(@{[$self->io_handle->peerport]},@{[$self->auth ? $self->auth->user : '???']},@{[$self->is_selected ? $self->selected->full_path : 'unselected']}): $content");

Modified: Net-Server-IMAP/lib/Net/Server/IMAP/Message.pm
==============================================================================
--- Net-Server-IMAP/lib/Net/Server/IMAP/Message.pm	(original)
+++ Net-Server-IMAP/lib/Net/Server/IMAP/Message.pm	Fri Nov  2 14:00:33 2007
@@ -16,7 +16,7 @@
 
 use base 'Class::Accessor';
 
-__PACKAGE__->mk_accessors(qw(sequence mailbox uid _flags mime internaldate));
+__PACKAGE__->mk_accessors(qw(sequence mailbox uid _flags mime internaldate expunged));
 
 sub new {
     my $class = shift;
@@ -28,6 +28,8 @@
 }
 
 sub expunge {
+    my $self = shift;
+    $self->expunged(1);
 }
 
 sub copy_allowed {



More information about the Bps-public-commit mailing list