lei-store-format - Man Page

lei/store format description

Description

lei/store is a hybrid store based on public-inbox-extindex-format(5) ("extindex") combined with public-inbox-v2-format(5) ("v2") for blob storage.  While v2 is ideal for archiving a single public mailing list; it was never intended for personal mail nor storing multiple blobs of the "same" message.

As with extindex, it can index disparate List-Id headers belonging to the "same" message with different git blob OIDs. Unlike v2 and extindex, Message-ID headers are NOT required; allowing unsent draft messages to be stored and indexed.

Directory Layout

Blob storage exists in the form of v2-style epochs.  These epochs are under the local/ directory (instead of git/) to prevent them from being accidentally treated as a v2 inbox.

Index Overview and Definitions

  $EPOCH - Integer starting with 0 based on time
  $SCHEMA_VERSION - DB schema version (for Xapian)
  $SHARD - Integer starting with 0 based on parallelism

  ~/.local/share/lei/store
  - local/$EPOCH.git                # normal bare git repositories
  - mail_sync.sqlite3               # sync state IMAP, Maildir, NNTP

Additionally, the following share the same roles they do in extindex:

  - ei.lock                         # lock file to protect global state
  - ALL.git                         # empty, alternates for local/*.git
  - ei$SCHEMA_VERSION/$SHARD        # per-shard Xapian DB
  - ei$SCHEMA_VERSION/over.sqlite3  # overview DB for WWW, IMAP
  - ei$SCHEMA_VERSION/misc          # misc Xapian DB

Xref3 Deduplication

Index deduplication follows extindex, see "XREF3 DEDUPLICATION" in public-inbox-extindex-format(5) for more information.

Blob Deduplication

The contents of local/*.git repos is deduplicated by git blob object IDs (currently SHA-1).  This allows multiple copies of cross-posted and personally Cc-ed messages to be stored with different Received:, X-Spam-Status: and similar headers to allow troubleshooting.

Volatile Metadata

Keywords and label information (as described in RFC 8621 for JMAP) is stored in existing Xapian shards (ei$SCHEMA_VERSION/$SHARD). It is possible to search for messages matching labels and keywords using L: and kw:, respectively.  As with all data stored in Xapian indices, volatile metadata is associated with the Xapian document, thus it is shared across different blobs of the "same" message.

mail_sync.sqlite3

This SQLite database maintained for bidirectional mapping of git blobs to IMAP UIDs, Maildir file names, and NNTP article numbers.

It is also used for retrieving messages from Maildirs indexed by lei-index(1).

Ipc

lei-daemon(8) communicates with the lei/store process using unix(7) SOCK_SEQPACKET sockets.

Caveats

Reindexing and synchronization is not yet supported.

Thanks

Thanks to the Linux Foundation for sponsoring the development and testing.

See Also

public-inbox-v2-format(5), public-inbox-extindex(5)

Referenced By

lei(1), lei-import(1), lei-index(1), lei-rm(1).

1993-10-02 public-inbox.git public-inbox user manual