Plan file
Every migration project keeps its plan in plan.toml, in the project directory. The plan records the choices of each step: the Stalwart target, the proxy, the source and its access, the accounts, the data to copy, provisioning and the cutover. The web interface, the terminal interface and the step commands all write the same file, and it can also be edited by hand. This page lists the keys; Concepts explains how the plan is used.
Structure
Section titled “Structure”The file is TOML. It starts with two top-level keys, format_version, which is 1, and scope, which is server or account and is fixed when the project is created. The tables follow: [target], [proxy] and [source], which are absent until they are set, then [selection], [data], [provisioning], [cutover] and [advanced], and one [[accounts]] table per account that has its own settings. Every table rejects unknown keys, so a misspelt key is refused with the TOML parser’s error, which names the keys it expected.
The following plan migrates a Dovecot server account by account through the proxy:
format_version = 1scope = "server"
[target]url = "https://mail.example.org"auth = { kind = "basic", user = "admin", password = "ask" }
[proxy]admin_url = "https://127.0.0.1:9443"token = "file:/etc/proxy/admin-token"old_destination = "legacy"new_destination = "stalwart"
[source]system = "dovecot"imap = "imaps://mail-old.internal.example.org"sieve = "sieve://mail-old.internal.example.org"master = { name = "vandelay", password = "env:VANDELAY_MASTER" }
[selection]all = true
[provisioning]passwords = "carry-or-temporary"
[[provisioning.dkim]]domain = "example.org"action = "import"
[cutover]mode = "proxy"deltas = "6h"Editing
Section titled “Editing”Each key can be set in four ways. The steps of the web and terminal interfaces save their fields into the file. The step commands vandelay migrate target, source, select and options take the flags listed below, and print the current values of their step when run without flags. vandelay migrate set key=value sets any key by the names in the tables below; for Zimbra and Exchange, the password that set names source.master.password is stored as source.password in the file. Finally, the file can be edited by hand and applied with vandelay migrate plan reload, or the edit thrown away with vandelay migrate plan discard.
While a runner holds the project, it notices a hand edit, starts no new task, and refuses other changes with plan.toml changed on disk; reload or discard the change before editing the plan until the edit is reloaded or discarded. A reloaded plan applies to tasks that start afterwards. Lowering cutover.parallel_accounts or advanced.threads takes effect from the next task; raising them is held back for exports until the runner restarts, with the warning export concurrency stays at <n> until the runner restarts.
Every front end edits the same fields: the web interface accepts secret references, paths and host access settings as the CLI does, and resolves them on the host that runs Vandelay. The Plan tool of the web interface downloads and uploads plan.toml, and its Discard rewrites the file from the plan the runner is using, so edits made to the file since the runner last loaded it are lost.
Values
Section titled “Values”Secrets are always references: env:NAME, file:PATH or ask, as described in Secret references. A relative path, in a file: reference or in a key that names a file, is resolved against the project directory. URLs in the plan never carry a user name or password. Durations are written with a unit, such as 90s, 10m, 6h or 1d, and delta schedules are manual or a duration. Certificate pins are SHA-256 fingerprints of 64 hexadecimal digits, with or without colons.
Bound keys
Section titled “Bound keys”Four parts of the plan are bound when work starts, after the first pre-flight that passed: the target URL (and, in account scope, the target account), the proxy admin URL and its two destination names (or the absence of a proxy), the source system with its endpoints, and cutover.mode. A change to one of them is refused, and restoring the bound value is allowed. Bound settings lists the endpoints of each source system.
Target
Section titled “Target”Set with vandelay migrate target, or on the Target (Stalwart) step.
| Key | Flag | Value | Meaning |
|---|---|---|---|
target.url | --url | URL (http/https) | Base URL of the Stalwart server, for example https://mail.example.org. |
target.auth.kind | --auth | choice: basic, bearer | An administrator user and password, or an API token. |
target.auth.user | --user | text (max 256) | Administrator login name. |
target.auth.password | --password | secret reference | Read from an environment variable or a file, or asked at a prompt; never written to the plan. |
target.auth.token | --token | secret reference | Read from an environment variable or a file, or asked at a prompt; never written to the plan. |
target.tls.sha256 | --tls-pin | SHA-256 fingerprint | Accept a self-signed target certificate with this fingerprint; requires https. |
target.allow_ip | --allow-ip | bool | Add the address Stalwart sees for Vandelay to Stalwart’s allowed IPs for 7 days, extended while copies run, so that rate limits and banning do not slow the migration; Finish removes the entries the project created. A loopback address is not added. |
target.account.name | --target-account | text (max 256) | Single-account scope: the Stalwart account to migrate into, by login name. |
target.account.id | --target-account-id | text (max 256) | Single-account scope: the Stalwart account to migrate into, by JMAP account id. |
Set with vandelay migrate source, or on the Source: detect step. The table is present only for a migration through the proxy, and admin_url, token, old_destination and new_destination are required once it is.
| Key | Flag | Value | Meaning |
|---|---|---|---|
proxy.admin_url | --proxy | URL (http/https) | Admin API of the migration proxy, for example https://127.0.0.1:9443; leave empty without a proxy. |
proxy.token | --proxy-token | secret reference | Read from an environment variable or a file, or asked at a prompt; never written to the plan. |
proxy.tls.sha256 | --proxy-tls-pin | SHA-256 fingerprint | Accept a self-signed proxy certificate with this fingerprint; requires https. |
proxy.old_destination | --proxy-old | text (max 256) | Name of the proxy destination that reaches the current mail server. |
proxy.new_destination | --proxy-new | text (max 256) | Name of the proxy destination that reaches Stalwart. |
proxy.source_internal | --source-internal | host:port | host:port pre-flight uses to check that the old server answers directly, not through the proxy; read from the proxy when empty. |
Source
Section titled “Source”Set with vandelay migrate source, or on the Source: detect and Source: access steps. Which keys apply depends on source.system; a flag that does not apply to the chosen system is refused. The values of source.system are dovecot, docker-mailserver, iredmail, mailcow, mailu, mail-in-a-box, modoboa, zimbra, exchange, m365, google and imap. Each source page describes its keys in context.
| Key | Flag | Systems | Meaning |
|---|---|---|---|
source.system | --system | All | The kind of server the accounts are on now. Detection is optional: it pre-selects the system it recognises, and the operator can change the choice until accounts are discovered; after that, another system needs a new project. |
source.url | --admin-url | mailcow, Mail-in-a-Box, Zimbra | https://host of the mailcow web interface (API under /api/v1) or of the Mail-in-a-Box box by its hostname (admin API under /admin), or https://host:7071/ of the Zimbra admin SOAP service. |
source.api_key | --api-key | mailcow | A mailcow API key; the read-only key is enough to discover accounts. The key’s IP allow list must include this machine. |
source.imap | --imap-url | IMAP-based systems | imaps://host[:port] for implicit TLS, imap://host[:port] for STARTTLS. |
source.sieve | --sieve-url | IMAP-based systems except Zimbra | sieve://host[:port] (STARTTLS) or sieves://host[:port]; leave empty to skip Sieve scripts. |
source.accounts | --accounts | Other IMAP, Exchange | CSV with a header line and one row per account; see the csv guide for its columns. A line whose first character is # is a comment, so quote an address that starts with #. |
source.user.address | --user-address | Other IMAP (account scope) | Sign in as this one account with its own password, instead of an accounts CSV or a master user; needs scope account. |
source.user.login | --user-login | Other IMAP (account scope) | The account’s login name, when it differs from its address. |
source.user.password | --user-password | Other IMAP (account scope) | Read from an environment variable or a file, or asked at a prompt; never written to the plan. |
source.master.name | --master-user | IMAP-based systems except Mailu and Zimbra | Login of a master user that can read every mailbox without the users’ passwords. |
source.master.password | --master-password | IMAP-based systems except Mailu, and Exchange | For Zimbra, the administrator’s password; for Exchange, the service account’s password. Read from an environment variable or a file, or asked at a prompt; never written to the plan. |
source.master.form | --master-form | IMAP-based systems except Mailu and Zimbra | The separator between user and master user (default *), or authzid for a SASL authorization id. |
source.cleartext | --cleartext | IMAP-based systems | Allow sending credentials over a connection without TLS; only for servers that offer no TLS. |
source.host.kind | --host-access | Systems with host access | How Vandelay reads the server’s configuration files and password hashes: on this machine or over SSH. --host-access local drops a saved SSH destination. |
source.host.root | --host-root | Host access on this machine | Directory where the server’s file system is mounted on this machine (/ when Vandelay runs on the server). |
source.host.destination | --ssh | Host access over SSH | user@host or ssh://user@host:port of the mail server; user@host:port is saved as ssh://user@host:port. |
source.host.identity | --ssh-identity | Host access over SSH | Private key used to log in; the SSH agent and default keys otherwise. |
source.host.known_hosts | --ssh-known-hosts | Host access over SSH | known_hosts file holding the server’s host key; the user’s file otherwise. |
source.userdb.driver | --userdb | Dovecot | Format of the file that lists Dovecot users and their password hashes. |
source.userdb.path | --userdb-path | Dovecot | Path of the user database on the server. |
source.postfix | --postfix | Dovecot | Directory holding main.cf and the alias and virtual maps, or false when the host runs no Postfix. |
source.opendkim | --opendkim | Dovecot | OpenDKIM KeyTable file (for example /etc/opendkim/KeyTable), read to carry existing DKIM keys; leave empty when DKIM is signed elsewhere. |
source.default_domain | --default-domain | Dovecot | Domain for passwd-file users written without one that match no Postfix virtual mailbox; overrides the domain read from main.cf. |
source.config | --dms-config | docker-mailserver | Host path of the directory mounted at /tmp/docker-mailserver in the container (docker-data/dms/config in the compose example); only its owner may write it. |
source.sql.engine | --sql-engine | iRedMail, Modoboa | Database server that holds the iRedMail vmail database or the Modoboa database, read on the host with the mysql or psql client. |
source.sql.database | --sql-database | iRedMail, Modoboa | Name of the database for MariaDB (the client reads /root/.my.cnf), or a PostgreSQL connection string such as dbname=vmail user=vmail host=127.0.0.1 with the password in ~/.pgpass. iRedMail uses vmail on MariaDB by default, Modoboa modoboa on PostgreSQL. |
source.export | --mailu-export | Mailu | JSON written by flask mailu config-export -j -s -f in the admin container; it holds password hashes and DKIM keys, so keep it private. |
source.dkim_selector | --dkim-selector | Mailu | DKIM_SELECTOR of the Mailu installation, used for the DKIM keys in the export file. |
source.radicale | --radicale-url | Mailu | http://<IP address>:5232/ of Mailu’s webdav container on the mailu_radicale network (a host name is refused); when empty, calendars and contacts are not migrated and pre-flight lists them as a loss. |
source.tls.sha256 | --source-tls-pin | Other IMAP, Exchange, systems with host access | Accept a self-signed certificate with this fingerprint on the source host: the admin URL host for mailcow, Mail-in-a-Box and Zimbra, the EWS host for Exchange, the IMAP host otherwise. |
source.tenant | --tenant | Microsoft 365 | Directory (tenant) id or a verified domain of the Microsoft 365 tenant, such as contoso.onmicrosoft.com. |
source.client_id | --client-id | Microsoft 365 | Client id of the app registration that holds the application permissions listed in the guide. |
source.client_secret | --client-secret | Microsoft 365 | Client secret of the app registration; set this or a certificate. Read from an environment variable or a file, or asked at a prompt; never written to the plan. |
source.certificate.certificate | --certificate | Microsoft 365 | PEM certificate uploaded to the app registration; set this or a client secret. |
source.certificate.key | --certificate-key | Microsoft 365 with a certificate | PEM private key of the certificate. Read from an environment variable or a file; never written to the plan. |
source.service_account | --service-account | Google Workspace | JSON key file of the Google Cloud service account with domain-wide delegation for the scopes listed in the guide. Read from a file or an environment variable; never written to the plan. |
source.admin | --admin | Google Workspace, Mail-in-a-Box, Zimbra | Address of a Google Workspace super administrator, for whom the service account reads the directory, or of a Mail-in-a-Box or Zimbra administrator, who reads the admin API. |
source.route | --route | Google Workspace | How mail is read: through the Gmail API (read-only scope) or over IMAP (needs the extra gmail.imap_admin scope). Fixed once the migration has started. |
source.admin_password | --admin-password | Mail-in-a-Box | Password of the Mail-in-a-Box administrator; read from an environment variable or a file, or asked at a prompt, never written to the plan. |
source.nextcloud.url | --nextcloud-url | Mail-in-a-Box | Nextcloud DAV base on the box, https://<box>/cloud/remote.php/dav/; set it to carry calendars, contacts and files (needs host access), leave empty to skip them. |
source.storage_root | --storage-root | Mail-in-a-Box | STORAGE_ROOT of the box, read through host access for the password hashes, DKIM keys and Nextcloud accounts; /home/user-data when empty. |
source.mail | --mail-url | Zimbra | https://host of the Zimbra mailbox service, where mail requests go; when empty, the admin URL without its port (port 443). |
source.ews | --ews-url | Exchange | https://host/EWS/Exchange.asmx of the Exchange server. |
source.user | --service-user | Exchange | Sign-in name of the read-only service account with ApplicationImpersonation, as DOMAIN\user or user@domain. |
source.ldap.url | --ldap-url | Exchange | ldaps://host[:port] or ldap://host[:port] (StartTLS) of a domain controller; the service account reads users, groups, resources and forwarding there. Leave empty to list accounts in a CSV instead. |
source.ldap.base | --ldap-base | Exchange with Active Directory | Distinguished name where the directory search starts, for example DC=example,DC=org. |
source.ldap.tls.sha256 | --ldap-tls-pin | Exchange with Active Directory | SHA-256 fingerprint of the domain controller’s certificate, when it is not signed by a trusted authority. |
Selection
Section titled “Selection”Set with vandelay migrate select, or on the Accounts or Account step. selection.all and selection.csv exclude each other, and selection.account applies only in account scope.
| Key | Flag | Value | Meaning |
|---|---|---|---|
selection.all | --all | bool | Migrate every account found on the source. |
selection.csv | --from | path to CSV (selection schema) | Source addresses, one per row, under a header named address. A line whose first character is # is a comment, so quote an address that starts with #. Every address must match a discovered account: if one does not, nothing is selected and the save names it. Saving a new path selects the listed accounts, also those taken out of the migration on the table. |
selection.include_disabled | --include-disabled | bool | Also migrate accounts that are disabled on the source. |
selection.include_empty | --include-empty | bool | Also migrate accounts that hold no mail or other data. |
selection.account | --account | email address | Address of the one source account to migrate; leave empty when the source sees only that account. |
Per-account overrides
Section titled “Per-account overrides”An [[accounts]] table, set with vandelay migrate account-set <address> key=value, changes the migration of one account. address names the source account, and the other keys are optional:
| Key | Value | Meaning |
|---|---|---|
target | Address | The account’s address on Stalwart, when it changes |
login_forms | List of names | Further login names to map to Stalwart at the switch, in addition to those discovered |
folders.include, folders.exclude | Lists of regular expressions | Folder filters for this account, as in [data] |
temporary_password | Boolean | Give this account a temporary password, whatever the password mode |
skip | Boolean | Leave the account out of the migration |
The following override moves one account to a new address and maps its bare login name as well:
[[accounts]]login_forms = ["alice"]A table whose keys all hold their defaults is removed from the file.
Set with vandelay migrate options, or on the Data to migrate step. Folder filters are regular expressions on the folder name, one per value: repeat the flag or the key for more, and write a literal comma as \, or [,].
| Key | Flag | Value | Meaning |
|---|---|---|---|
data.mail | --mail | bool | Copy mail and the folder tree. |
data.calendars | --calendars | bool | Copy calendars and their events. |
data.contacts | --contacts | bool | Copy address books and their contacts. |
data.files | --files | bool | Copy file storage where the source has it. |
data.sieve | --sieve | bool | Copy Sieve scripts and keep the active one active. |
data.rules | --rules | bool | Convert non-Sieve rules to Stalwart mail rules. |
data.vacation | --vacation | bool | Carry the vacation responder. |
data.identities | --identities | bool | Carry sender identities and signatures. |
data.forwarding | --forwarding | bool | Carry forwarding settings. |
data.skip_junk | --skip-junk | bool | Do not copy the Junk folder. |
data.skip_trash | --skip-trash | bool | Do not copy the Trash folder. |
data.subscribed_only | --subscribed-only | bool | Copy only the folders the user subscribes to. |
data.folders.include | --include | list of regexes | Regular expressions, one regex per value; repeat the key for more, or give one per line. Only matching folders are copied. |
data.folders.exclude | --exclude | list of regexes | Regular expressions, one regex per value; repeat the key for more, or give one per line. Matching folders are not copied. |
Provisioning
Section titled “Provisioning”Set with vandelay migrate options, or on the Provisioning and passwords step. Planning explains the password modes, and provisioning.dkim holds one rule per domain. On the command line a rule is written --dkim=example.org=import (or generate, skip); in the file each rule is a [[provisioning.dkim]] table with domain and action.
| Key | Flag | Value | Meaning |
|---|---|---|---|
provisioning.passwords | --passwords | choice: carry-or-temporary, temporary, external | Carry password hashes where possible, give everyone a temporary password, or leave sign-in to an external identity provider. |
provisioning.carry_cleartext_passwords | --carry-cleartext-passwords | bool | Carry passwords the source stores in clear text; they are hashed before they reach Stalwart. |
provisioning.dkim | --dkim | list (max 300) | Per domain: domain=import, domain=generate or domain=skip. |
provisioning.existing_accounts | --existing-accounts | choice: use, skip | Use existing Stalwart accounts as targets, or skip them. |
provisioning.catch_all | --catch-all | choice: after-last-switch | Server-scope projects set catch-all addresses at Finish, after the last switch, so split delivery keeps working. An account-scope project never sets them: catch-alls are domain-wide. |
provisioning.quotas | --quotas | bool | Set each account’s quota from the source. |
provisioning.aliases | --aliases | bool | Add each account’s aliases. |
provisioning.lists_and_groups | --lists-and-groups | bool | Create mailing lists and groups. |
provisioning.role | --role | text (max 256) | Stalwart role given to every account Vandelay creates. |
provisioning.temp_password_length | --temp-password-length | number 12..64 | Length of generated temporary passwords. |
Cutover
Section titled “Cutover”Set with vandelay migrate options, or on the Cutover strategy step. cutover.mode is proxy, domain or none, as described in Planning.
| Key | Flag | Value | Meaning |
|---|---|---|---|
cutover.mode | --cutover | choice: proxy, domain, none | How users are moved to Stalwart once their data is copied. |
cutover.auto_switch | --auto-switch | bool | Switch an account as soon as its first copy is ready, after Run or the unattended run, instead of waiting for the operator. |
cutover.hold_logins | --hold-logins | duration (seconds 0..600) | Total time logins may be held during one account’s switch (at most 10 minutes). |
cutover.max_delta_age | --max-delta-age | duration (seconds 0..315360000) | Domain cutover: an account whose last full delta is older than this is listed as stale at the MX change. |
cutover.sweep_lead | --sweep-lead | duration (seconds 0..315360000) | How far ahead of the planned MX change the checklist schedules the delta sweep; computed when empty. |
cutover.parallel_accounts | --parallel | number 1..65535 | Number of accounts copied at the same time. |
cutover.deltas | --deltas | text (max 16) | manual, or an interval such as 6h between delta passes until the switch. |
cutover.catch_up | --catch-up | text (max 16) | manual, or an interval such as 1d between catch-up passes after an account is switched. |
Advanced
Section titled “Advanced”Set with vandelay migrate options, under the Advanced section of the Cutover strategy step.
| Key | Flag | Value | Meaning |
|---|---|---|---|
advanced.threads | --threads | number 1..256 | Worker threads used for one account. |
advanced.runner_idle | --runner-idle | duration (seconds 10..315360000) | The background runner exits after this long with nothing to do and nobody watching. |
advanced.max_retries | --max-retries | number 0..4294967295 | Retries of a failed task before the account needs a decision. |
advanced.log_level | --log-level | choice: normal, verbose, protocol, wire | Detail written to the account logs. |