larzimap
The read side: search and fetch mail over real IMAP.
Shells out to curl - curl has real, mature IMAP/IMAPS support, the same 'shell out to a real tool' pattern http and smtp use. The read-side counterpart to smtp (send) and email (build/parse): fetch() returns the same raw RFC822 text email.parse() already knows how to read, so the two compose with no glue code. search() uses UID SEARCH, so every id it returns is safe to hand straight to fetch().
larzscript pkg install imap
What you get
- Real IMAP/IMAPS via curl, no library needed
- UID SEARCH - ids are always safe to fetch()
- fetch() output composes directly with email.parse()
- status()/list_mailboxes() for account introspection
Try it
import "imap" as imap
let cfg = {"host": "127.0.0.1", "port": 1, "user": "a@example.com", "password": "x"}
print("status on an unreachable host:", imap.status(cfg, "INBOX"))
print("search on an unreachable host:", imap.search(cfg, "INBOX", "ALL"))Output
status on an unreachable host: {}
search on an unreachable host: []Why it's in the Larz Stack
larzimap is a real Larzscript package (larzscript pkg install imap) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.