LEI-OVERVIEW(7)
π
lei-overview β okay bestie, let's talk about lei
so this page is from the public-inbox user manual and it's literally your starter pack for lei, iykyk π«Ά
β¨ NAME β¨
lei β an overview of lei (yes that's the whole name section, she's brief and iconic)
πΈ DESCRIPTION πΈ
okay so lei(1) is a local email interface for public-inbox and your personal mail. That's the whole vibe. This doc is just here to hand you some basic examples so you can get going π
π LEI STORE π
lei has writable local storage, and it's based on public-inbox-v2-format(5). No cap.
Commands will automatically initialize the store behind the scenes if it's needed β like, it just does it for you, you don't have to ask. But if you want your store somewhere other than the default "$XDG_DATA_HOME/lei/store", you can call lei-init(1) directly. Main character energy fr fr.
lei-import(1) is the primary interface for importing messages into the local storage. And on top of that, other commands β like lei-q(1) and lei-blob(1) β use the local store to memoize messages from remotes. Slay.
β EXAMPLES β
$ lei import mboxrd:t.mbox.gzβ Import the messages from a gzipped mboxrd into the local storage. Easy.$ lei blob 59ec517f9β Show the message with the git blob OID of59ec517f9. And if a message with that OID isn't found? Check if the current git repository has the blob, and it'll try to reconstruct it from a message if needed. Resourceful queen π$ lei blob 59ec517f9 | lei tag -F eml +kw:flagged +L:nextβ Set the"flagged"keyword and"next"label on the message with the blob OID of59ec517f9. Look at her go π
π¦ EXTERNALS π¦
so besides that store up there, lei can also make read-only queries to "externals" β which is the cute word for inboxes and external indices.
You register an external by passing a URL or a local path to lei-add-external(1). And for existing local paths? The external needs to be indexed with public-inbox-index(1) (if it's a regular inbox) or public-inbox-extindex(1) (if it's an external index). Don't skip that step bestie, it's giving necessary π₯
π SYNCHRONIZATION π
ngl, lei currently has primitive mail synchronization abilities β like, it works, it's just baby steps. See lei-mail-sync-overview(7) for more details π§
π EXAMPLES π
$ lei add-external https://public-inbox.org/meta/β Add a remote external for public-inbox's inbox. Boom, done.$ lei add-external --mirror https://public-inbox.org/meta/ pathβ Clone <https://public-inbox.org/meta/> to"path", index it withpublic-inbox-index(1), and add it as a local external. Three-in-one, we love efficiency β
π₯ SEARCHING π₯
The lei-q(1) command searches the local store and externals. The search prefixes match those available via public-inbox-httpd(1). Same energy, same syntax π
π EXAMPLES π
$ lei q s:lei s:skeletonβ Search for messages whose subject includes"lei"and"skeleton".$ lei q -t s:lei s:skeletonβ Do the same, but also report unmatched messages that are in the same thread as a matched message. Thread-aware queen π$ lei q -t -o /tmp/mdir --mua=mutt s:lei s:skeletonβ Write results to a Maildir at"mdir". Mutt will be invoked to open mfolder (mutt -f %f) while results are being fetched and written. Multitasking icon.$ lei q kw:flagged L:nextβ Search for all flagged messages that also have a"next"label. Filtered and fabulous β¨$ lei p2q HEAD | lei q -tt -o /tmp/mdirβ Search for messages that have post-image git blob IDs matching those of the current repository'sHEADcommit, write them to the Maildir directory"mdir", and flag the messages that were an exact match. That's a pipeline, bestie π$ git show -s HEAD | lei lcatβ Display a local message for the public-inbox link contained in a commit message. Cute.$ lei q -f text m:MESSAGE-ID | lei rediff -U5β Feed a message containing a diff tolei-rediff(1)to regenerate its diff with five context lines. β οΈ heads up: unless--git-diris specified, this requires the current working directory to be within the associated code repository. No wandering off π«Ά
π PERFORMANCE NOTES π
Inline::Cis required on BSDs, and it can speed things up on Linux. Required vs. nice-to-have, know the difference.leiruns as a background daemon to reduce startup costs, and it can provide real-timekqueue(2)/inotify(7)Maildir monitoring. For that you wantIO::KQueue(p5-IO-KQueueon FreeBSD) andLinux::Inotify2(liblinux-inotify2-perlandperl-Linux-Inotify2in.deband.rpm-based distros, respectively) β they're recommended, so like, get them if you can πΈSocket::MsgHdris optional (libsocket-msghdr-perlin Debian), and it further improves startup performance. Its effect is most felt when you're using shell completion. So if completion feels slow, that's your girl π
π§ BASH COMPLETION π§
Preliminary Bash completion for lei is provided in "contrib/completion/". And listen β contributions adding support for other shells, plus improvements to the existing Bash completion, are welcome. Come through, contributors π«Ά
π UPGRADING π
Since lei runs as a daemon, lei-daemon-kill(1) is required to kill the daemon so it can load new code. You can't just... not do it. It will be restarted with the next invocation of any lei command, so she comes right back π₯
π CAVEATS π
IMAP and NNTP client performance is poor on high-latency connections. It will hopefully be fixed in 2022. (yes, that's what it says. we're all rooting for her π)
ngl this one's a real caveat, not a vibe β if you're on a high-latency connection, expect IMAP and NNTP to be slow.
π CONTACT π
Feedback welcome via plain-text mail to <mailto:meta@public-inbox.org> π
The mail archives are hosted at <https://public-inbox.org/meta/> and <http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/> π¦
π COPYRIGHT π
Copyright all contributors <mailto:meta@public-inbox.org>
License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
π SEE ALSO π
lei-mail-sync-overview(7)β go read it, bestie, that's the whole pointer π
okay that's the page!! this one's from public-inbox.git, dated 1993-10-02, and that's your whole overview β now go import something and slay β¨ππ
π¦ where this page comes from
- arch rolling: lei 2.1.0-2 Β· AGPL
- nixos 26.05: perl5.42.3-public-inbox 2.1.0
- nixpkgs unstable: perl5.42.3-public-inbox 2.1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms