<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>All,</p>
<p>For the past 2 weeks I have been trying to get dovecot mail
backup working between 2 debian 10 machines.</p>
<p>Both machines are running the same OS (Debian 10) and
configuration wise they are similar (except of course ip
addresses, hostnames etc).<br>
</p>
<p>My "main" machine is called "server" and the 2nd machine is
"server2".</p>
<p>See below for the dovecot -n output on server2.</p>
<p>I created a testuser called synctest on both server1 and server2
and have sent a couple (2) email messages to synctest@server.</p>
<p>Those testmessages are now present in /var/mail/synctest mbox
file on server1.</p>
<p>When trying to create a backup from server->server2 for user
synctest I use this command:</p>
<p>#doveadm -D -v backup -R -f -u synctest tcp:192.168.3.1:12345<br>
(using something similar from server1 -> server2 like this:
#doveadm -D -v backup -f -u synctest tcp:192.168.3.2:12345 has the
same results btw)</p>
<p>The first attempte appears to be working OK but the the 2nd
attempt (nothing was changed on server1 before the 2nd attempt)
fails with soemthing like: <font size="-2" face="Courier New,
Courier, monospace">Error: Couldn't delete mailbox INBOX:
Permission denied</font><br>
</p>
<p>Before I can get a succesfull backup again I need to do this (on
server2):</p>
<p>#rm /var/mail/synctest<br>
#rm -r ~syncuser/mail/index/INBOX<br>
#doveadm mailbox delete -u synctest INBOX <br>
(if I don't do the rm /var/mail/synctest before the doveadm
mailbox delete command I will also get a:<br>
<font size="-2" face="Courier New, Courier, monospace">Error:
Can't delete mailbox INBOX: Permission denied</font><br>
</p>
<p>Anybody any idea what is happening here? Should I enable
replicator and/or aggregator?<br>
</p>
<p>Output of 1st and 2nd dovadm backup attempt is below:</p>
<p>root@server2:/home/synctest/mail# doveadm -D -v backup -R -f -u
synctest tcp:192.168.3.1:12345<br>
<font size="-2" face="Courier New, Courier, monospace">Debug:
Loading modules from directory: /usr/lib/dovecot/modules/doveadm<br>
Debug: Skipping module doveadm_acl_plugin, because dlopen()
failed:
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_acl_plugin.so:
undefined symbol: acl_user_module (this is usually intentional,
so just ignore this message)<br>
Debug: Skipping module doveadm_expire_plugin, because dlopen()
failed:
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_expire_plugin.so:
undefined symbol: expire_set_deinit (this is usually
intentional, so just ignore this message)<br>
Debug: Skipping module doveadm_quota_plugin, because dlopen()
failed:
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_quota_plugin.so:
undefined symbol: quota_user_module (this is usually
intentional, so just ignore this message)<br>
Debug: Module loaded:
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_sieve_plugin.so<br>
Debug: Skipping module doveadm_fts_lucene_plugin, because
dlopen() failed:
/usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_lucene_plugin.so:
undefined symbol: lucene_index_iter_deinit (this is usually
intentional, so just ignore this message)<br>
Debug: Skipping module doveadm_fts_plugin, because dlopen()
failed:
/usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_plugin.so:
undefined symbol: fts_user_get_language_list (this is usually
intentional, so just ignore this message)<br>
Debug: Skipping module doveadm_mail_crypt_plugin, because
dlopen() failed:
/usr/lib/dovecot/modules/doveadm/libdoveadm_mail_crypt_plugin.so:
undefined symbol: mail_crypt_box_get_pvt_digests (this is
usually intentional, so just ignore this message)<br>
doveadm(synctest)<13039><>: Debug: auth USER input:
synctest system_groups_user=synctest uid=1006 gid=100
home=/home/synctest<br>
doveadm(synctest): Debug: remote(192.168.3.1:12345): auth USER
input: synctest system_groups_user=synctest uid=1006 gid=100
home=/home/synctest<br>
doveadm(synctest): Debug: remote(192.168.3.1:12345): Effective
uid=1006, gid=100, home=/home/synctest<br>
doveadm(synctest): Debug: remote(192.168.3.1:12345): Namespace
inbox: type=private, prefix=, sep=, inbox=yes, hidden=no,
list=yes, subscriptions=yes
location=mbox:~/mail/mailboxes:INBOX=/var/mail/synctest:DIRNAME=mBoX-MeSsAgEs:INDEX=~/mail/index:CONTROL=~/mail/control<br>
doveadm(synctest): Debug: remote(192.168.3.1:12345): fs:
root=/home/synctest/mail/mailboxes,
index=/home/synctest/mail/index, indexpvt=,
control=/home/synctest/mail/control, inbox=/var/mail/synctest,
alt=<br>
doveadm(synctest): Debug: Effective uid=1006, gid=100,
home=/home/synctest<br>
doveadm(synctest): Debug: Namespace inbox: type=private,
prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes
location=mbox:~/mail/mailboxes:INBOX=/var/mail/synctest:DIRNAME=mBoX-MeSsAgEs:INDEX=~/mail/index:CONTROL=~/mail/control<br>
doveadm(synctest): Debug: fs:
root=/home/synctest/mail/mailboxes,
index=/home/synctest/mail/index, indexpvt=,
control=/home/synctest/mail/control, inbox=/var/mail/synctest,
alt=<br>
doveadm(synctest): Debug: brain M: Namespace has location
mbox:~/mail/mailboxes:INBOX=/var/mail/synctest:DIRNAME=mBoX-MeSsAgEs:INDEX=~/mail/index:CONTROL=~/mail/control<br>
doveadm(synctest): Debug: Namespace : Using permissions from
/home/synctest/mail/mailboxes: mode=0700 gid=default<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Remote mailbox tree: INBOX
guid=f8ecea204a65f05fea460000b4581695 uid_validity=1609590090
uid_next=9 subs=no last_change=0 last_subs=0<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Mailbox INBOX:
local=00000000000000000000000000000000/0/0,
remote=f8ecea204a65f05fea460000b4581695/0/1: mailbox not
selectable yet<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
Namespace : /home/synctest/mail/mailboxes/INBOX doesn't exist
yet, using default permissions<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
Namespace : Using permissions from
/home/synctest/mail/mailboxes: mode=0700 gid=default<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
Namespace : /home/synctest/mail/mailboxes/INBOX doesn't exist
yet, using default permissions<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
Namespace : Using permissions from
/home/synctest/mail/mailboxes: mode=0700 gid=default<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
Namespace : /home/synctest/mail/mailboxes/INBOX doesn't exist
yet, using default permissions<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
Namespace : Using permissions from
/home/synctest/mail/mailboxes: mode=0700 gid=default<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
Namespace : /home/synctest/mail/mailboxes/INBOX doesn't exist
yet, using default permissions<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
Namespace : Using permissions from
/home/synctest/mail/mailboxes: mode=0700 gid=default<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=1 hdr_hash= result=Expunged mail not
found locally<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=2 hdr_hash= result=Expunged mail not
found locally<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=3 hdr_hash= result=Expunged mail not
found locally<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=4 hdr_hash= result=Expunged mail not
found locally<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=5 hdr_hash= result=Expunged mail not
found locally<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=6 hdr_hash= result=Expunged mail not
found locally<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Last common UID=0. Delayed expunges=<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import change type=save
GUID=8bce3bc615e7f2a1dfad970a3cd36bdb UID=7 hdr_hash=
result=Mail's UID is above local UIDNEXT - No more local mails
found<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import change type=save
GUID=c9cdf5f725d4195db78b20bbacad189b UID=8 hdr_hash= result=New
mail<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: import mail uid 0 guid 8bce3bc615e7f2a1dfad970a3cd36bdb<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import mail body for
GUID=8bce3bc615e7f2a1dfad970a3cd36bdb UID=0<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
/home/synctest/mail/index/INBOX/dovecot.index.cache: Compressed,
file_seq changed 0 -> 1609779677, size=32, max_uid=0<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: import mail uid 0 guid c9cdf5f725d4195db78b20bbacad189b<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Import mail body for
GUID=c9cdf5f725d4195db78b20bbacad189b UID=0<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Saved UIDs: 7:8<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Finish update: min_next_uid=9
min_first_recent_uid=1 min_highest_modseq=10
min_highest_pvt_modseq=0<br>
dsync-local(synctest)<D+AKA91J81/vMgAAaso27A>: Debug:
brain M: Import INBOX: Reassign UIDs: 1:<br>
</font></p>
<p>This appears to work perfectly well the first time (maybe I am
overlooking some issue already at this stage?) At least after the
backup has been completed /var/mail/syncuser on server2 contains
all the messages that are also present on server1. And the
~syncuser/mail/index/INBOX folder also exists (don't know why this
is created btw?)<br>
</p>
<p>But then when running the same command for the 2nd time (and no
changes on the /var/mail/synctest file on server1) the command
failes like this (permission denied to delete INBOX at the end):</p>
<p>root@server2:/home/synctest/mail# doveadm -D -v backup -R -f -u
synctest tcp:192.168.3.1:12345<font size="-2" face="Courier New,
Courier, monospace"><br>
Debug: Loading modules from directory:
/usr/lib/dovecot/modules/doveadm<br>
Debug: Skipping module doveadm_acl_plugin, because dlopen()
failed:
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_acl_plugin.so:
undefined symbol: acl_user_module (this is usually intentional,
so just ignore this message)<br>
Debug: Skipping module doveadm_expire_plugin, because dlopen()
failed:
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_expire_plugin.so:
undefined symbol: expire_set_deinit (this is usually
intentional, so just ignore this message)<br>
Debug: Skipping module doveadm_quota_plugin, because dlopen()
failed:
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_quota_plugin.so:
undefined symbol: quota_user_module (this is usually
intentional, so just ignore this message)<br>
Debug: Module loaded:
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_sieve_plugin.so<br>
Debug: Skipping module doveadm_fts_lucene_plugin, because
dlopen() failed:
/usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_lucene_plugin.so:
undefined symbol: lucene_index_iter_deinit (this is usually
intentional, so just ignore this message)<br>
Debug: Skipping module doveadm_fts_plugin, because dlopen()
failed:
/usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_plugin.so:
undefined symbol: fts_user_get_language_list (this is usually
intentional, so just ignore this message)<br>
Debug: Skipping module doveadm_mail_crypt_plugin, because
dlopen() failed:
/usr/lib/dovecot/modules/doveadm/libdoveadm_mail_crypt_plugin.so:
undefined symbol: mail_crypt_box_get_pvt_digests (this is
usually intentional, so just ignore this message)<br>
doveadm(synctest)<13056><>: Debug: auth USER input:
synctest system_groups_user=synctest uid=1006 gid=100
home=/home/synctest<br>
doveadm(synctest): Debug: remote(192.168.3.1:12345): auth USER
input: synctest system_groups_user=synctest uid=1006 gid=100
home=/home/synctest<br>
doveadm(synctest): Debug: remote(192.168.3.1:12345): Effective
uid=1006, gid=100, home=/home/synctest<br>
doveadm(synctest): Debug: remote(192.168.3.1:12345): Namespace
inbox: type=private, prefix=, sep=, inbox=yes, hidden=no,
list=yes, subscriptions=yes
location=mbox:~/mail/mailboxes:INBOX=/var/mail/synctest:DIRNAME=mBoX-MeSsAgEs:INDEX=~/mail/index:CONTROL=~/mail/control<br>
doveadm(synctest): Debug: remote(192.168.3.1:12345): fs:
root=/home/synctest/mail/mailboxes,
index=/home/synctest/mail/index, indexpvt=,
control=/home/synctest/mail/control, inbox=/var/mail/synctest,
alt=<br>
doveadm(synctest): Debug: Effective uid=1006, gid=100,
home=/home/synctest<br>
doveadm(synctest): Debug: Namespace inbox: type=private,
prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes
location=mbox:~/mail/mailboxes:INBOX=/var/mail/synctest:DIRNAME=mBoX-MeSsAgEs:INDEX=~/mail/index:CONTROL=~/mail/control<br>
doveadm(synctest): Debug: fs:
root=/home/synctest/mail/mailboxes,
index=/home/synctest/mail/index, indexpvt=,
control=/home/synctest/mail/control, inbox=/var/mail/synctest,
alt=<br>
doveadm(synctest): Debug: brain M: Namespace has location
mbox:~/mail/mailboxes:INBOX=/var/mail/synctest:DIRNAME=mBoX-MeSsAgEs:INDEX=~/mail/index:CONTROL=~/mail/control<br>
doveadm(synctest): Debug: Namespace :
/home/synctest/mail/mailboxes/INBOX doesn't exist yet, using
default permissions<br>
doveadm(synctest): Debug: Namespace : Using permissions from
/home/synctest/mail/mailboxes: mode=0700 gid=default<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Local mailbox tree: INBOX
guid=f8ecea204a65f05fea460000b4581695 uid_validity=1609590090
uid_next=9 subs=no last_change=0 last_subs=0<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Remote mailbox tree: INBOX
guid=f8ecea204a65f05fea460000b4581695 uid_validity=1609590090
uid_next=9 subs=no last_change=0 last_subs=0<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Mailbox INBOX:
local=f8ecea204a65f05fea460000b4581695/0/1,
remote=f8ecea204a65f05fea460000b4581695/0/1: Mailboxes are equal<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
Namespace : /home/synctest/mail/mailboxes/INBOX doesn't exist
yet, using default permissions<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
Namespace : Using permissions from
/home/synctest/mail/mailboxes: mode=0700 gid=default<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=1 hdr_hash= result=Expunged mail has no
GUID, can't verify it<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=2 hdr_hash= result=Expunged mail has no
GUID, can't verify it<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=3 hdr_hash= result=Expunged mail has no
GUID, can't verify it<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=4 hdr_hash= result=Expunged mail has no
GUID, can't verify it<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=5 hdr_hash= result=Expunged mail has no
GUID, can't verify it<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Import INBOX: Import change type=expunge
GUID=<unknown> UID=6 hdr_hash= result=Expunged mail has no
GUID, can't verify it<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Warning:
Deleting mailbox 'INBOX': UID=7 already exists locally for a
different mail: Headers hashes don't match
(9fc2f2229a1a2a8d5f12304cb5287f97 vs
b62e0281b4f375a45040c552b55ab31a)<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Import INBOX: Import change type=save
GUID=8bce3bc615e7f2a1dfad970a3cd36bdb UID=7
hdr_hash=9fc2f2229a1a2a8d5f12304cb5287f97 result=Headers hashes
don't match (9fc2f2229a1a2a8d5f12304cb5287f97 vs
b62e0281b4f375a45040c552b55ab31a)<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
brain M: Import INBOX: Saved UIDs:<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
doveadm-sieve: Iterating Sieve mailbox attributes<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
sieve: Pigeonhole version 0.5.4 () initializing<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
sieve: include: sieve_global is not set; it is currently not
possible to include `:global' scripts.<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
sieve: file storage: Using active Sieve script path:
/home/synctest/.dovecot.sieve<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
sieve: file storage: Using script storage path:
/home/synctest/sieve<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
sieve: file storage: Using permissions from
/home/synctest/sieve: mode=0700 gid=-1<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
sieve: file storage: Relative path to sieve storage in active
link: sieve/<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Debug:
sieve: file storage: sync: Synchronization active<br>
dsync-local(synctest)<VqbhHQhL818AMwAAaso27A>: Error:
Couldn't delete mailbox INBOX: Permission denied</font><br>
</p>
<p>root@server2:/home/synctest/mail# dovecot -n<br>
# 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf<br>
# Pigeonhole version 0.5.4 ()<br>
# OS: Linux 4.19.0-12-amd64 x86_64 Debian 10.6<br>
# Hostname: server2.fritz.box<br>
auth_username_format = %Ln<br>
doveadm_password = # hidden, use -P to show it<br>
lda_mailbox_autocreate = yes<br>
login_trusted_networks = 192.168.3.0/24<br>
mail_location =
mbox:~/mail/mailboxes:INBOX=/var/mail/%u:DIRNAME=mBoX-MeSsAgEs:INDEX=~/mail/index:CONTROL=~/mail/control<br>
mail_privileged_group = mail<br>
managesieve_notify_capability = mailto<br>
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date index ihave duplicate mime foreverypart
extracttext<br>
namespace inbox {<br>
inbox = yes<br>
location =<br>
mailbox Drafts {<br>
special_use = \Drafts<br>
}<br>
mailbox Junk {<br>
special_use = \Junk<br>
}<br>
mailbox Sent {<br>
special_use = \Sent<br>
}<br>
mailbox "Sent Messages" {<br>
special_use = \Sent<br>
}<br>
mailbox Trash {<br>
special_use = \Trash<br>
}<br>
prefix =<br>
}<br>
passdb {<br>
driver = pam<br>
}<br>
plugin {<br>
sieve = ~/.dovecot.sieve<br>
sieve_default = /var/lib/dovecot/sieve/default.sieve<br>
sieve_dir = ~/sieve<br>
}<br>
postmaster_address = postmaster@"domain"<br>
protocols = imap pop3 lmtp<br>
service doveadm {<br>
inet_listener {<br>
port = 12345<br>
}<br>
}<br>
service managesieve-login {<br>
inet_listener sieve {<br>
port = 4190<br>
}<br>
}<br>
ssl_cert = </etc/letsencrypt/live/"domain"/fullchain.pem<br>
ssl_dh = # hidden, use -P to show it<br>
ssl_key = # hidden, use -P to show it<br>
userdb {<br>
driver = passwd<br>
}<br>
protocol lmtp {<br>
mail_plugins = " sieve"<br>
}<br>
protocol lda {<br>
mail_plugins = " sieve"<br>
}<br>
</p>
</body>
</html>