AT_EMAIL_ADMIN_* variables into service-native container environment variables. Helm deployments use equivalent values documented in Deploy with Helm.
The default compose.yaml stack provides MongoDB, Redis, WildDuck, Haraka, ZoneMTA, and internal service URLs on the Compose network. Set the defaulted variables below only when you are changing that topology or enabling an optional integration.
Generate secret values
Use a distinct value for every secret in every environment. GenerateAT_EMAIL_ADMIN_ENCRYPT_SECRET_KEY as exactly 32 random bytes encoded with base64url:
AT_EMAIL_ADMIN_BETTER_AUTH_SECRETAT_EMAIL_ADMIN_CONTROL_TO_WEB_API_TOKENAT_EMAIL_ADMIN_WILDDUCK_ADMIN_ACCESS_TOKENAT_EMAIL_ADMIN_WILDDUCK_ACCESS_CONTROL_SECRETAT_EMAIL_ADMIN_MAIL_LOOP_SECRETAT_EMAIL_ADMIN_ZONEMTA_RELAY_PASSWORDAT_EMAIL_ADMIN_FEEDBACK_MAILBOX_PASSWORDAT_EMAIL_ADMIN_CF_WORKER_PASSWORD
Admin web app
string
required
Fully-qualified public URL of your AgentTeam Email deployment. The Cloudflare Worker sends inbound mail notifications to
AT_EMAIL_ADMIN_PUBLIC_HOSTNAME/rpc/agent-mail/ingest/v1/{connectionPublicId}.Example: https://mail.company.examplestring
required
Long random string used to sign and verify authentication sessions. Generate a unique value for every environment.Example:
a-long-random-string-change-mestring
required
32 random bytes encoded as base64url. Used to encrypt sensitive data stored at rest. Generate a fresh value per environment.Example:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA (replace with real random bytes)Compose runtime defaults
These values are defaulted by the Compose files. Leave them unset unless you are pinning a release, changing local port exposure, or matching host filesystem ownership.string
First-party AgentTeam Email image tag.Default:
lateststring
Compose image pull policy.Default:
alwaysnumber
Host user ID used for first-party AgentTeam Email app containers. Bundled third-party data and mail services use their image-defined runtime users.Default:
1000number
Host group ID used for first-party AgentTeam Email app containers. Bundled third-party data and mail services use their image-defined runtime groups.Default:
1000number
Host port published for the web server.Default:
23100number
Maximum MongoDB connection pool size for the admin web app.Default:
8string
Temporary directory used by the admin web app.Default:
/tmp/agentteam-emailLogging controls
The web server and mail-control-service emit operational info/error logs to container stdout/stderr by default. Leave these unset for normal production.string
Passed to the web server as the
DEBUG namespace pattern. Use this to enable
detailed server-side diagnostics, including comma-separated namespace patterns
such as app:* or app:*,api:backend.Default: unsetExample: app:*boolean
Passed to the web server as
DEBUG_HIDE_DATE. Compose defaults this to 1 so container log timestamps remain the primary timestamp when AT_EMAIL_ADMIN_WEB_SERVER_DEBUG is enabled.Default: 1Databases
AgentTeam Email requires three MongoDB databases and one Redis instance. The defaultcompose.yaml stack supplies them with bundled services. Set these variables only when using an equivalent external data-service deployment.
The bundled MongoDB deployment runs as a single-node replica set named rs0. Custom MongoDB URIs must point at a replica set because application flows use MongoDB transactions.
Even when sharing a single MongoDB server, each URI must point to a distinct logical database.
string
MongoDB connection URI for the main web application database.Example:
mongodb://user:password@mongodb.example:27017/agentteam_email?authSource=admin&replicaSet=rs0&tls=truestring
MongoDB connection URI for the WildDuck mail server database.Example:
mongodb://user:password@mongodb.example:27017/wildduck?authSource=admin&replicaSet=rs0&tls=truestring
MongoDB connection URI for the mail-control-service operational database. This must be a dedicated database, such as
agent_mail_control; it must not share collections with the WildDuck database.Example: mongodb://user:password@mongodb.example:27017/agent_mail_control?authSource=admin&replicaSet=rs0&tls=truestring
Redis connection URL used by the mail stack for queuing and coordination.Example:
rediss://:password@redis.example:6379/3Cloudflare OAuth
These variables configure the admin instance’s Cloudflare OAuth app. Users connect their own Cloudflare domains from the web UI through this app. Configure the Cloudflare OAuth client for Authorization Code with PKCE and refresh tokens. The web app requests a fixed scope set from code, includingoffline_access so Better Auth can store a refresh token and refresh access over time.
The required Cloudflare OAuth scopes are:
string
required
Cloudflare OAuth client ID used by the web app. Configure the Cloudflare OAuth client for Authorization Code + PKCE with token endpoint auth method
none.Service-level Cloudflare Worker
Production installs that enable Cloudflare OAuth must also configure a service-level Cloudflare Worker. AgentTeam Email provisions this admin-instance Worker at startup and uses it only for authenticatedPOST /oauth2/token
forwarding to Cloudflare’s OAuth token endpoint when server egress is
challenged by Cloudflare.
This Worker belongs to the AgentTeam Email admin instance, not to a customer
domain. Its Cloudflare API token, workers.dev subdomain, Worker name, and
backend-to-Worker password are deployment configuration. Customer-domain
Cloudflare OAuth grants must not be used to provision or authenticate this
service-level Worker.
string
required
Cloudflare account ID that owns the service-level Cloudflare Worker.
string
required
Cloudflare API token used by the web server to upload and enable the service-level Worker. The token needs account-level Workers Scripts read and write access for
AT_EMAIL_ADMIN_CF_WORKER_ACCOUNT_ID.string
required
Shared password used by the web server when calling the service-level Worker with
Authorization: Bearer. Generate a unique high-entropy value per deployment.string
required
Cloudflare Worker script name for the service-level Worker. Set this explicitly for the deployment.
string
required
Account workers.dev subdomain used to address the service-level Worker.
Advanced Cloudflare overrides
Leave these unset for normal Cloudflare OAuth and API access. The web app and mail-control service have built-in Cloudflare endpoint defaults.string
Cloudflare API base URL. Override only in tests or controlled non-production environments.Default:
https://api.cloudflare.com/client/v4string
Optional Cloudflare OAuth authorization URL override. Leave unset for normal Cloudflare OAuth.
string
Optional Cloudflare OAuth token URL override. Leave unset for normal Cloudflare OAuth.
string
Optional Cloudflare OAuth token revocation URL override. Leave unset for normal Cloudflare OAuth.
string
Optional Cloudflare OAuth issuer override.
Admin R2 archive bucket
AgentTeam Email archives mail to a Cloudflare R2 bucket owned by the admin instance. The archive client uses R2’s S3-compatible endpoint, and Worker provisioning uses Cloudflare R2 temporary credentials.string
required
Cloudflare account ID that owns the archive bucket.Example:
example-cloudflare-account-idstring
required
Cloudflare token used by mail-control only to issue temporary R2 credentials for Workers. This token must not be used for user-domain Worker deployment, Email Routing, DNS, or outbound Cloudflare Email Sending.Example:
example-r2-api-tokenstring
required
Cloudflare R2 S3-compatible endpoint URL.Example:
https://example-account-id.r2.cloudflarestorage.comstring
Storage region identifier. Compose and Helm default this to
auto for Cloudflare R2.Default: autostring
required
Bucket name for the mail archive.Example:
agent-mail-archivestring
required
R2 S3-compatible access key ID for archive storage.Example:
example-r2-access-key-idstring
required
R2 S3-compatible secret access key for archive storage.Example:
example-r2-secret-access-keyInternal service credentials
These variables configure server-side service authentication. They are not browser-visible and are not user-domain credentials.string
required
Authentication token used by mail-control-service when it calls web-server internal endpoints, including the startup runtime projection snapshot and Cloudflare raw-send callback.
string
required
Admin access token for the WildDuck API. Used for mailbox provisioning and message delivery operations.
string
required
Shared secret for WildDuck access-control API calls.
string
required
Shared secret used to detect and suppress mail loop conditions between internal services.
string
required
Password used by ZoneMTA to authenticate with the internal SMTP relay.
string
required
Password for the service-owned feedback mailbox that receives bounce and DSN notifications.
Advanced internal topology overrides
Leave these unset for the default Compose network. Set them only when the service names, ports, or runtime topology differ from the bundled Compose stack.string
WildDuck API base URL used by the web server and mail-control-service.Default:
http://wildduck:8080string
WildDuck IMAP address used by generated domain runtime configuration.Default:
wildduck:10143string
Haraka SMTP address used by generated domain runtime configuration.Default:
haraka:10025string
ZoneMTA DSN listener address used by generated domain runtime configuration.Default:
zonemta:2526string
Internal web-server base URL used by mail-control-service for web-owned runtime projection and Cloudflare raw-send callbacks.Default:
http://atemail-web-server:4321Optional transactional SMTP
These variables configure admin-instance transactional email. They do not configure user-domain sending or receiving.string
SMTP host for transactional email.
number
SMTP port.Default:
1025boolean
Set to
true when the SMTP provider requires TLS.Default: falsestring
SMTP username.
string
SMTP password.
string
Default From address for transactional email.
string
Optional Reply-To address.
string
Optional SMTP envelope sender.
Optional admin sign-in providers
These variables configure optional identity providers for the admin web app. Leave them unset to disable the provider.string
Google OAuth client ID mapped into the web app as
PUBLIC_GOOGLE_CLIENT_ID.string
Google OAuth client secret used only by the web server.
string
LinkedIn OAuth client ID mapped into the web app as
PUBLIC_LINKEDIN_CLIENT_ID.string
LinkedIn OAuth client secret used only by the web server.
Optional Stripe integration
string
Stripe publishable key for browser-visible Stripe flows.
string
Stripe secret key used only by the web server.
Optional agent trial policy
Agent trials are disabled unlessAT_EMAIL_ADMIN_TRIAL_ENABLED=true.
boolean
Enables the agent trial admission flow.Default:
falsestring
Organization ID used for trial mailbox ownership.
string
Domain used for trial mailbox addresses.
string
Admission token required by trial agent clients.
string
Comma-separated capability list granted to trial agents.
number
Claim intent lifetime in seconds.Default:
86400number
Daily send limit for a trial mailbox.Default:
10number
Lifetime of a trial mailbox in seconds.Default:
604800string
Local-part prefix used when creating trial mailbox addresses.Default:
trialnumber
Maximum active trial mailboxes.Default:
25number
Total send limit for a trial mailbox.Default:
50Worker ingest
The Cloudflare Worker sends a Standard Webhooks-signed HTTP notification to the web server after writing each inbound message to R2.The Worker ingest URL is derived automatically from
AT_EMAIL_ADMIN_PUBLIC_HOSTNAME as
AT_EMAIL_ADMIN_PUBLIC_HOSTNAME/rpc/agent-mail/ingest/v1/{connectionPublicId}. Self-host operators do not
set a separate global ingest URL or webhook signing secret. Backend provisioning stores deployment-owned
Worker secrets and supplies the Worker bindings AGENTTEAM_INGEST_URL and AGENTTEAM_WORKER_HMAC_SECRET.Docker Compose specific
These variables are used only by the Docker Compose deployment and have no effect in Kubernetes or other runtimes.string
Container image tag to pull for all AgentTeam Email services.Example:
lateststring
Docker image pull policy. Corresponds to the Compose
pull_policy option.Example: alwaysnumber
UID that first-party AgentTeam Email app containers run as. Bundled third-party containers keep their image-defined users.Example:
1000number
GID that first-party AgentTeam Email app containers run as. Bundled third-party containers keep their image-defined groups.Example:
1000number
Host port to bind for the web application in Docker Compose. Does not affect in-container listen addresses.Example:
23100