---
name: "lei-daemon"
section: "8"
platform: "linux"
package: "lei"
version: "2.1.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/lei-daemon"
---

# lei-daemon(8)

technical information for local email interface daemon

## NAME

lei-daemon - technical information for local email interface daemon

## DESCRIPTION

This documentation is a high-level overview for developers and administrators interested in how lei works.

lei-daemon is a background daemon which powers the [**lei**(1)](/lei/1.md) command-line tool.  It may support virtual users and read-write IMAP+JMAP APIs in the future.  It is designed to optimize shell completion by avoiding module loading costs, monitor Maildirs (and in the near future, IMAP folders) for changes.

### worker processes

Most commands cause lei-daemon to [**fork**(2)](/fork/2.md) new worker processes to isolate and parallelize work.  lei-daemon is significantly more aggressive than read-only [**public-inbox-daemon**(8)](/public-inbox-daemon/8.md) processes with regards to resource use since it's not designed to support C10K/C100K scenarios.

### file descriptor passing

FD passing is used to reduce IPC costs for bulk I/O when importing large mboxes from stdin and dumping large mboxes to stdout.

### SOCK\_SEQPACKET

SOCK\_SEQPACKET sockets are used for both communicating with [**lei**(1)](/lei/1.md) and to internal workers.  SOCK\_SEQPACKET guarantees reliability (unlike SOCK\_DGRAM), allows easy load distribution, and saves developers the trouble of maintaining stream parsers.

### file monitoring

Inotify or EVFILT\_VNODE is used depending on the platform to monitor Maildirs for changes and track keyword changes.

The listen socket (default: `"$XDG_RUNTIME_DIR/lei/5.seq.sock"`) is also monitored, and the daemon will automatically shutdown if it is unlinked.

## 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-overview**(7)](/lei-overview/7.md), [**lei-daemon-kill**(1)](/lei-daemon-kill/1.md), [**lei-daemon-pid**(1)](/lei-daemon-pid/1.md)
