Lei, the Local Email Interface
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:
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
- lore+lei: part 1, getting started
- lore+lei, part 2, now with IMAP
- LWN: Digging into the community’s lore with lei
Thanks to derkling, who pointed me to lei
!