What it is for
Tools → IMAP Import copies the content of a mailbox of another IMAP server into a mailbox of this appliance. It is for migrating mailboxes from an old mail server or from an external provider without asking users to move the folders by hand.
Imports are queued jobs: one at a time runs, in order of arrival, even if you close the page. The program that copies is imapsync, run in an isolated service of the appliance.
Who can use it:
- the administrator chooses the destination mailbox among the domain users with mail (IMAP) enabled;
- a normal user, if they open the page (it is not in their menu), imports only into their own mailbox: the destination field is locked on their name («Imports go into your own mailbox.»).
Without the mail server the page says «Mail server is not configured yet. Complete the mail setup first.».
How the page is laid out


It is a single page: the queueing form on top, «Queue & history» below.
Source server
| Field | What it means | Example |
|---|---|---|
| «Remote IMAP server» | Host or host:port (default 993 with TLS, 143 without) |
198.51.100.90 |
| «Remote login» | The user of the source mailbox | jgreen@johnsmith.test |
| «Remote password» | Its password (it is not saved) | <password> |
| «Use TLS (IMAPS)» | Encrypted connection; on by default | on |
| «Skip certificate verification» | Accepts an invalid or self-signed certificate | off |
The source server must be external: addresses of the local network, loopback or private ones are not allowed, and the same applies to a name that resolves to one of them («It is a local-network, loopback or private address: imports only come from an outside server»). The check is made before queueing: if the address is wrong you read it at once («Enter a host name or an address, with a port if needed (e.g. imap.example.com:993)»).
Destination
| Field | What it means |
|---|---|
| «System user» | The local mailbox. For the administrator it is a «Select a user…» menu with the domain users who have mail enabled (surname name and user); for the user it is their own name, locked |
| «Destination folder (optional)» | A local folder (for example Imported) under which to put all the remote folders. Empty: the remote folders go into the root of the mailbox |
| «Dry run (report only, no changes)» | A trial: it copies nothing and only produces the report |
The required fields («Remote IMAP server», «Remote login», «Remote password» and, for the administrator, the user) are in bold; if one is missing: «Required field».
The button is «Queue import»: message «Import queued». After sending, the form clears the data of the single mailbox (the password and, for the administrator, the destination) and keeps the source server, so you can queue other mailboxes one after another.
Queue & history
Each import is a row with a status icon, the destination mailbox, the status (and «dry run» if it is one) and login@server:
| Status | Meaning | Actions |
|---|---|---|
| «Queued» | Waits for its turn | «Stop» (removes it from the queue) |
| «In progress» | Is copying | «Stop» (stops the import; the messages already copied stay) |
| «Completed» | Finished successfully | «Download the log» |
| «Failed» | Finished with an error | «Download the log» |
| «Stopped» | Stopped by you or by an administrator | «Download the log» |
The administrator sees all the imports, the user only their own. The outcome also arrives in the notifications (the bell, «IMAP imports»). «Download the log» gives a text file with everything imapsync printed; it is the first thing to look at if «Failed».
If you stop: «Take the import into … out of the queue?» or «Stop the import into …? The messages already copied stay in the mailbox.». If it does not succeed: «The import could not be stopped: it may have finished already.».
Warning The queue is kept in memory by Atlas: restarting Atlas empties it, and the import in progress is no longer followed or reported («Atlas keeps the queue in memory: restarting it empties the queue, and the import in progress is no longer followed or reported here…»). The queued ones have to be queued again. The log is lost too: download it when the job is finished. The program never deletes anything on the source server.
For the technician The import runs in a container from the image published by imapsync’s author (
docker.io/gilleslamiral/imapsync), on the internal services network. On the local side it authenticates as<user>*<master user>with Dovecot’s master login: the local user’s password is not needed. The remote side uses--ssl1if «Use TLS (IMAPS)» is on and--sslargs1 SSL_verify_mode=0if «Skip certificate verification» is on. The destination folder is--subfolder2, the dry run--dry. The remote password goes through a 0600 file that exists only for the duration of the job and never stays in the job record. Rejecting private addresses is a defence against using the tool to probe the internal network (SSRF).
Example: migrating Jack Green’s mailbox from the old server
Situation. The old mail server (198.51.100.90) is being decommissioned in a week. Jack Green also has the mailbox jgreen@johnsmith.test on the new one (Atlas), and you want to bring it into his account.
What you need. The account’s password on the old server, and the old server’s certificate must be valid (otherwise «Skip certificate verification»).
Steps.
- Open Tools → IMAP Import.
- In «Source server»: «Remote IMAP server»
198.51.100.90; «Remote login»jgreen@johnsmith.test; «Remote password»<password>; leave «Use TLS (IMAPS)» on. - In «Destination»: «System user» →
Green Jack (jgreen); turn «Dry run» off; «Destination folder» empty. - Press «Queue import».
Check. In «Queue & history» the row of jgreen changes from «Queued» to «In progress» and then to «Completed». Jack checks the mailbox and the folders (in the mail client or in Tools → Mail, if the groupware is installed).
If something goes wrong. If the row becomes «Failed», «Download the log»: the typical causes are a wrong password, an invalid certificate (turn on «Skip certificate verification» and try again) or a block by the old server for too many logins.
Example: trying first with a dry run
Situation. Julia Brown’s mailbox is large (tens of thousands of messages) and you want to know what will be copied before loading the server.
Steps.
- Fill in the form as above for
jbrownand turn on «Dry run (report only, no changes)». - Queue it and wait for «Completed» (the row has the label «dry run»).
- «Download the log»: it lists the folders and messages that would be copied, and the space.
- If it is as expected, queue it again with «Dry run» off.
Check. The second import really copies; the first did not touch the mailbox.
Example: a user imports their own old mailbox into a subfolder
Situation. Paul Black wants his old mail from an external provider, but without mixing it with the current one.
Steps. (As a user, not an administrator)
- Paul opens the page at
https://atlas.johnsmith.test/system/tools/imapsync. The «System user» field is locked on «Black Paul (pblack)». - He fills in server, login and password of the provider’s mailbox.
- In «Destination folder (optional)» he writes
Imported. - «Queue import».
Check. In his mailbox the folder Imported appears with the remote folders inside.
Limits
- External servers only: you cannot import from a server on the local network (not even from a Windows/Exchange server in the LAN). For a migration from the LAN another route is needed, see the scenario «Migrating mailboxes from the old server with IMAP Import» in Part III.
- One import at a time; the others wait.
- The queue and the logs do not survive a restart of Atlas.
- You import into the local mailbox: messages are never deleted on the source server.
- The job can last hours for a large mailbox: there is no deadline, but you can stop it.