Overview
Vandelay reads each source system through a connector. The connector knows where the system keeps its accounts, aliases, groups, lists, password hashes and DKIM keys, which protocols and APIs serve its mail, filters, calendars, contacts and files, and what cannot be migrated. The source is chosen on the Source: detect step (source.system), and its access is set on the Source: access step. Each system has its own page, and this page describes what they share.
Vandelay only reads the source. It never changes the source’s configuration or data, although some systems create state of their own the first time an account is read: Exchange initialises a mailbox at its first access, SOGo creates rows on first read, Zimbra records authentication tokens, and Dovecot creates default folders at a master user’s first login.
Supported systems
Section titled “Supported systems”The following table summarises where each connector reads accounts and mail, and what it needs on the source:
| System | Accounts from | Mail from | Access needed |
|---|---|---|---|
| Dovecot and Postfix | Dovecot userdb, Postfix maps | IMAP | Master user, host access |
| docker-mailserver | Configuration volume | IMAP | Master user, host access |
| iRedMail | SQL database | IMAP | Master user, host access |
| mailcow | mailcow API | IMAP | API key, master user |
| Mailu | Configuration export | IMAP | Export file, internal network |
| Mail-in-a-Box | Admin API | IMAP | Administrator, master user |
| Modoboa | SQL database | IMAP | Master user, host access |
| Zimbra | Admin SOAP API | IMAP | Global administrator |
| Exchange Server | Active Directory or CSV | Exchange Web Services | Service account with impersonation |
| Microsoft 365 | Microsoft Graph | Microsoft Graph | App registration |
| Google Workspace | Admin SDK | Gmail API or IMAP | Service account with domain-wide delegation |
| Other IMAP servers | Accounts CSV | IMAP | Master user or per-account passwords |
A Stalwart 0.15 or 0.16 server has no connector; its accounts are moved one by one with the per-account commands, as described in Stalwart (older versions). A system that is not listed, but serves IMAP, is migrated as an other IMAP server, with its accounts listed in a CSV file.
Detection
Section titled “Detection”Detection guesses the source system from a domain or an address, so that the right connector is pre-selected. It is optional, and it never fills credentials. From the Source: detect step, or with:
vandelay migrate detect example.orgVandelay probes the domain’s MX, SPF and SRV records, its autoconfig and Autodiscover documents, the .well-known JMAP, CalDAV and CardDAV endpoints, the IMAP greeting and the ManageSieve implementation of the likely mail hosts, known web paths of the hosted products, and the Microsoft sign-in realm of the domain. Each answer that identifies a system is a hint with a confidence of low, medium or high, and agreeing hints raise the confidence. The step pre-selects a system only at medium confidence or above, and only one that has a connector. Detection also fills the IMAP and ManageSieve URLs it found, and shows the tenant of a Microsoft 365 domain, which is entered on the Source: access step.
Some systems cannot be told apart from what they publish. docker-mailserver is detected as Dovecot, a generic IMAP server is not recognised at all, and a Stalwart server is recognised but cannot be selected. A migration proxy that already answers for the domain is reported too, with the notice A migration proxy answers for this domain (<host>); set its fields to cut over account by account.
Master user
Section titled “Master user”Most self-hosted connectors read every mailbox over IMAP and ManageSieve with one master user, an account the source lets sign in as any user with its own password, so that no user password is needed. The fields are “Master user” (source.master.name) and “Master, admin or service account password” (source.master.password, a secret reference). The source page describes how to create the master user on each system.
The “Master login format” (source.master.form) decides how Vandelay presents the user and the master to the source:
- A separator character,
*unless set otherwise, makes the login<user>*<master>with the master’s password. Dovecot and the systems built on it accept this form. Any ASCII punctuation character other than@,.,",\and/can be used, and a login that contains the separator is refused withthe login "<login>" contains the master user separator '<separator>'. authzidsigns in with SASL PLAIN, with the master as the authentication identity and the user as the authorisation identity. Zimbra and Cyrus use this form.
Host access
Section titled “Host access”Several systems keep data that their protocols do not expose: password hashes, the user database, Postfix maps, DKIM keys, quotas and the files of disabled accounts. Vandelay reads them from the source’s file system, either locally or over SSH, as set by “Server file access” (source.host.kind):
- On this machine (
local), with “Server root directory” (source.host.root). The root is/when Vandelay runs on the source, or the directory where the source’s file system is mounted. A root other than/allows only file reads; systems that need to rundoveconf,zmprov, a database client ordockerneed/or SSH, and are refused with<program> cannot run against the mounted root "<root>"; use ssh host access or root "/". - Over SSH (
ssh), with “SSH destination” (source.host.destination), given asuser@host, or asssh://user@host:portfor a port other than 22 (a value writtenuser@host:portis saved in that form), and optionally “SSH key file” and “SSH known hosts file”. Vandelay runs the system’ssshcommand in batch mode, so the key must work without a passphrase prompt, or be loaded in an SSH agent, and the host key must already be known. One connection is reused for many reads.
Over either path, Vandelay runs only these programs, read-only: cat, ls, stat and realpath to read files, doveconf to query Dovecot’s settings, docker to inspect and read containers, zmprov on Zimbra, and the mysql, psql and sqlite3 clients for SELECT queries. Each command may run for at most 120 seconds and return at most 64 MiB. The user that Vandelay signs in as must be able to read the files the source page names, which for most systems means root.
Certificate pins
Section titled “Certificate pins”A source with a self-signed certificate, or one issued by a private authority, is accepted through a pin of its certificate’s SHA-256 fingerprint in “Source certificate pin (SHA-256)” (source.tls.sha256). Vandelay never turns certificate verification off. The pin applies to the host of the IMAP URL for IMAP-based systems, to the host of the admin URL for mailcow, Mail-in-a-Box and Zimbra, and to the EWS host for Exchange.
A pin matches a host name, not a port: it covers every connection Vandelay makes to that host, on any port. A pinned host is reached only over TLS, so a pinned source with an imap:// or sieve:// URL negotiates STARTTLS, and a plan that allows clear-text connections to it is refused with <field>: <host> has a pinned certificate, so the source must use TLS to it; set source.cleartext = "forbid" or use imaps and sieves. When the Stalwart proxy runs on the source host and its admin URL uses the source’s name, a pin for the proxy makes TLS mandatory for the source in the same way, as Proxy explains.
Clear-text connections
Section titled “Clear-text connections”“Credentials without TLS” (source.cleartext) is forbid by default: an imap:// or sieve:// URL is upgraded with STARTTLS, and a password is never sent over an unencrypted connection. allow lets the connection stay unencrypted, which is needed only for a server that offers no TLS at all, such as Mailu’s internal IMAP container. The REST APIs of mailcow, Mail-in-a-Box and Zimbra must always be reached over HTTPS, except on a loopback address.
Accounts CSV
Section titled “Accounts CSV”Sources that cannot list their accounts take them from a CSV file, set in “Accounts CSV” (source.accounts) for any other IMAP server and for Exchange Server without Active Directory. Dovecot with a CSV user database reads the same format from “Dovecot user database file” (source.userdb.path). The first line names the columns, in any order, and only address is required:
| Column | Meaning |
|---|---|
address | The account’s address on the source, also its login unless login is set |
target | The account’s address on Stalwart, when it changes |
kind | user (the default), shared, group, room or equipment |
login | The login name on the source, when it differs from the address |
password | A secret reference to the account’s password, or empty when a master user is configured |
aliases | Further addresses, separated by ;, , or spaces |
display_name | The name shown for the account |
quota | The mailbox quota in bytes |
The following file lists two accounts with per-account passwords, read from an environment variable and from a file:
address,login,password,aliases[email protected],alice,env:ALICE_PASSWORD,[email protected][email protected],,file:secrets/bob.txt,Clear-text passwords are refused, so the file holds only references and can be kept with the project. A relative file: path is resolved against the directory of the CSV, and a line whose first character is # is a comment. The file may hold up to 200,000 rows, with up to 256 aliases per row. The path names a file on the host where Vandelay runs, whichever interface sets it.
Password hashes
Section titled “Password hashes”With the password mode “Keep existing passwords where possible”, Vandelay carries the hash that the source stores for each account, and Stalwart verifies the user’s existing password against it. The connector reads the hash where the system keeps it (the user database, the SQL database, the mailcow database, the Mailu export, Zimbra’s directory), and the hash is carried when Stalwart supports its scheme: the crypt family (MD5, SHA-256, SHA-512, SHA-1 and DES crypt), bcrypt, Argon2, PBKDF2 with SHA-256 or SHA-512, scrypt, the plain MD5, SHA, SHA-256 and SHA-512 digests, and the salted SHA, SHA-256 and SHA-512 digests (SSHA, SSHA256 and SSHA512).
Schemes that Stalwart cannot verify, such as salted MD5 (SMD5), CRAM-MD5, DIGEST-MD5, SCRAM, NTLM, yescrypt and Mailu’s bcrypt-sha256, are not carried, and the account gets a temporary password instead. So does a hash whose cost exceeds what Stalwart verifies safely, such as bcrypt above cost 15. Passwords stored in clear text are carried only when “Carry clear-text passwords” is on. Pre-flight’s “Passwords” check counts the accounts per outcome and names each scheme that falls back to a temporary password, so the result is known before any account is created. Hosted services and Exchange expose no hashes at all.
Bound settings
Section titled “Bound settings”The settings that identify the source are bound when work starts and cannot change afterwards, because the archives and the recorded state refer to them: the system, its IMAP and ManageSieve URLs, the host access, and the system’s own endpoints (the database location, the admin URL, the EWS and directory URLs, the Microsoft 365 tenant, the Google mail route). Credentials, the master user, the certificate pin, the accounts CSV and the clear-text setting stay editable.