Lei, the Local Email Interface

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

Intro

When I came back to the email account where I first subscribed to LKML, it was full.

But if you are anyway using a local email client like mutt, there is a better option than subscribing via email: 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