# Email Channel Connection channel for communicating with parents via email as ace@manglasabang.com. ## Status Not yet implemented. Purelymail account and DNS set up (2026-02-24). ## Design ### Isolation The email channel runs its own `ClaudeBridge` instance, completely independent from Slack. Each channel spawns a separate Claude subprocess with its own conversation state. A `/clear` or crash in Slack has no effect on the email thread, and vice versa. ### Architecture IMAP/SMTP via Purelymail ($10/yr). Full mailbox for ace@manglasabang.com. - **IMAP IDLE** — listens for incoming mail in real time (no polling) - **SMTP** — sends replies as ace@manglasabang.com ### Flow 1. Email arrives at ace@manglasabang.com 2. IMAP IDLE notifies the bot of the new message 3. Bot filters by allowed senders (parents' addresses) 4. Bot parses sender, subject, and body 5. Forwards message text to the email channel's own `ClaudeBridge` 6. Formats Claude's response as plain text 7. Sends reply via SMTP, preserving the email thread (In-Reply-To / References headers) ## Setup ### Purelymail - Admin: palace@purelymail.com - Mailbox: ace@manglasabang.com - IMAP: mailserver.purelymail.com:993 (SSL/TLS) - SMTP: mailserver.purelymail.com:465 (SSL/TLS) - Credentials in `secrets/purelymail.txt` ### DNS (Cloudflare) All records configured on Cloudflare for manglasabang.com: - MX @ → mailserver.purelymail.com (priority 10) - TXT @ → SPF (include:_spf.purelymail.com) - TXT @ → purelymail ownership proof - CNAME purelymail{1,2,3}._domainkey → DKIM keys - CNAME _dmarc → dmarcroot.purelymail.com ### Environment Variables ``` PURELYMAIL_USER=ace@manglasabang.com PURELYMAIL_PASS= # see secrets/purelymail.txt EMAIL_ALLOWED_SENDERS= # comma-separated parent email addresses ```