我正在尝试在 2 个服务器之间设置 dovecot 电子邮件的备份。执行繁重工作的命令是:
doveadm -D backup -R -u [email protected] ssh MAINSERVER.IP doveadm dsync-server -u [email protected]
对于大多数用户来说,它工作正常,但对于几个用户,我收到错误 65 或错误 75。(脚本说远程命令返回错误 75......“但是当我将其放入脚本中时,返回代码是 65。
失败账户的 dovecot 输出如下:
Debug: Loading modules from directory: /usr/lib/dovecot/modules/doveadm
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)
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)
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)
Debug: Module loaded: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_sieve_plugin.so
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)
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)
doveadm([email protected]): Debug: Effective uid=999, gid=999, home=/data/mail/[email protected]
doveadm([email protected]): Debug: maildir++: root=/data/mail/[email protected]/Maildir, index=, indexpvt=, control=, inbox=/data/mail/[email protected]/Maildir, alt=
doveadm([email protected]): Debug: Namespace : Using permissions from /data/mail/[email protected]/Maildir: mode=0700 gid=default
dsync-local([email protected]): Debug: brain M: Local mailbox tree: INBOX guid=58eedf276bc33864df08000079bc729c uid_validity=1681441643 uid_next=2 subs=no last_change=0 last_subs=0
dsync-local([email protected]): Debug: brain M: Remote mailbox tree: INBOX guid=58eedf276bc33864df08000079bc729c uid_validity=1396487587 uid_next=60912 subs=no last_change=0 last_subs=0
dsync-local([email protected]): Debug: brain M: Remote mailbox tree: Deleted Messages guid=c803c2075f1e625874120000b8a5d860 uid_validity=1396487588 uid_next=36883 subs=yes last_change=0 last_subs=1482825311
dsync-local([email protected]): Debug: brain M: Remote mailbox tree: Sent Messages guid=55567b0e54b57d58770d0000b8a5d860 uid_validity=1396487589 uid_next=345 subs=yes last_change=0 last_subs=1484633428
dsync-local([email protected]): Debug: brain M: Remote mailbox tree: Drafts guid=8e1b6a01ab197e602d700000b8a5d860 uid_validity=1396487591 uid_next=1 subs=yes last_change=0 last_subs=1618876837
dsync-local([email protected]): Debug: brain M: Remote mailbox tree: Notes guid=da8ed0191098355c672d0000b8a5d860 uid_validity=1396487590 uid_next=1 subs=yes last_change=0 last_subs=1547016208
dsync-local([email protected]): Debug: brain M: Mailbox Deleted Messages: local=00000000000000000000000000000000/0/0, remote=c803c2075f1e625874120000b8a5d860/0/1: mailbox not selectable yet
dsync-local([email protected]): Debug: brain M: Mailbox Drafts: local=00000000000000000000000000000000/0/0, remote=8e1b6a01ab197e602d700000b8a5d860/0/1: mailbox not selectable yet
dsync-local([email protected]): Debug: brain M: Mailbox INBOX: local=58eedf276bc33864df08000079bc729c/0/1, remote=58eedf276bc33864df08000079bc729c/0/1: Mailboxes are equal
dsync-local([email protected]): Debug: brain M: Mailbox Notes: local=00000000000000000000000000000000/0/0, remote=da8ed0191098355c672d0000b8a5d860/0/1: mailbox not selectable yet
dsync-local([email protected]): Debug: brain M: Mailbox Sent Messages: local=00000000000000000000000000000000/0/0, remote=55567b0e54b57d58770d0000b8a5d860/0/1: mailbox not selectable yet
dsync-local([email protected]): Debug: brain M: Deleting mailbox 'INBOX' (GUID 58eedf276bc33864df08000079bc729c): UIDVALIDITY changed (1396487587 -> 1681441643)
dsync-local([email protected]): Debug: doveadm-sieve: Iterating Sieve mailbox attributes
dsync-local([email protected]): Debug: sieve: Pigeonhole version 0.4.21 (92477967) initializing
dsync-local([email protected]): Debug: sieve: include: sieve_global is not set; it is currently not possible to include `:global' scripts.
dsync-local([email protected]): Debug: sieve: file storage: Using active Sieve script path: /data/mail/[email protected]/.dovecot.sieve
dsync-local([email protected]): Debug: sieve: file storage: Using script storage path: /data/mail/[email protected]/sieve
dsync-local([email protected]): Debug: sieve: file storage: Using permissions from /data/mail/[email protected]/sieve: mode=0700 gid=-1
dsync-local([email protected]): Debug: sieve: file storage: Relative path to sieve storage in active link: sieve/
dsync-local([email protected]): Debug: sieve: file storage: sync: Synchronization active
dsync-local([email protected]): Error: Mailbox INBOX sync: mailbox_delete failed: INBOX can't be deleted.
dsync-local([email protected]): Error: Remote command returned error 75: ssh 60.234.77.233 doveadm dsync-server -u [email protected] dsync-server
尽管出现“远程命令返回错误 75”,但我知道如果我删除本地服务器上的邮箱并重新发出命令,它将重新同步 - 但这意味着删除本地服务器上的客户端邮箱,而我宁愿不这样做,因为它们会变得非常大,并且站点之间的带宽有点紧张。
我还相信,如果我进行同步而不是备份(我不想这样做,因为我是 doveadm 的新手,我不想将原件置于危险之中),则不会出现错误。
我相信问题可能与有关 INBOX 的初始两行有关 - 但我不明白它是如何发生的(我只对邮箱进行了同步 - 可能中断了它们,但没有其他事情),这也有点令人担忧。
我使用的是 MAILDIR 格式,我怀疑部分问题与 MAILDIR 有关,无法删除收件箱,但我不明白它为什么要删除收件箱,我甚至不知道收件箱是什么意思,因为我找不到名为“/INBOX”或“/.INBOX”或类似名称。“Maildir/cur”和“Maildir/new”都存在(在客户端上为空)。Maildir/new 在服务器上包含电子邮件,但在客户端上为空。
我最初在 Ubuntu 18.04、Dovecot 1:2.2.33.2-1ubuntu4.8 上的服务器上尝试了此操作,然后我仅升级了我从中提取的备份箱以运行带有 Dovecot 2.3.7.2 的 Ubuntu 20.04 - 同样的问题。
这是 Dovecot 中已知的错误吗?除了删除邮箱外,还有什么方法可以解决这个问题吗?
更新
doveconf mail_location 设置为 mail_location = maildir:/data/mail/%u/Maildir(这看起来像我所期望的那样)。我找不到任何带有“namespace”一词的配置信息
当我做
doveadm mailbox status -u [email protected] all INBOX
我在客户端和服务器上得到了不同的结果。在邮件服务器上我得到了
INBOX messages=524 recent=0 uidnext=60920 uidvalidity=1396487587 unseen=2 highestmodseq=59948 vsize=77692641 guid=58eedf276bc33864df08000079bc729c firstsaved=1680336216
在备份中我得到了
INBOX messages=0 recent=0 uidnext=2 uidvalidity=1681441643 unseen=0 highestmodseq=3 vsize=0 guid=58eedf276bc33864df08000079bc729c firstsaved=18446744073709551615
在每个有问题的邮件目录中,“MAILDIR/cur -s 在备份版本上为空,而服务器上的版本中有数据。
当我尝试将“cur”邮箱从邮件服务器复制到备份,然后运行“doveadm mailbox status -u[电子邮件保护]所有收件箱”消息数量返回到 524,但是当我尝试备份该收件箱时,错误再次出现,并且备份服务器上的收件箱中有 0 条消息。
使用命令“doveadm force-resync -u[电子邮件保护]邮件服务器上的“.INBOX”和备份(通过 scp 在备份上重新填充 Maildir/cur 后)没有帮助。