Skip to main content
Use the IMAP Connector to ingest emails from any IMAP-capable mail server (Gmail, Outlook/Exchange, Yahoo, self-hosted, etc.) into the mAItion knowledge base.

What It Does

  • connects to an IMAP mailbox over implicit TLS (IMAP4_SSL) or STARTTLS
  • auto-discovers all mailboxes when none are specified, or ingests only the listed mailboxes
  • converts each email into a document with subject as title and parsed body as content
  • extracts sender/recipient metadata (including Cc/Bcc) and handles both plain text and HTML bodies
  • runs ingestion on configurable schedules

Authentication

Authenticates with a plain username and password against the configured mailbox — most providers (e.g. Gmail) require an app-specific password rather than the account password when 2FA is enabled. Server certificates are always verified (hostname + trust chain); self-signed certificates are rejected unless the server’s CA is trusted by the environment running the connector.

Required Environment Variables

Set these in .env.rag:
  • IMAP1_HOST: IMAP server hostname (example: imap.gmail.com)
  • IMAP1_USERNAME: IMAP account username
  • IMAP1_PASSWORD: IMAP account password or app-specific password
  • IMAP1_MAILBOXES: comma-separated list of mailboxes to ingest (optional; omit to ingest all mailboxes)
  • IMAP1_SCHEDULES: ingestion interval in seconds (default is 3600)

config.yaml Example

.env.rag Example

Configuration Reference

Multiple IMAP Sources

Add more sources entries (imap2, imap3, etc) with separate env vars per source.