Expand description
IMAP server implementation
This module implements an IMAP (Internet Message Access Protocol) server that allows LLM control over email retrieval and mailbox management.
Key points:
- IMAP4rev1 commands parsed by hand into (tag, command, args). There is no
imap-codecand no grammar: anything the split does not model (literals, continuations, quoting) is passed to the model as raw text. - Session state management (NotAuthenticated -> Authenticated -> Selected -> Logout)
- Plain TCP only. An
ImapServer::spawn_with_tlsused to sit here advertising IMAPS on 993; nothing called it and it could not have worked - it fed a concatenated PEM string toIdentity::from_pkcs12, which only accepts DER PKCS#12 - so it was removed rather than left as an implemented-looking feature. - No mailbox storage: the model answers LIST/FETCH/SEARCH from its instruction and memory.
Modules§
- actions
- IMAP protocol actions implementation
Structs§
- Imap
Server - IMAP server that handles mail retrieval with LLM
Constants§
- DEFAULT_
CAPABILITIES - The capability list NetGet answers
CAPABILITYwith when the greeting announced none. - MAX_
COMMAND_ BYTES - Largest single command line the server will buffer before refusing the peer.
Functions§
- greeting_
capabilities - The capability list a greeting announced in its
[CAPABILITY ...]response code, withIMAP4rev1guaranteed first;Nonewhen the greeting carried no such code. - imap_
answer_ with - Which action answers one IMAP command, or
Nonewhen the command’s name does not say. - retag_
completion - Does this payload contain the tagged
OKcompletion fortag? - with_
imap4rev1 listwithIMAP4rev1first and not repeated. RFC 3501 6.1.1: the list MUST include it, and imaplib refuses a server whose list does not.