Expand description
SMTP send + IMAP fetch transport for the semantic mail client.
This module is the network edge for mail: it puts bytes on the wire (SMTP over
STARTTLS) and pulls unseen messages off it (IMAP over implicit TLS). It deliberately does
not make delivery decisions — those belong to the pure rules layer in
crate::mail_rules. The bridge between the two is build_inbound, a pure function that
constructs the crate::mail_rules::InboundMessage envelope the rules engine consumes; the
IMAP path uses it to turn each fetched message into something crate::mail_rules::evaluate
can rule on.
Network functions are gated #[cfg(not(target_arch = "wasm32"))] — there is no raw-socket
SMTP/IMAP on the wasm32 target, so only the pure surface (SmtpConfig, ImapConfig,
OutgoingMail, build_inbound) compiles there.
All fallible network functions map their underlying errors to String so callers get a flat,
transport-agnostic error surface.
Structs§
- Imap
Config - Connection + credentials for an inbound IMAP server (implicit TLS on the IMAPS port).
- Outgoing
Mail - A message to be sent via
send. - Smtp
Config - Connection + credentials for an outbound SMTP submission server (STARTTLS on the submission port).
Functions§
- build_
inbound - Construct an
InboundMessageenvelope for the rules engine. - fetch_
unseen - Fetch the unseen messages from
mailboxon the IMAP server described bycfg(implicit TLS). - send
- Send
mailthrough the SMTP submission server described bycfg(STARTTLS).