Skip to content

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.

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 = 1
scope = "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" }
host = { kind = "ssh", destination = "[email protected]" }
[selection]
all = true
[provisioning]
passwords = "carry-or-temporary"
[[provisioning.dkim]]
domain = "example.org"
action = "import"
[cutover]
mode = "proxy"
deltas = "6h"

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.

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.

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.

Set with vandelay migrate target, or on the Target (Stalwart) step.

KeyFlagValueMeaning
target.url--urlURL (http/https)Base URL of the Stalwart server, for example https://mail.example.org.
target.auth.kind--authchoice: basic, bearerAn administrator user and password, or an API token.
target.auth.user--usertext (max 256)Administrator login name.
target.auth.password--passwordsecret referenceRead from an environment variable or a file, or asked at a prompt; never written to the plan.
target.auth.token--tokensecret referenceRead from an environment variable or a file, or asked at a prompt; never written to the plan.
target.tls.sha256--tls-pinSHA-256 fingerprintAccept a self-signed target certificate with this fingerprint; requires https.
target.allow_ip--allow-ipboolAdd 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-accounttext (max 256)Single-account scope: the Stalwart account to migrate into, by login name.
target.account.id--target-account-idtext (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.

KeyFlagValueMeaning
proxy.admin_url--proxyURL (http/https)Admin API of the migration proxy, for example https://127.0.0.1:9443; leave empty without a proxy.
proxy.token--proxy-tokensecret referenceRead from an environment variable or a file, or asked at a prompt; never written to the plan.
proxy.tls.sha256--proxy-tls-pinSHA-256 fingerprintAccept a self-signed proxy certificate with this fingerprint; requires https.
proxy.old_destination--proxy-oldtext (max 256)Name of the proxy destination that reaches the current mail server.
proxy.new_destination--proxy-newtext (max 256)Name of the proxy destination that reaches Stalwart.
proxy.source_internal--source-internalhost:porthost:port pre-flight uses to check that the old server answers directly, not through the proxy; read from the proxy when empty.

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.

KeyFlagSystemsMeaning
source.system--systemAllThe 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-urlmailcow, Mail-in-a-Box, Zimbrahttps://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-keymailcowA 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-urlIMAP-based systemsimaps://host[:port] for implicit TLS, imap://host[:port] for STARTTLS.
source.sieve--sieve-urlIMAP-based systems except Zimbrasieve://host[:port] (STARTTLS) or sieves://host[:port]; leave empty to skip Sieve scripts.
source.accounts--accountsOther IMAP, ExchangeCSV 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-addressOther 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-loginOther IMAP (account scope)The account’s login name, when it differs from its address.
source.user.password--user-passwordOther 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-userIMAP-based systems except Mailu and ZimbraLogin of a master user that can read every mailbox without the users’ passwords.
source.master.password--master-passwordIMAP-based systems except Mailu, and ExchangeFor 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-formIMAP-based systems except Mailu and ZimbraThe separator between user and master user (default *), or authzid for a SASL authorization id.
source.cleartext--cleartextIMAP-based systemsAllow sending credentials over a connection without TLS; only for servers that offer no TLS.
source.host.kind--host-accessSystems with host accessHow 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-rootHost access on this machineDirectory where the server’s file system is mounted on this machine (/ when Vandelay runs on the server).
source.host.destination--sshHost access over SSHuser@host or ssh://user@host:port of the mail server; user@host:port is saved as ssh://user@host:port.
source.host.identity--ssh-identityHost access over SSHPrivate key used to log in; the SSH agent and default keys otherwise.
source.host.known_hosts--ssh-known-hostsHost access over SSHknown_hosts file holding the server’s host key; the user’s file otherwise.
source.userdb.driver--userdbDovecotFormat of the file that lists Dovecot users and their password hashes.
source.userdb.path--userdb-pathDovecotPath of the user database on the server.
source.postfix--postfixDovecotDirectory holding main.cf and the alias and virtual maps, or false when the host runs no Postfix.
source.opendkim--opendkimDovecotOpenDKIM KeyTable file (for example /etc/opendkim/KeyTable), read to carry existing DKIM keys; leave empty when DKIM is signed elsewhere.
source.default_domain--default-domainDovecotDomain for passwd-file users written without one that match no Postfix virtual mailbox; overrides the domain read from main.cf.
source.config--dms-configdocker-mailserverHost 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-engineiRedMail, ModoboaDatabase 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-databaseiRedMail, ModoboaName 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-exportMailuJSON 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-selectorMailuDKIM_SELECTOR of the Mailu installation, used for the DKIM keys in the export file.
source.radicale--radicale-urlMailuhttp://<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-pinOther IMAP, Exchange, systems with host accessAccept 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--tenantMicrosoft 365Directory (tenant) id or a verified domain of the Microsoft 365 tenant, such as contoso.onmicrosoft.com.
source.client_id--client-idMicrosoft 365Client id of the app registration that holds the application permissions listed in the guide.
source.client_secret--client-secretMicrosoft 365Client 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--certificateMicrosoft 365PEM certificate uploaded to the app registration; set this or a client secret.
source.certificate.key--certificate-keyMicrosoft 365 with a certificatePEM private key of the certificate. Read from an environment variable or a file; never written to the plan.
source.service_account--service-accountGoogle WorkspaceJSON 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--adminGoogle Workspace, Mail-in-a-Box, ZimbraAddress 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--routeGoogle WorkspaceHow 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-passwordMail-in-a-BoxPassword 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-urlMail-in-a-BoxNextcloud 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-rootMail-in-a-BoxSTORAGE_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-urlZimbrahttps://host of the Zimbra mailbox service, where mail requests go; when empty, the admin URL without its port (port 443).
source.ews--ews-urlExchangehttps://host/EWS/Exchange.asmx of the Exchange server.
source.user--service-userExchangeSign-in name of the read-only service account with ApplicationImpersonation, as DOMAIN\user or user@domain.
source.ldap.url--ldap-urlExchangeldaps://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-baseExchange with Active DirectoryDistinguished name where the directory search starts, for example DC=example,DC=org.
source.ldap.tls.sha256--ldap-tls-pinExchange with Active DirectorySHA-256 fingerprint of the domain controller’s certificate, when it is not signed by a trusted authority.

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.

KeyFlagValueMeaning
selection.all--allboolMigrate every account found on the source.
selection.csv--frompath 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-disabledboolAlso migrate accounts that are disabled on the source.
selection.include_empty--include-emptyboolAlso migrate accounts that hold no mail or other data.
selection.account--accountemail addressAddress of the one source account to migrate; leave empty when the source sees only that account.

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:

KeyValueMeaning
targetAddressThe account’s address on Stalwart, when it changes
login_formsList of namesFurther login names to map to Stalwart at the switch, in addition to those discovered
folders.include, folders.excludeLists of regular expressionsFolder filters for this account, as in [data]
temporary_passwordBooleanGive this account a temporary password, whatever the password mode
skipBooleanLeave 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]]
address = "[email protected]"
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 [,].

KeyFlagValueMeaning
data.mail--mailboolCopy mail and the folder tree.
data.calendars--calendarsboolCopy calendars and their events.
data.contacts--contactsboolCopy address books and their contacts.
data.files--filesboolCopy file storage where the source has it.
data.sieve--sieveboolCopy Sieve scripts and keep the active one active.
data.rules--rulesboolConvert non-Sieve rules to Stalwart mail rules.
data.vacation--vacationboolCarry the vacation responder.
data.identities--identitiesboolCarry sender identities and signatures.
data.forwarding--forwardingboolCarry forwarding settings.
data.skip_junk--skip-junkboolDo not copy the Junk folder.
data.skip_trash--skip-trashboolDo not copy the Trash folder.
data.subscribed_only--subscribed-onlyboolCopy only the folders the user subscribes to.
data.folders.include--includelist of regexesRegular expressions, one regex per value; repeat the key for more, or give one per line. Only matching folders are copied.
data.folders.exclude--excludelist of regexesRegular expressions, one regex per value; repeat the key for more, or give one per line. Matching folders are not copied.

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.

KeyFlagValueMeaning
provisioning.passwords--passwordschoice: carry-or-temporary, temporary, externalCarry password hashes where possible, give everyone a temporary password, or leave sign-in to an external identity provider.
provisioning.carry_cleartext_passwords--carry-cleartext-passwordsboolCarry passwords the source stores in clear text; they are hashed before they reach Stalwart.
provisioning.dkim--dkimlist (max 300)Per domain: domain=import, domain=generate or domain=skip.
provisioning.existing_accounts--existing-accountschoice: use, skipUse existing Stalwart accounts as targets, or skip them.
provisioning.catch_all--catch-allchoice: after-last-switchServer-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--quotasboolSet each account’s quota from the source.
provisioning.aliases--aliasesboolAdd each account’s aliases.
provisioning.lists_and_groups--lists-and-groupsboolCreate mailing lists and groups.
provisioning.role--roletext (max 256)Stalwart role given to every account Vandelay creates.
provisioning.temp_password_length--temp-password-lengthnumber 12..64Length of generated temporary passwords.

Set with vandelay migrate options, or on the Cutover strategy step. cutover.mode is proxy, domain or none, as described in Planning.

KeyFlagValueMeaning
cutover.mode--cutoverchoice: proxy, domain, noneHow users are moved to Stalwart once their data is copied.
cutover.auto_switch--auto-switchboolSwitch 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-loginsduration (seconds 0..600)Total time logins may be held during one account’s switch (at most 10 minutes).
cutover.max_delta_age--max-delta-ageduration (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-leadduration (seconds 0..315360000)How far ahead of the planned MX change the checklist schedules the delta sweep; computed when empty.
cutover.parallel_accounts--parallelnumber 1..65535Number of accounts copied at the same time.
cutover.deltas--deltastext (max 16)manual, or an interval such as 6h between delta passes until the switch.
cutover.catch_up--catch-uptext (max 16)manual, or an interval such as 1d between catch-up passes after an account is switched.

Set with vandelay migrate options, under the Advanced section of the Cutover strategy step.

KeyFlagValueMeaning
advanced.threads--threadsnumber 1..256Worker threads used for one account.
advanced.runner_idle--runner-idleduration (seconds 10..315360000)The background runner exits after this long with nothing to do and nobody watching.
advanced.max_retries--max-retriesnumber 0..4294967295Retries of a failed task before the account needs a decision.
advanced.log_level--log-levelchoice: normal, verbose, protocol, wireDetail written to the account logs.