about summary refs log tree commit homepage
path: root/lib/PublicInbox/DummyInbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-10 07:04:40 +0000
committerEric Wong <e@yhbt.net>2020-06-13 07:55:45 +0000
commitcfae078171fc1453be0795e4ba5f0252627ebba3 (patch)
tree743f0b1b5cf356bf018b5619619edd362dcdd0a8 /lib/PublicInbox/DummyInbox.pm
parent48180dbb004b5f59b2e80613b6fa2e5e869316f1 (diff)
downloadpublic-inbox-cfae078171fc1453be0795e4ba5f0252627ebba3.tar.gz
Finish up the IMAP-only portion of iterative config reloading,
which allows us to create all sub-ranges of an inbox up front.
The InboxIdler still uses ->each_inbox which will struggle with
100K inboxes.

Having messages in the top-level newsgroup name of an inbox will
still waste bandwidth for clients which want to do full syncs
once there's a rollover to a new 50K range.  So instead, make
every inbox accessible exclusively via 50K slices in the form of
"$NEWSGROUP.$UID_MIN-$UID_END".

This introduces the DummyInbox, which makes $NEWSGROUP
and every parent component a selectable, empty inbox.
This aids navigation with mutt and possibly other MUAs.

Finally, the xt/perf-imap-list maintainer test is broken, now,
so remove it.  The grep perlfunc is already proven effective,
and we'll have separate tests for mocking out ~100k inboxes.
Diffstat (limited to 'lib/PublicInbox/DummyInbox.pm')
-rw-r--r--lib/PublicInbox/DummyInbox.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/PublicInbox/DummyInbox.pm b/lib/PublicInbox/DummyInbox.pm
new file mode 100644
index 00000000..e38f9e5a
--- /dev/null
+++ b/lib/PublicInbox/DummyInbox.pm
@@ -0,0 +1,21 @@
+# Copyright (C) 2020 all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+#
+# An EXAMINE-able, PublicInbox::Inbox-like object for IMAP.  Some
+# IMAP clients don't like having unselectable parent mailboxes,
+# so we have a dummy
+package PublicInbox::DummyInbox;
+use strict;
+
+sub created_at { 0 } # Msgmap::created_at
+sub mm { shift }
+sub max { undef } # Msgmap::max
+sub msg_range { [] } # Msgmap::msg_range
+
+no warnings 'once';
+*query_xover = \&msg_range;
+*over = \&mm;
+*subscribe_unlock = *unsubscribe_unlock =
+        *get_art = *description = *base_url = \&max;
+
+1;