Skip to content

Phase 4: email assistant (IMAP/SMTP)#10

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/phase-4-email-assistant
Draft

Phase 4: email assistant (IMAP/SMTP)#10
Copilot wants to merge 3 commits intomainfrom
copilot/phase-4-email-assistant

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 11, 2026

Implements the email assistant module (super-ollama email ...) with full IMAP/SMTP integration, AI-assisted composition, and local draft persistence.

internal/mail package

  • config.go — Loads ~/.super-ollama/mail.toml (host/port/username only). Passwords stored exclusively in the OS keyring via zalando/go-keyring under "super-ollama-mail". Exposes loaders for profile.md, prompts/email.md, and per-contact notes. Contact filenames use alphanumeric-only slugs to prevent path traversal.
  • imap.goListMessages (headers-only, optional unread filter) and ReadMessage (full body by UID) via go-imap v1. Supports implicit TLS (port 993) and STARTTLS. TLS 1.2 minimum enforced.
  • body.go — RFC-2822 body extraction: plain text, multipart/alternative, quoted-printable.
  • smtp.go — Send via stdlib net/smtp; handles STARTTLS (587) and implicit TLS (465). TLS 1.2 minimum enforced.
  • store.go — SQLite (mail.db) with emails and drafts tables. Pragmas applied via Exec rather than DSN string concatenation.
  • prompt.go — Assembles LLM prompts from system prompt + user profile + contact notes + tone flag. Tone flags: formal / casual / brief.

CLI subcommands (cmd/super-ollama/email.go)

Replaces the existing stub with a real parent command and seven sub-commands:

super-ollama email setup                                          # store credentials in keyring
super-ollama email list [--unread] [--n 20]                       # fetch INBOX headers
super-ollama email read --message-id <uid>                        # display full message
super-ollama email compose --to <addr> --subject <subj> [--tone formal|casual|brief] [--draft]
super-ollama email reply   --message-id <uid> [--tone ...]        # auto-saves draft
super-ollama email summarise --message-id <uid>
super-ollama email send --draft-id <id> [--confirm]               # SMTP dispatch

Dependencies added

github.com/emersion/go-imap v1, go-smtp v0.21.3, go-message v0.18.1, go-sasl, github.com/zalando/go-keyring v0.2.5

Copilot AI and others added 2 commits April 11, 2026 14:02
Agent-Logs-Url: https://github.com/Kritarth-Dandapat/super-ollama/sessions/e08ab9f9-16ea-4242-b398-db9eef4ba004

Co-authored-by: Kritarth-Dandapat <141005022+Kritarth-Dandapat@users.noreply.github.com>
… sanitization)

Agent-Logs-Url: https://github.com/Kritarth-Dandapat/super-ollama/sessions/e08ab9f9-16ea-4242-b398-db9eef4ba004

Co-authored-by: Kritarth-Dandapat <141005022+Kritarth-Dandapat@users.noreply.github.com>
Copilot AI changed the title [WIP] Add email assistant with IMAP and SMTP functionality Phase 4: email assistant (IMAP/SMTP) Apr 11, 2026
Copilot AI requested a review from Kritarth-Dandapat April 11, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 4: email assistant (IMAP/SMTP)

2 participants