lei-mail-sync-overview(7)

lei-mail-sync-overview7

An overview of lei mail synchronization

Overview

lei(1) provides several plumbing-level commands to synchronize mail and keywords (flags) between lei/store and existing IMAP and Maildir stores. Nothing documented in this manpage is required for day-to-day use against externals.

Mail and keyword synchronization is currently a clunky process. Future work will be done to improve it and add IMAP IDLE support.

Typical workflow

  # import mail from a user's IMAP inbox and give it the "inbox" label:
  lei import +L:inbox imaps://[email protected]/INBOX
  # dump "inbox" labeled files from the past week to a Maildir
  lei q L:inbox rt:last.week.. -o /tmp/results
  # Open /tmp/results in your favorite mail agent.  If inotify or kevent
  # works, keyword changes (e.g. marking messages as `seen') are
  # synchronized automatically.
  # If the inotify queue overflows, or if lei-daemon crashes,
  # "lei index" will tell lei about keyword changes:
  lei index /tmp/results
  # Optional: cleanup stale entries from mail_sync.sqlite3
  lei refresh-mail-sync /tmp/results
  # to export keyword changes back to IMAP
  lei export-kw imaps://[email protected]/INBOX

Contact

Feedback welcome via plain-text mail to <mailto:[email protected]>

The mail archives are hosted at <https://public-inbox.org/meta/> and <http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>

Releases

3 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12–13
  2. Arch

From lei 2.1.0-2 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.