]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/POP3.pm
pop3: TOP requests do not expire messages
[public-inbox.git] / lib / PublicInbox / POP3.pm
index 8612356329fde8ac4584221b071efde1bd63dbeb..2c20c84b0e1022f6594227d8de9f1a4cb2aaf4fb 100644 (file)
@@ -176,7 +176,7 @@ sub _login_ok ($) {
                $self->{uid_max} = $self->{ibx}->over(1)->max;
                \"+OK logged in\r\n";
        } else {
-               \"-ERR unable to lock maildrop\r\n";
+               \"-ERR [IN-USE] unable to lock maildrop\r\n";
        }
 }
 
@@ -300,12 +300,13 @@ sub retr_cb { # called by git->cat_async via ibx_async_cat
                $hdr .= "\r\n\r\n";
                my @tmp = split(/^/m, $bdy);
                $hdr .= join('', splice(@tmp, 0, $top_nr));
+       } elsif (exists $self->{expire}) {
+               $self->{expire} .= pack('S', $off + 1);
        }
        $$bref =~ s/^\./../gms;
        $$bref .= substr($$bref, -2, 2) eq "\r\n" ? ".\r\n" : "\r\n.\r\n";
        $self->msg_more("+OK message follows\r\n");
        $self->write($bref);
-       $self->{expire} .= pack('S', $off + 1) if exists $self->{expire};
        $self->requeue;
 }
 
@@ -350,6 +351,7 @@ USER\r
 PIPELINING\r
 UIDL\r
 EXPIRE 0\r
+RESP-CODES\r
 .\r
 EOM
 }