refactor(channel): replace hand-rolled IMAP with async-imap IDLE
Replace the blocking, poll-based IMAP client with async-imap and IMAP IDLE (RFC 2177) for instant push delivery. Key changes: - Add async-imap dependency with tokio runtime feature - Rewrite connect/fetch/listen paths to fully async using tokio TLS - Implement IDLE loop with exponential backoff reconnection (1s–60s cap) - Add idle_timeout_secs config field (default 1740s per RFC 2177) - Convert health_check to async connect-and-logout with 10s timeout - Update affected tests from sync to #[tokio::test] SMTP send path, allowlist enforcement, and Channel trait contract are unchanged.
This commit is contained in:
parent
08ea559c21
commit
5d9e8705ac
3 changed files with 474 additions and 236 deletions
|
|
@ -99,13 +99,16 @@ futures-util = { version = "0.3", default-features = false, features = ["sink"]
|
|||
futures = "0.3"
|
||||
regex = "1.10"
|
||||
hostname = "0.4.2"
|
||||
lettre = { version = "0.11.19", default-features = false, features = ["builder", "smtp-transport", "rustls-tls"] }
|
||||
mail-parser = "0.11.2"
|
||||
rustls = "0.23"
|
||||
rustls-pki-types = "1.14.0"
|
||||
tokio-rustls = "0.26.4"
|
||||
webpki-roots = "1.0.6"
|
||||
|
||||
# email
|
||||
lettre = { version = "0.11.19", default-features = false, features = ["builder", "smtp-transport", "rustls-tls"] }
|
||||
mail-parser = "0.11.2"
|
||||
async-imap = { version = "0.11",features = ["runtime-tokio"], default-features = false }
|
||||
|
||||
# HTTP server (gateway) — replaces raw TCP for proper HTTP/1.1 compliance
|
||||
axum = { version = "0.8", default-features = false, features = ["http1", "json", "tokio", "query", "ws"] }
|
||||
tower = { version = "0.5", default-features = false }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue