Lei, the Local Email Interface

If you subscribe to Linux mailing lists in 2023, you're doing it wrong.

Intro

The Linux kernel mailing lists are known to be high volume, and it’s easy to fill your email storage space with them. But if you are anyway reading your mail locally, there is a better option where you simply synchronize your local mail storage with the public mailing list archives.

The lei program lets you import Linux mailing list archives into local maildirs:

public-inbox at lore.kernel.org 2. query lei 3. store local maildir  1. lei up --all user

The server side needs to run the public-inbox software.

Set up

First, create a directory for your maildirs:

mkdir -p .Mail/lei

Arch Linux installs lei into an unusual location. In this case, add this to .bashrc:

alias lei=/usr/bin/vendor_perl/lei

Subscription/Search management

Subscribe to various mailing lists and to the mails that go to yourself (Query Language):

# Linux Security Module list
lei q --only=https://lore.kernel.org/linux-security-module \
      --output="${HOME}/.Mail/lei/lsm"                     \
      'rt:12.months.ago..'

# Linux Man Pages list
lei q --only=https://lore.kernel.org/linux-man \
      --output="${HOME}/.Mail/lei/man"         \
      'rt:12.months.ago..'

# Mails where I am in To: or Cc:, and the surrounding threads
lei q --only=https://lore.kernel.org/all \
      --output="${HOME}/.Mail/lei/tome"  \
      --threads                          \
      'a:myemail@example.com rt:36.months.ago..'

The lei q command is not issuing a single-shot query, but it is storing the query locally as a subscription.

These subscriptions are called “searches” in lei lingo, and their results are stored in the given maildir directories.

To see all the searches you have, use:

lei ls-search

To remove an existing search, use

lei forget-search "${HOME}/.Mail/lei/lsm"  # example

Regularly: Update subscriptions/searches

To update all lei subscriptions and populate new content into the maildirs:

lei up --all

Now you are all set, and you can read the mailing lists with the MUA of your choice:

mutt -f ~/.Mail/lei/lsm

References

Thanks to derkling, who pointed me to lei!

Comments