Add native Dovecot mailbox backup and restore #26

Merged
parkel merged 3 commits from feature/native-mailbox-backups into main 2026-11-21 12:24:16 +01:00
2 changed files with 37 additions and 0 deletions
Showing only changes of commit bd0f0a3e57 - Show all commits

No files matched your search

+4
View File
@@ -416,3 +416,7 @@ mailbox requests and the **Can add mailbox provisioning** permission.
The initial password stays in the root-only credentials file on the mail node.
To locate that file, download the manifest and use the node's `apply` command.
Reapplying the manifest preserves the password and prints the file path.
Back up mail on the node that hosts the mailbox. The archive can be used to
recover messages and folders into a newly provisioned mailbox with the same
address. [Mailbox backup and restore](development.md#back-up-and-restore-a-mailbox)
+33
View File
@@ -487,6 +487,39 @@ installation needs attention.
Exit code `1` indicates an invalid manifest or an invocation error such as
running the check without root privileges.
### Back up and restore a mailbox
Download the mailbox manifest from the panel and run the backup on the node
that hosts the mailbox. Use a new archive name in a root-controlled directory.
```sh
sudo install -d -m 0700 /var/backups/coulobre
sudo /opt/coulobre/bin/coulobre-mail-node backup-mailbox \
coulobre-mailbox-1.json /var/backups/coulobre/mailbox-1.tar.gz
```
Coulobre uses Dovecot to copy the managed mailbox into temporary Maildir
storage before creating the archive. Allow space for that copy on the mail
volume. The archive contains messages, folders, IMAP flags, and subscriptions.
Mailbox passwords and node configuration stay on the node. If Dovecot reports
an incomplete sync, retry when the mailbox is idle.
[Dovecot backup command](https://doc.dovecot.org/2.4.4/core/man/doveadm-backup.1.html)
To recover mail, apply the original mailbox manifest on the destination node.
Use a newly provisioned mailbox that has received no delivery or client
access and has no existing `Maildir`. Keep delivery and client access paused
for that mailbox until recovery completes. Keep Postfix and Dovecot running
for the local configuration checks. Transfer the archive if needed and
ensure it is owned by root with mode `0600`.
```sh
sudo /opt/coulobre/bin/coulobre-mail-node restore-mailbox \
coulobre-mailbox-1.json /var/backups/coulobre/mailbox-1.tar.gz
```
The node checks the address and validates the archive before publishing the
restored Maildir. Sign in with the destination mailbox's credentials.
### Enable local mailbox provisioning
On a mail node with the same Postfix and Dovecot setup, install Coulobre in a