Dovecot doveadm バックアップが時々エラー 65 で失敗する - 対処方法

Dovecot doveadm バックアップが時々エラー 65 で失敗する - 対処方法

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 に関する最初の 2 行に関係している可能性が高いと考えていますが、それがどのように発生したのかはわかりません (メールボックスの同期のみを実行しました。中断した可能性はありますが、それ以外は何も実行していません)。これも少し心配です。

私は MAILDIR 形式を使用していますが、問題の一部は MAILDIR に関連していて INBOX を削除できないのではないかと考えていますが、なぜ受信トレイを削除しようとしているのか理解できません。また、" というフォルダが見つからないため、INBOX が何を意味するのかさえわかりません。/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 が空ですが、サーバー上のバージョンにはデータが存在します。

メールサーバーからバックアップに「現在の」メールボックスをコピーし、「doveadm mailbox status -u」を実行しようとしたとき[メールアドレス]「すべての INBOX」ではメッセージ数は 524 に戻りましたが、ボックスをバックアップしようとするとすぐにエラーが再表示され、バックアップ サーバーの INBOX にはメッセージが 0 件ありました。

コマンド「doveadm force-resync -u」を試してみた[メールアドレス]メール サーバー上の「INBOX」とバックアップ (scp 経由でバックアップ上の Maildir/cur を再作成した後) は役に立ちませんでした。

関連情報