Dovevot backup with dsync an public mailbox

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

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

Hello @lebernd,

Thanks for the feedback!

I searched long time for a working solution and with several tests. But without success.

But now I reused the script above with success!

Each “shared IMAP” folder has an e-mail address. So I used the script with dedicated e-mail addresses (of the shared IMAP folder) without test of the e-mail address itself. And it is working!

# CUSTOM - Path and file name of a file with e-mail addresses to backup, if
#          SET. If NOT, the script will determine all mailboxes by default.
# FILE_USERLIST='/path/and/file/name/of/user/list/with/one/user/per/line'
# - OR -
# FILE_USERLIST=''
FILE_USERLIST='**/usr/local/bin/mail_folder.cfg**'

# CUSTOM - Check when FILE_USERLIST was used, if the user per line was a
#          valid e-mail address [Y|N].
FILE_USERLIST_VALIDATE_EMAIL='**N**'

Mastodon