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 πŸ”₯

  1. lei import +L:inbox imaps://user@example.com/INBOX β€” pull mail from a user's IMAP inbox and hand it the "inbox" label πŸ‘‘
  2. 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 πŸ“
  3. Open /tmp/results in your favorite mail agent πŸ’– if inotify or kevent is working, keyword changes (like marking messages as seen) get synchronized automatically. main character behavior honestly
  4. If the inotify queue overflows, or if lei-daemon crashes 😭, lei index /tmp/results will tell lei about the keyword changes. literally your safety net
  5. Optional but cute: lei refresh-mail-sync /tmp/results cleans up stale entries from mail_sync.sqlite3 🧚
  6. 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 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