Skip to content

Configuration

All variables are optional. Set them in .env (see .env.example); the web and worker services both read it.

variabledefaultrole
ADMIN_PASSWORD(empty)UI password. Optional: if empty, a random password is generated on first start (see Change or reset the admin password). When set, it always wins.
SECRET_KEY(empty)Key used to encrypt mailbox passwords and sign sessions. Empty: generated in data/secret.key.
UPLOAD_CHUNK_SIZE33554432 (32 MiB)Upload chunk size, in bytes (16 to 64 MiB recommended). Do not change it during a migration, see Pause, resume and retry.
UPLOAD_DISK_MARGIN536870912 (512 MiB)Free disk space margin required on top of the PST size.
WORKER_CONCURRENCYautoNumber of mailboxes migrated simultaneously by the worker. Unset or 0: auto, from the usable cores (cgroup-aware), the free memory, the disk and the queue (2 cores and 512 MB per job, at most 32, at most the jobs waiting, more while cores stay idle). See Tune.
REPAIR_BACKUP_FOLDER_originaux_avant_reparationFolder of a repaired mailbox that keeps the originals, see Repair a damaged mailbox. Keep it constant: restore reads it.
REPAIR_PARALLEL2Mailboxes analysed or repaired at the same time.
BUILD_PROCESSESper server tuningWhen set, forces in both tuning modes the number of processes building MIME messages for one mailbox (each opens the PST read-only). A builder killed by a libpff crash marks its item “libpff crash” and is restarted; crashes count towards MAX_CHILD_CRASHES. 0 = build inside the job process (previous behaviour). Total CPU use is about WORKER_CONCURRENCY × BUILD_PROCESSES.
AUTOTUNE_BENCH_SECONDS0.25Length of the build benchmark run at the start of an auto-tuned job (0 = none).
AUTOTUNE_INTERVAL5Seconds between two auto-tuning samples during the mail phase.
AUTOTUNE_MAX_CONNECTIONS32Most IMAP connections of one mailbox in auto mode.
AUTOTUNE_MAX_SERVER_CONNECTIONS64Most IMAP connections to one server across all its mailboxes in auto mode.
BUILD_MAX_INFLIGHT_MBautoMemory budget for built messages waiting for their APPEND, per mailbox. Unset: 256 MiB, or in auto mode a quarter of the free memory split between the running mailboxes, at most 4 GiB.
MEM_GUARD_MB512Below this much free memory, builds run one at a time.
IMAP_SEARCH_TIMEOUT900Seconds allowed for a SEARCH HEADER, which can read a whole folder on the server.
VERIFY_SAMPLE20Number of mails re-read for the sample check at the end of a job.
IMAP_MAX_RETRIES5Attempts on temporary IMAP errors (exponential backoff).
MAX_CHILD_CRASHES3Subprocess (libpff) crashes tolerated per job before it is marked failed (minimum 1).
CHILD_TERM_GRACE20Seconds given to subprocesses to stop on SIGTERM before SIGKILL.
COOKIE_SECURE01 = Secure session cookie (HTTPS behind a reverse proxy). The cookie is also Secure if the request arrives over HTTPS.
SESSION_MAX_AGE604800 (7 days)Session lifetime, in seconds.
WORKER_STALE_SECONDS60A running job whose heartbeat is older is considered orphaned and requeued.
PORT22362Listening port of the web service inside the container (the compose file publishes 22362).
DATA_DIR/dataData directory (set by the compose file).
INBOX_DIRDATA_DIR/inboxDrop folder watched by the worker (can be a mount). See Server-side intake.
FETCH_PARALLEL2Simultaneous server-side transfers (drop folder registrations and downloads).
FETCH_BLOCK_PRIVATE01 = also refuse private ranges and loopback as fetch sources. Link-local and metadata addresses are always refused.
FETCH_ALLOW_LINK_LOCAL01 = allow link-local addresses as fetch sources. Not recommended.
PSTMIG_ENGINEapp.engineEngine module; used only by tests.

.env.example only lists the common variables; SESSION_MAX_AGE, WORKER_STALE_SECONDS, CHILD_TERM_GRACE and PORT are read by app/server/config.py and are optional.

Notification channels, the drop-folder delay and the automatic assignment are not environment variables: they are set in the application (GET/PUT /api/intake/settings) and stored in app.db. See Notifications and Server-side intake.