Doveadm backup doesn't interpret placeholders

James Pharaoh james at pharaoh.uk
Thu Jan 19 08:49:44 UTC 2017


Hi,

Dovecot version: 2.2.27

I'm using replication between two servers for high availability, but I 
also want to backup all users. I have a setting for the replication to 
work like this:

plugin {
     mail_replica = tcp:other-dovecot
}

This is fine, but then I also want to do a backup to a different 
directory for all users, since I am having trouble with an apparent bug 
running dovecot on btrfs. For this reason, I am storing my emails on 
ext4, but want to sync them to the BTRFS filesystem I use for my server 
before doing a snapshot.

My mails are stored in /var/mail/mailboxes, and the backup is in 
/var/mail/mailboxes-backup, the former being the ext4 mount and the 
latter being part of the btrfs filesystem which belongs to the container 
where all this runs.

The problem is that dovecot seems to only have a single concept of the 
mail backup location, which is either a remote, as above, or a 
filesystem location.

The logical answer seems to be to provide the backup location when 
performing the local copy for a snapshot, so I run:

doveadm backup -A mdbox:/var/mail/mailboxes-backup/%d/accounts/%u

However, this is not picking up the %d and %u placeholders and replacing 
them with the values, as it would if configured with the option above. 
The only workaround I can find is to run doveadm backup individually for 
every user, with the full expanded path for each one.

Am I missing something, or would it make sense for doveadm backup to 
simply recognise and respect these placeholders when passed on the 
command line?

I've tried all sorts of other things, including -o mail_replica, and 
putting stuff in the userdb, but I can't find any other way to do this.

Thanks in advance,
James


More information about the dovecot mailing list