Skip to content

πŸ“¬ Mail Intake β€” Provider-Agnostic Email Ingestion

Mail Intake is a contract-first, read-only email ingestion framework. It pulls mail from external providers (such as Gmail), parses and normalizes it into clean, provider-agnostic domain models β€” ready to persist, index, or analyze downstream.

Doc model: this wiki is written for humans β€” how‑to guides and extension recipes. The authoritative API contracts live in the code (GSDFC docstrings) and the machine‑readable bundle under docs/mcp/.


πŸš€ Key Features

  • πŸ“¬ Read-only ingestion β€” never mutates provider state
  • 🧩 Contract-first layers β€” adapters, parsers, and readers separated
  • βœ‰οΈ Provider-agnostic models β€” MailIntakeMessage / MailIntakeThread have no provider internals
  • πŸ” Extensible auth β€” pluggable auth providers and credential stores (pickle for dev, Redis for production)
  • πŸ§ͺ Deterministic & testable β€” no implicit global state or env reads
  • πŸ“Š Gmail support β€” reference adapter built on the official Google APIs

⚑ Quick Start

from mail_intake.ingestion import MailIntakeReader
from mail_intake.adapters import MailIntakeGmailAdapter
from mail_intake.auth import MailIntakeGoogleAuth
from mail_intake.credentials import PickleCredentialStore

store = PickleCredentialStore(path="token.pickle")

auth = MailIntakeGoogleAuth(
    credentials_path="credentials.json",
    store=store,
    scopes=["https://www.googleapis.com/auth/gmail.readonly"],
)

adapter = MailIntakeGmailAdapter(auth_provider=auth)
reader = MailIntakeReader(adapter)

for message in reader.iter_messages("from:recruiter@example.com"):
    print(message.subject, message.from_email)

πŸ“ Documentation Structure

Section What you'll find
Overview Layers, domain models, and design guarantees
How to Use Gmail ingestion, parsing, and credential stores
Extending Mail Intake Custom adapters, auth providers, stores
Development Setup, tests, and regenerating docs


Β© Aetoskia Internal β€” mail-intake 0.0.2