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 usernameIMAP1_PASSWORD: IMAP account password or app-specific passwordIMAP1_MAILBOXES: comma-separated list of mailboxes to ingest (optional; omit to ingest all mailboxes)IMAP1_SCHEDULES: ingestion interval in seconds (default is3600)
config.yaml Example
.env.rag Example
Configuration Reference
Multiple IMAP Sources
Add moresources entries (imap2, imap3, etc) with separate env vars per source.