On Wed, 22 Nov 2023, Matthias Nagel wrote:
Dear all,
I am using Dovecot sdbox format for mailboxes. Is there an option to temporarily make Dovecot read-only while the mailboxes are being backed-up such that a consistent state is backed-up?
I am looking for some command which I can use as pre- and post-hook for Borgbackup. I am looking for a way such that Dovecot defers any mail coming in via LMTP from Postfix, denies modifying mails/mailboxes via IMAP while Dovecot still allows to browse mails read-only.
Is that possible?
I think the recommended way (and this is what I do) is to use "doveadm backup" to do a one-way synchronization (i.e. a backup) of the "live" mailboxes to another destination (which can be local or remote).
In my case, I periodically run doveadm backup to make a local "snapshot" of the mailboxes, which I then backup, using both rsync (to one server) and borgbackup (to another server).
AFAIK (but I don't have a reference now), using "doveadm backup" will create a working/consistent snapshot, even if dovecot writes/changes/etc. messages. This is not the case with rsync or any filesystem-related utilities.
Hope that helps, Bernardo