about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-14 00:38:28 +0000
committerEric Wong <e@80x24.org>2023-09-15 20:38:55 +0000
commita37e3ab3740c24c36df34a012b65a35ad47208e0 (patch)
treed7df105f903f41d7762b6ee5a98af4c6d3bb09ca /lib
parent392d251f97d465796e9497d893b983bfb2a05b74 (diff)
downloadpublic-inbox-a37e3ab3740c24c36df34a012b65a35ad47208e0.tar.gz
This is probably friendlier to webmail providers which
support importing mail from POP3.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/POP3.pm7
-rw-r--r--lib/PublicInbox/WwwText.pm3
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/PublicInbox/POP3.pm b/lib/PublicInbox/POP3.pm
index 4a21ef5e..f97eccfd 100644
--- a/lib/PublicInbox/POP3.pm
+++ b/lib/PublicInbox/POP3.pm
@@ -72,7 +72,7 @@ sub cmd_user ($$) {
         $user =~ tr/-//d; # most have dashes, some (dbus-uuidgen) don't
         $user =~ m!\A[a-f0-9]{32}\z!i or return \"-ERR user has no UUID\r\n";
 
-        my $limit = UID_SLICE;
+        my $limit;
         $mailbox =~ s/\?limit=([0-9]+)\z// and
                 $limit = $1 > UID_SLICE ? UID_SLICE : $1;
 
@@ -86,10 +86,11 @@ sub cmd_user ($$) {
                 my $tip = "$mailbox.$max";
                 return \"-ERR $mailbox.$slice does not exist ($tip does)\r\n"
                         if $slice > $max;
+                $limit //= UID_SLICE;
                 $self->{uid_base} = ($slice * UID_SLICE) + UID_SLICE - $limit;
                 $self->{slice} = $slice;
-        } else { # latest $limit messages
-                my $base = $uidmax - $limit;
+        } else { # latest $limit messages, 1k if unspecified
+                my $base = $uidmax - ($limit // 1000);
                 $self->{uid_base} = $base < 0 ? 0 : $base;
                 $self->{slice} = -1;
         }
diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index c31a7f86..f4508b3f 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -293,6 +293,9 @@ The POP3 password is: anonymous
 The POP3 username is: \$(uuidgen)\@$ctx->{ibx}->{newsgroup}
 where \$(uuidgen) in the output of the `uuidgen' command on your system.
 The UUID in the username functions as a private cookie (don't share it).
+By default, only 1000 messages are retrieved.  You may download more
+by appending `?limit=NUM' (without quotes) to the username, where
+`NUM' is an integer between 1 and 50000.
 Idle accounts will expire periodically.
 EOM
         }