Skip to content

Configuration Reference

This page collects the configuration surfaces used by the CLI, Python API, and MCP server.

Provider credentials are read at runtime. MailAtlas does not write IMAP passwords, OAuth access tokens, SMTP passwords, Cloudflare API tokens, Gmail access tokens, or Gmail refresh tokens into the workspace database, raw snapshots, logs, or JSON receive/send results.

MailAtlas stores data in one workspace root.

Resolution order:

  1. --root
  2. MAILATLAS_HOME
  3. Project config from .mailatlas.toml or pyproject.toml
  4. Fallback .mailatlas
Terminal window
export MAILATLAS_HOME="$PWD/.mailatlas"
mailatlas list
mailatlas --root ./other-mailatlas list

MailAtlas can read a local .mailatlas.toml file:

root = ".mailatlas"

It can also read pyproject.toml:

[tool.mailatlas]
root = ".mailatlas"

PDF export uses local Chrome or Chromium. If MailAtlas cannot find the browser on the default path, set:

Terminal window
export MAILATLAS_PDF_BROWSER="/path/to/chrome-or-chromium"
VariablePurpose
MAILATLAS_IMAP_HOSTIMAP hostname.
MAILATLAS_IMAP_PORTIMAP TLS port. Defaults to 993.
MAILATLAS_IMAP_USERNAMEMailbox username.
MAILATLAS_IMAP_PASSWORDPassword or app password for password auth.
MAILATLAS_IMAP_ACCESS_TOKENOAuth access token for XOAUTH2 auth.

Use either password auth or OAuth token auth, not both.

VariablePurpose
MAILATLAS_SEND_PROVIDERSet to smtp to use SMTP by default.
MAILATLAS_SMTP_HOSTSMTP hostname.
MAILATLAS_SMTP_PORTSMTP port. Defaults to 587.
MAILATLAS_SMTP_USERNAMESMTP username.
MAILATLAS_SMTP_PASSWORDSMTP password or app password.
MAILATLAS_SMTP_STARTTLSEnable or disable STARTTLS.
MAILATLAS_SMTP_SSLEnable or disable SMTP over SSL.
VariablePurpose
MAILATLAS_SEND_PROVIDERSet to cloudflare to use Cloudflare by default.
MAILATLAS_CLOUDFLARE_ACCOUNT_IDCloudflare account ID.
MAILATLAS_CLOUDFLARE_API_TOKENCloudflare API token.
MAILATLAS_CLOUDFLARE_API_BASEOptional API base override for tests or compatible gateways.
VariablePurpose
MAILATLAS_SEND_PROVIDERSet to gmail to use Gmail by default.
MAILATLAS_GMAIL_ACCESS_TOKENShort-lived Gmail API access token.
MAILATLAS_GMAIL_API_BASEOptional Gmail API base override.
MAILATLAS_GMAIL_USER_IDGmail API user ID. Defaults to me.
MAILATLAS_GMAIL_TOKEN_FILEExplicit local token file path.
MAILATLAS_GMAIL_TOKEN_STOREGmail token store: auto, keychain, file, or a token file path.
MAILATLAS_GMAIL_CLIENT_IDOAuth client ID for mailatlas auth gmail.
MAILATLAS_GMAIL_CLIENT_SECRETOAuth client secret for mailatlas auth gmail.
VariablePurpose
MAILATLAS_RECEIVE_PROVIDERReceive provider. Supported values are gmail and imap.
MAILATLAS_GMAIL_ACCESS_TOKENShort-lived Gmail API access token.
MAILATLAS_GMAIL_API_BASEOptional Gmail API base override.
MAILATLAS_GMAIL_USER_IDGmail API user ID. Defaults to me.
MAILATLAS_GMAIL_RECEIVE_LABELGmail label for receive. Defaults to INBOX.
MAILATLAS_GMAIL_RECEIVE_QUERYOptional Gmail search query.
MAILATLAS_GMAIL_RECEIVE_LIMITMaximum messages to fetch in one pass. Defaults to 50.
MAILATLAS_GMAIL_INCLUDE_SPAM_TRASHInclude Gmail spam and trash in receive list calls.
MAILATLAS_GMAIL_TOKEN_FILEExplicit local token file path.
MAILATLAS_GMAIL_TOKEN_STOREGmail token store: auto, keychain, file, or a token file path.
MAILATLAS_GMAIL_CLIENT_IDOAuth client ID for mailatlas auth gmail.
MAILATLAS_GMAIL_CLIENT_SECRETOAuth client secret for mailatlas auth gmail.

Local CLI workflows can use mailatlas auth gmail --capability receive. Backend applications should store refresh tokens in their own encrypted credential store and pass short-lived access tokens to MailAtlas.

VariablePurpose
MAILATLAS_RECEIVE_INTERVAL_SECONDSPolling interval for mailatlas receive watch. Defaults to 60.
MAILATLAS_RECEIVE_MAX_RUNSOptional max run count for watch mode.
VariablePurpose
MAILATLAS_MCP_ALLOW_SENDSet to 1 to expose the live send tool.
MAILATLAS_MCP_ALLOW_RECEIVESet to 1 to expose mailbox receive tools.
MAILATLAS_MCP_RECEIVE_ON_READSet to 1 to run one receive pass before document list reads.
MAILATLAS_MCP_RECEIVE_BACKGROUNDSet to 1 to start a background receive loop with the MCP server process.
MAILATLAS_MCP_AUTO_RECEIVEConvenience alias for receive-on-read. Prefer the explicit receive variables above.

Live sending and mailbox receive are hidden by default. Keep the MCP server local unless a future transport is explicitly designed for remote use.