LEI-SECURITY(7)
π LEI-SECURITY(7) π
okay so this is LEI-SECURITY(7), from the public-inbox user manual, and it's literally the security tea you need before running lei(1). Bestie, read this before you go importing your whole mailbox, no cap. π«Ά
π‘οΈ NAME π‘οΈ
lei β security information. That's the whole name section, short and iconic. β¨
πΈ SYNOPSIS πΈ
lei(1) is intended for use with both publicly archived mail and "private" mail in personal mailboxes. This document is here to give you an overview of the security implications and to lower^Wmanage user expectations. Yes, that's exactly how it's written β we keep the lore. π
π DESCRIPTION π
lei expects to be run as a regular user on a Unix-like system. It expects a case-sensitive filesystem with standard Unix permissions support. π
It does not use POSIX ACLs, extended attributes, nor any other security-related functions which require non-standard Perl modules. Good vibes only, standard modules only. π
There's preliminary support for "virtual users", but it's incomplete and undocumented. It's giving "work in progress", so don't build your whole security model on it. π¦
π§ INTERNAL FILES π§
lei runs with a umask of 077 to prevent other users on the system from accessing each other's mail. Protect the group chat, periodt. π
- The git storage and Xapian databases are located at
$XDG_DATA_HOME/lei/store(typically~/.local/share/lei/store). Any personal mail imported will reside here, so this should be on an encrypted filesystem or block device. π₯ $XDG_RUNTIME_DIR/lei(typically/run/user/$UID/leior/tmp/lei-$UID) contains the socket used to access theleidaemon. It must only be accessible to the owner (mode0700). π$XDG_CACHE_HOME/lei(typically~/.cache/lei) will contain IMAP and Maildir folder names which could leak sensitive information as well as git repository names. π$XDG_DATA_HOME/lei/saved-searches(typically~/.local/share/lei/saved-searches) will contain aforementioned folder names as well as (removable) search history. π- The configuration for
leiresides at$XDG_CONFIG_HOME/lei/config(typically~/.config/lei/config). It may contain sensitive pathnames and hostnames in the config if a user chooses to configure them. π
lei itself will never write credentials to the filesystem. However, git-credential(1) may be configured to do so. lei will only read ~/.netrc if --netrc is used (and it will never write to ~/.netrc). Slay for that boundary. β¨
$XDG_CACHE_HOME/public-inbox (typically ~/.cache/public-inbox) can contain data and Inline::C-built modules which can be shared with public-facing public-inbox-daemon(8) instances; so no private data should be in public-inbox paths. That's the whole rule, bestie: public means public. π«Ά
π¦ EXTERNAL FILES π¦
Locations set by lei-add-external(1) can be shared with public-facing public-inbox-daemon(8) processes. They may reside on shared storage and may be made world-readable to other users on the local system. So likeβ¦ check before you assume your external is private, iykyk. π
π CORE DUMPS π
In case any process crashes, a core dump may contain passwords or contents of sensitive messages. Please report these so they can be fixed (see CONTACT). Not me begging you to file the bug, but also literally me begging you to file the bug. π
π NETWORK ACCESS π
lei currently uses the curl(1) and git(1) executables in $PATH for HTTP and HTTPS network access. Interactive authentication for HTTP and HTTPS is not yet supported since all currently supported HTTP/HTTPS sources are PublicInbox::WWW instances. β¨
The Mail::IMAPClient library is used for IMAP and IMAPS. Net::NNTP (standard library) is used for NNTP and NNTPS. πΈ
Mail::IMAPClient and Net::NNTP will use IO::Socket::SSL for TLS if available. In turn, IO::Socket::SSL uses the widely installed OpenSSL library. Look at the ecosystem doing its thing. π
STARTTLS will be attempted if advertised by the server unless IMAPS or NNTPS are used. -c imap.starttls=0 and -c nntp.startls=0 may be used to disable STARTTLS. Copy that nntp.startls=0 exactly, bestie β not me trying to "fix" the spelling, that's the documented flag. π
IO::Socket::Socks will be used if -c imap.proxy or -c nntp.proxy point to a socks5h://$HOST:$PORT address (common for Tor). π§
The --netrc switch may be passed to curl and used for NNTP/IMAP access (via Net::Netrc). π
π CREDENTIAL DATA π
lei uses git-credential(1) to prompt users for IMAP and NNTP usernames and passwords. These passwords are not encrypted in memory and get transferred across processes via anonymous UNIX sockets and pipes. They may be exposed via syscall tracing tools (e.g. strace(1)), kernel and hardware bugs/attacks. This is the part where we take a deep breath. π
While credentials are not written to the filesystem by default, it is possible for them to end up on disk if processes are swapped out. Use of an encrypted swap partition is recommended. Please protect the swap, bestie. π
π AUTHENTICATION METHODS π
LOGIN (username + password) is known to work over IMAP(S), as does AUTH=ANONYMOUS (which is used by public-inbox-imapd(1) as part of our test suite). AUTHINFO may work for NNTP, but is untested. Testers will be needed for other authentication methods. Come through, testers. π«Ά
π DENIAL-OF-SERVICE VECTORS π
lei uses the same MIME parsing library as public-inbox-mda(1) with limits header sizes, parts, nesting and boundary limits similar to those found in SpamAssassin and postfix. Defense in depth, but make it mail parsing. π‘οΈ
Email address parsing is handled by Email::Address::XS if available, but may fall back to regular expressions which favor speed and predictable execution times over correctness. It's giving "fast and predictable", not "always right". No cap. π
π ENCRYPTED EMAILS π
Not yet supported, but it should eventually be possible to configure decryption and indexing of encrypted messages and attachments. When supported, decrypted terms will be stored in Xapian DBs under $XDG_DATA_HOME/lei/store. Future feature alert, but until then: not yet supported. π¦
π 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 β
source: public-inbox.git Β· date: 1993-10-02 β that's the footer tea, bestie, bye! πβ¨π«Ά
π¦ 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