about summary refs log tree commit homepage
path: root/lib/PublicInbox/POP3.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-07-20 09:24:11 +0000
committerEric Wong <e@80x24.org>2022-07-20 16:52:11 +0000
commitb9bc55a39b65d6da9da8bf2ad5daaaa2933ab508 (patch)
tree170c22bef51625ab745b332eff5ce3f4d978ed24 /lib/PublicInbox/POP3.pm
parent8abe7e6cda7bc9f8daa4e9cf6ef7e51b356902d5 (diff)
downloadpublic-inbox-b9bc55a39b65d6da9da8bf2ad5daaaa2933ab508.tar.gz
RFC 2449 only documents "EXPIRE 0" behavior for RETR requests
which fetch the whole message.  TOP requests only fetch
the headers and top $N lines of the body, so it's probably
harmful for deletions to be triggered in those cases.
Diffstat (limited to 'lib/PublicInbox/POP3.pm')
-rw-r--r--lib/PublicInbox/POP3.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/POP3.pm b/lib/PublicInbox/POP3.pm
index 51c2b71a..2c20c84b 100644
--- a/lib/PublicInbox/POP3.pm
+++ b/lib/PublicInbox/POP3.pm
@@ -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;
 }