about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2018-03-29mda: support v2 inboxes
I mainly focus on -watch for mirroring busy mailing lists, but using -mda should remain an option.
2018-03-29v2writable: initializing an existing inbox is idempotent
And we do not want to start making confused repos if somebody leaves out "-V2" the second time around.
2018-03-29import: run_die supports redirects as spawn does
We'll be using it in more future tests and scripts.
2018-03-29search: retry_reopen on first_smsg_by_mid
This was causing errors while attempting to load messages via the WWW interface while mass-importing LKML. While we're at it, remove unnecessary eval from lookup_article.
2018-03-29view: get rid of some unnecessary imports
We no longer need some of these old subroutines which assumed a single Message-ID for each message.
2018-03-29www: cleanup expensive fallback for legacy URLs
Back in the day, we compressed long Message-IDs to SHA-1 hexdigests for the URL. This now redirects to a 301 in the hopes we can remove these checks some day to reduce overhead.
2018-03-29mbox: avoid extracting Message-ID for linkification
We can avoid a small amount of overhead and use the "preferred" Message-ID based on what is in the SearchMsg object.
2018-03-29v2writable: cleanup: get rid of unused fields
The layout of this structure ended up being a bit different and the read-only access is handled through the ::Inbox class, instead.
2018-03-29search: move find_doc_ids to searchidx
We do not need this subroutine for read-only use in Search.pm
2018-03-29search: get rid of most lookup_* subroutines
Too many similar functions doing the same basic thing was redundant and misleading, especially since Message-ID is no longer treated as a truly unique identifier. For displaying threads in the HTML, this makes it clear that we favor the primary Message-ID mapped to an NNTP article number if a message cannot be found.
2018-03-29search: cleanup uniqueness checking
The only Xapian term which should be unique is the NNTP article number; so we no longer need find_unique_doc_id.
2018-03-29v2writable: support purging messages from git entirely
Purging existing messages is fairly straightforward since we can take advantage of Xapian and lookup the git object_id with it. Unfortunately, purging an already "removed" message (which is no longer in Xapian) is not as easy and we'll need to expose ->purge_oids to purge by the git object_id (currently SHA-1). Furthermore, we expire reflogs and prune in hopes a dumb HTTP client won't get the object.
2018-03-29searchmsg: document why we store To: and Cc: for NNTP
Otherwise I would forget and be tempted to remove them.
2018-03-29www: fix attachment downloads for conflicted Message-IDs
By using the "primary" Message-ID in WwwAttach, we can avoid conflicts in the links we use for downloading attachments.
2018-03-29lookup by Message-ID favors the "primary" one
The Message-ID mapped to an NNTP article number is stronger, so we will favor that for attachment lookups.
2018-03-29v2writable: append, instead of prepending generated Message-ID
The original Message-ID is still the most important when discussing with other recipients who do not rely on a message flowing through public-inbox. So whatever Message-ID we use to deduplicate internally will be secondary and less important. All of our front-end v2 code is order-independent, so we won't let the message count against us, that way.
2018-03-29www: remove unnecessary ghost checks
We do not need to care about ghosts at multiple call sites; they cannot have a {blob} field and we've stored the blob field in Xapian since SCHEMA_VERSION=13.
2018-03-27www: support cloning individual v2 git partitions
This will require multiple client invocations, but should reduce load on the server and make it easier for readers to only clone the latest data. Unfortunately, supporting a cloneurl file for externally-hosted repos will be more difficult as we cannot easily know if the clones use v1 or v2 repositories, or how many git partitions they have.
2018-03-27githttpbackend: avoid infinite loop on generic PSGI servers
We must detect EOF when reading a POST body with standard PSGI servers. This does not affect deployments using the standard public-inbox-httpd; but most smaller inboxes should be able to get away using a generic PSGI server.
2018-03-27http: fix modification of read-only value
This fails in the rare case we get a partial send() on "\r\n" when writing chunked HTTP responses out.
2018-03-27view: depend on SearchMsg for Message-ID
Since we need to handle messages with multiple and duplicate Message-ID headers, our thread skeleton display must account for that. Since we have a "preferred" Message-ID in case of conflicts, use it as the UUID in an Atom feed so readers do not get confused by conflicts.
2018-03-27searchview: remove unnecessary imports from MID module
We do not need many of these, anymore.
2018-03-27www: get rid of unnecessary 'inbox' name reference
We use the actual Inbox object everywhere else and don't need the name of the inbox separated from the object.
2018-03-27v2writable: warn on unseen deleted files
It would be a bug to have deleted files marked but not seen in our histories.
2018-03-27searchidx: warn about vivifying multiple ghosts
This should help us detect bugs sooner in case we have space waste problems.
2018-03-27view: permalink (per-message) view shows multiple messages
This needs tests and further refinement, but current tests pass.
2018-03-23feed: fix new.html for v2
I forget this endpoint is still accessible (even if not linked). This also simplifies new.html all around and removes some unused clutter from the old days while we're at it.
2018-03-23search: reopen DB if each_smsg_by_mid fails
This gives more-up-to-date data in case and allows us to avoid reopening in more places ourselves.
2018-03-23www: $MESSAGE_ID/raw endpoint supports "duplicates"
Since v2 supports duplicate messages, we need to support looking up different messages with the same Message-Id. Fortunately, our "raw" endpoint has always been mboxrd, so users won't need to change their parsing tools.
2018-03-22import: consolidate mid prepend logic, here
This also quiets down warnings from -watch when spam training happens on messages without Message-Id.
2018-03-22feed: $INBOX/new.atom endpoint supports v2 inboxes
We can no longer rely on tree name lookups for v2. This also optimizes v1 by relying on git blob object_id lookups while avoiding process spawning overhead for "git log".
2018-03-22v2writable: DEBUG_DIFF respects $TMPDIR
The File::Temp API is a bit tricky and needs TMPDIR explicitly enabled if a template is given.
2018-03-22v2writable: clarify header cleanups
We want to make it clear to the code and DEBUG_DIFF users that we do not introduce messages with unsuitable headers into public archives.
2018-03-22v2writable: add NNTP article number regeneration support
Allow best-effort regeneration of NNTP article numbers from cloned git repositories in addition to indexing Xapian Article numbers will not remain consistent when we add purge support, though.
2018-03-22v2writable: support reindexing Xapian
This still requires a msgmap.sqlite3 file to exist, but it allows us to tweak Xapian indexing rules and reindex the Xapian database online while -watch is running.
2018-03-22fix syntax warnings
I keep forgetting to run "make syntax"
2018-03-22msgmap: add tmp_clone to create an anonymous copy
This will be used to keep track of Message-ID <-> NNTP Article numbers to prevent article number reuse when reindexing.
2018-03-22use both Date: and Received: times
We want to rely on Date: to sort messages within individual threads since it keeps messages from git-send-email(1) sorted. However, since developers occasionally have the clock set wrong on their machines, sort overall messages by the newest date in a Received: header so the landing page isn't forever polluted by messages from the future. This also gives us determinism for commit times in most cases, as we'll used the Received: timestamp there, as well.
2018-03-20InboxWritable: add mbox/maildir parsing + import logic
This will make it easier to as well as supporting future Filter API users. It allows simplifying our ad-hoc import_vger_from_mbox script.
2018-03-20import: discard all the same headers as MDA
Reduce the places where we have duplicate logic for discarding unwanted headers.
2018-03-20introduce InboxWritable class
This code will be shared with future mass-import tools.
2018-03-20content_id: do not take Message-Id into account
If we need to use content_id, we've already lost hope in relying on Message-Id as a differentiator. This prevents duplicates from showing up repeatedly with -watch when Message-Ids are reused and we generate new Message-Ids to disambiguate.
2018-03-19v2writable: remove "resent" message for duplicate Message-IDs
public-inbox-watch gets restarted on reboots and whatnot, so it could get pointlessly noisy. This message was only useful during initial development and imports.
2018-03-19v2writable: add DEBUG_DIFF env support
This can help us track down some differences during import, if needed.
2018-03-19v2writable: allow disabling parallelization
While parallel processes improves import speed for initial imports; they are probably not necessary for daily mail imports via WatchMaildir and certainly not for public-inbox-init. Save some memory for daily use and even helps improve readability of some subroutines by showing which methods they call remotely.
2018-03-19searchidxpart: s/barrier/remote_barrier/
Be consistent with our "remote_" prefix for other IPC subs
2018-03-19watchmaildir: support v2 repositories
Unfortunately this gives up some minor performance tweaks we made to avoid reforking import processes.
2018-03-19v2writable: ensure ->done is idempotent
This matches Import::done behavior
2018-03-19Lock: new base class for writable lockers
This reduces code duplication needed for locking and and hopefully makes things easier to understand.
2018-03-19import: enable locking under v2
Instead of using ssoma-based locking, enable locking via Import for now.