From 9a53cf625a114b4db2d6589c8e009663750792ed Mon Sep 17 00:00:00 2001 From: Peter van Arkel Date: Thu, 3 Dec 2026 22:46:10 +0100 Subject: [PATCH] Document mailbox import setup and mail cutover --- deploy/panel.env.example | 2 ++ docs/deployment.md | 52 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/deploy/panel.env.example b/deploy/panel.env.example index 135b541..41d257d 100644 --- a/deploy/panel.env.example +++ b/deploy/panel.env.example @@ -40,6 +40,8 @@ COULOBRE_BROKER_URL=amqp://coulobre:@127.0.0.1:5672/coulobre # COULOBRE_LOCAL_MAILBOX_CREDENTIALS_ROTATION=1 # COULOBRE_REMOTE_MAILBOX_CREDENTIALS_ROTATION=1 # COULOBRE_MAIL_IMAP_HOST=mail.example.org +# Requires the dedicated mailbox import worker. +# COULOBRE_MAILBOX_IMAP_IMPORT=1 # COULOBRE_MAIL_MX_HOST=mx.example.org # COULOBRE_MAIL_DNS_RESOLVERS= # COULOBRE_MAIL_SENDING_IPS= diff --git a/docs/deployment.md b/docs/deployment.md index 1f8aecb..491bc16 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -2367,6 +2367,58 @@ admin under **Service credential accesses**. The audit log includes the actor and resource identifiers. After five incorrect confirmations within five minutes, the panel temporarily stops accepting new attempts for that user. +### Import mail from an external IMAP server + +An operator can enable mailbox imports on a panel that provisions either local +mailboxes or mailboxes on a linked Coulobre mail node. The worker connects +directly to the existing mailbox at `COULOBRE_MAIL_IMAP_HOST`. The mail node +does not need a new socket, SSH account, or provisioning permission. + +Set `COULOBRE_MAILBOX_IMAP_IMPORT=1` in `/etc/coulobre/panel.env`. From the +matching Coulobre source release, or its installed copy at +`/usr/share/coulobre-panel/source` for APT installations, install the worker. + +```sh +sudo install -m 0644 deploy/systemd/coulobre-mailbox-import-worker.service \ + /etc/systemd/system/ +sudo systemctl daemon-reload +sudo systemctl enable --now coulobre-mailbox-import-worker.service +sudo systemctl restart coulobre-panel.service coulobre-beat.service +``` + +Open **Email Accounts**, find an existing mailbox, and choose **Import mail**. +Customers can import into their own mailboxes. Operators need mailbox view +and change permissions. Enter the external IMAP hostname, username, and +password or app password, plus the current destination mailbox password. +Both servers must support IMAP with implicit TLS on port 993 and present +certificates the panel trusts for their hostnames. The source must resolve +only to public addresses. The destination uses the panel's configured +hostname and may be private. OAuth-only accounts are not supported. + +The worker checks both logins before writing. Progress shows the number of +messages copied and flags skipped in each folder. The import preserves +messages, folder hierarchy, original internal dates and supported flags. +It skips the transient `\Recent` flag and does not copy the `\Deleted` +flag. It does not mark a message as read at the source, remove existing +messages, or change DNS. It does not copy contacts, calendars, or server +rules. Destination UIDs are assigned by the destination IMAP server. + +For a mail cutover, run the first pass before changing mail routing. After the +source stops receiving mail, resume with the same servers and usernames +to copy new arrivals. If quota, a connection error, or the 12-minute pass +limit interrupts the copy, correct the problem and resume. Already copied +messages are skipped using a saved UID checkpoint. If a folder changes its +UID identity, inspect the source and destination before retrying. Folder +renames or moves are not mirrored. A pass supports up to 500 folders and +messages of up to 50 MiB. + +Passwords are encrypted while the job is queued and are removed from the +current job record when it finishes or expires. Jobs must start within 30 +minutes. Enter the passwords again to retry or run another pass. If a job +does not start, check `journalctl -u coulobre-mailbox-import-worker`. Let +active imports finish before a manual upgrade, stop the import worker with +the other panel workers, and start it again after migrations. + ### Rotate a database or mailbox password Enable the corresponding local credential service first. For each local