Dovevot backup with dsync an public mailbox

dovecot

#1

Hello,

I use ucs mail server on an domain member with “public e-mail box” with access rights (full) to several users.

For backup I use this excellent script to create daily backups from all ucs users with an e-mail account:
https://dokuwiki.tachtler.net/doku.php?id=tachtler:dovecot_backup_-_skript

The script is executed under root and with cron jobs.

Everything is working well. But the public e-mail box isn’t included in the backup.

Did somebody have some idea what is missing?

Thanks


#2

Hello @AG_DD,

as I’m working at the moment over a dsync solution for my mailserver reading a lot of documentation - that’s what I’ve found:

dsync is running at a per user base so you will see in the tachtler-script something like:

if [ ! -n "$FILE_USERLIST"  ]; then
        log "Check if the variable FILE_USERLIST is set ................[  NO  ]"
        log "Mailboxes to backup will be determined by doveadm user \"*\"."
 
	for users in `doveadm user "*"`; do
		VAR_LISTED_USER+=($users);
	done

You can also find a warning concerning shared and public folder in the dovecot-wiki https://wiki.dovecot.org/Replication :

WARNING : Shared folder replication doesn’t work correctly right now – mainly it can generate a lot of duplicate emails. This is because there’s currently a per-user lock that prevents multiple dsyncs from working simultaneously on the same user. But with shared folders multiple users can be syncing the same folder. So this would need additional locks (e.g. shared folders would likely need to lock the owner user, and public folders would likely need a per-folder lock or a maybe a global public folder lock). Fixing this is currently low priority for Dovecot developers.

Nevertheless doveadm sync also knows the option -m for a mailbox-sync. The script then would have to be extended to also backup this mailbox.

It isn’t a solution yet, but perhaps the reason why the script won’t backup this mailbox.

Best, Bernd