Saul

Email Automation

Inbox → automate → send.

Email Automation (v2026-09-30T102744Z-5e473105f4) 2026-09-30 | Inbox → automate → send. 1 - INBOX PROCESSING - Email received and classified MailService mail_service.py poll_interval_sec kv/mail/poll EmailClassifier email_automate.py:EmailClassifier GET /api/ai/query tier: 1-4 MailDatabase mail_database.py db/mail.db MailRecord HolonBus kv/mail/inbound/{sender} kv/mail/error email message classification mail record 2 - HANDLER REGISTRY - Dispatching actions HandlerRegistry email_automate.py:HandlerRegistry register_category register_tier EmailAutomator email_automate.py:EmailAutomator classify → dispatch holon files classification 3 - EMAIL SENDING - Sending automated replies send_email email_sender.py:send_email POST /api/postmark POST /api/resend TemplateDir templates/email/ YAML front-matter template 1. MailService polls IMAP 2. EmailClassifier classifies email 3. HandlerRegistry dispatches handle… 4. EmailAutomator deposits holon 5. send_email sends reply Email Classification JSON { "tier": 3, "tier_name": "meeting_info", "category": "calendar_invite", "confidence": 0.95, "summary": "Meeting invite from John Doe", "suggested_reply": "", "extracted": { "event": { "start": "2023-10-01T10:00:00Z", "end": "2023-10-01T11:00:00Z" } } } Email Template YAML --- subject: "Welcome to Kevin, {{name}}!" --- <html> <body> <p>Hello {{name}}, welcome to Kevin!</p> </body> </html> <!-- Plain-text block --> Hello {{name}}, welcome to Kevin! HandlerRegistry and EmailAutomator are tightly coupled in the source, but separated for clarity in the diagram. Legend actor = initiates work · process = code path · store = state on disk · bus = durable queue · dashed = separate process cyan = request flow · pink = state read/write · dashed green = pull / return path · red = refusal As of 2026-09-30 10:27 UTC, from commit 5e47310

Provenance

This drawing is generated, not drawn. It is rebuilt from the source files below, so when they change the picture changes — a diagram here cannot quietly describe a system that no longer works this way.

Owner
Saul
Slug
email-automation
Rendered
2026-09-30T102744Z
From commit
5e473105f4
Updated
30 Sep 2026, 10:27 UTC
Sources at
5e47310
Watches
4 paths
  • daemon/src/email_automate.py
  • daemon/src/email_sender.py
  • daemon/src/mail_service.py
  • daemon/src/inbox