LEI-MAIL-SYNC-OVERVIEW(7)
π LEI-MAIL-SYNC-OVERVIEW(7) β the lei mail sync vibe check β¨
okay bestie, so this is the overview page for lei mail synchronization β lei itself lives over in lei(1), and this page is all about the syncing situation π
πΈ DESCRIPTION πΈ
So lei(1) has a bunch of plumbing-level commands whose whole job is syncing mail and keywords (that's flags to you and me π
) between lei/store and your existing IMAP and Maildir stores. Slay.
But listen β nothing documented on this manpage is required for day-to-day use against externals. Like, zero. You do not need any of this to just live your life π«Ά
Also, ngl, mail and keyword synchronization is currently a clunky process π. Future work is gonna happen to make it better and to add IMAP IDLE support. It's giving "we're working on it."
β¨ TYPICAL WORKFLOW β¨
Here's the iconic path from zero to synced, no cap:
# import mail from a user's IMAP inbox and give it the "inbox" label:
lei import +L:inbox imaps://user@example.com/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://user@example.com/INBOX
Let me break that down, because the way that this flow eats π₯
lei import +L:inbox imaps://user@example.com/INBOXβ pull mail from a user's IMAP inbox and hand it the"inbox"label πlei q L:inbox rt:last.week.. -o /tmp/resultsβ dump the"inbox"-labeled files from the past week into a Maildir at/tmp/resultsπ- Open
/tmp/resultsin your favorite mail agent π ifinotifyorkeventis working, keyword changes (like marking messages asseen) get synchronized automatically. main character behavior honestly - If the
inotifyqueue overflows, or iflei-daemoncrashes π,lei index /tmp/resultswill tellleiabout the keyword changes. literally your safety net - Optional but cute:
lei refresh-mail-sync /tmp/resultscleans up stale entries frommail_sync.sqlite3π§ - And to export keyword changes back to IMAP:
lei export-kw imaps://user@example.com/INBOXπ
π CONTACT π
Feedback is welcome, fr fr β 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/> β yes that second one is a whole onion address, iykyk π§
π COPYRIGHT π
Copyright all contributors <mailto:meta@public-inbox.org>
License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> β read it, love it, respect it π
π¦ SEE ALSO π¦
okay that's the whole page bestie, go forth and sync πΈπβ¨
public-inbox.git β 1993-10-02 β LEI-MAIL-SYNC-OVERVIEW(7) π¦ mwah, catch you in the group chat π
π¦ 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