Doveadm backup doesn't interpret placeholders
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
On 19.01.2017 10:49, James Pharaoh wrote:
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
Try doveadm -o mail_home=/var/mail/mailboxes-backup/%d/accounts/%u backup -A mdbox:~/
Aki
On 23/01/17 09:53, Aki Tuomi wrote:
On 19.01.2017 10:49, James Pharaoh wrote:
Dovecot version: 2.2.27
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
Try doveadm -o mail_home=/var/mail/mailboxes-backup/%d/accounts/%u backup -A mdbox:~/
This won't work, surely, because I use a similar pattern for the source, basically without the "-backup" bit.
If you can confirm this is not supported I'm happy to create a patch for it myself, it doesn't seem like it will be very difficult.
James
On 23.01.2017 11:35, James Pharaoh wrote:
On 23/01/17 09:53, Aki Tuomi wrote:
On 19.01.2017 10:49, James Pharaoh wrote:
Dovecot version: 2.2.27
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
Try doveadm -o mail_home=/var/mail/mailboxes-backup/%d/accounts/%u backup -A mdbox:~/
This won't work, surely, because I use a similar pattern for the source, basically without the "-backup" bit.
If you can confirm this is not supported I'm happy to create a patch for it myself, it doesn't seem like it will be very difficult.
James
Oh, then it won't work. The reason this interpolation does not occur is that we consider % a valid path name. We have been considering how to solve this, and possibly it requires some config flag to permit interpolation in mailbox location when given from command line.
A patch is welcome, of course, but please keep this is mind. =)
Aki
participants (2)
-
Aki Tuomi
-
James Pharaoh