Skip to main content

Docker Email connectors

To use email connectors in Docker:

  1. Configure your connections and import the Connections.xml file as described in Configure connectors in Docker.
  2. Configure credentials for your email connectors as described in the following sections.
Concurrency

Use one connector service instance per email connection. Email protocols are not concurrency-safe and multiple instances monitoring the same mailbox may process emails multiple times.

IMAP, SMTP, or Gmail Connectors

Set the password using an environment variable on the connector service container:

  • Environment variable: MAIL_<EMAIL_WITHOUT_SPECIAL_CHARS_UPPERCASED>
  • Example: For john.doe@gmail.com, set MAIL_JOHNDOEGMAILCOM
  • Value: The Password

Exchange Connectors

Initialize the Exchange Online authentication by running:

docker exec CONTAINER_ID_OR_NAME ./csconfig mail exchange-init <email-address>

This command initiates the OAuth flow and generates a token, which is stored in /etc/connsrv/TokenCaches.

Persistent storage: Mount a volume to preserve tokens across container restarts:

volumes:
- ./token-caches:/etc/connsrv/TokenCaches

Without persistent storage, you must re-run exchange-init after each container restart.