RoundCube で本文を含めて検索を行ったときにエラーが起こったので調べた。
Roundcube のログ
[19-Feb-2021 18:36:35 Asia/Tokyo] Unexpected condition from IMAP server, closed or corrupt connection to IMAP. Possible mailbox corruption.
maillog
Feb 19 18:42:12 server dovecot: imap([email protected])<22287><JKij45hIl__Khkjd45>: Error: Raw backtrace: /usr/lib64/dovecot/libdovecot.so.0(backtrace_append+0x42) [0x7f0d6e8e5b52] ->
/usr/lib64/dovecot/ libdovecot.so.0(backtrace_get+0x1e) [0x7f0d6e8e5c5e] -> /usr/lib64/dovecot/libdovecot.so.0(+0xe617e) [0x7f0d6e8f017e] ->
/usr/lib64/dovecot/libdovecot.so.0(+0xe6221) [0x7f0d6e8f0221] ->
/usr/lib64/dovecot/libdovecot.so.0(i_fatal+0) [0x7f0d6e84bbb8] -> /usr/lib64/dovecot/libdovecot.so.0(+0xc6874) [0x7f0d6e8d0874] ->
/usr/lib64/dovecot/libdovecot.so.0(message_parser_parse_next_block+0x11c) [0x7f0d6e8d206c] ->
/usr/lib64/dovecot/libdovecot.so.0(message_search_msg+0xa8) [0x7f0d6e8d49a8] ->
/usr/lib64/dovecot/libdovecot-storage.so.0(+0xc7c8c) [0x7f0d6ec71c8c] ->
/usr/lib64/dovecot/libdovecot-storage.so.0(mail_search_args_foreach+0x45) [0x7f0d6ebedff5] ->
/usr/lib64/dovecot/libdovecot-storage.so.0(+0xc8d17) [0x7f0d6ec72d17] ->
/usr/lib64/dovecot/libdovecot-storage.so.0(+0xca2c3) [0x7f0d6ec742c3] ->
/usr/lib64/dovecot/libdovecot-storage.so.0(index_storage_search_next_nonblock+0x102) [0x7f0d6ec74592] ->
/usr/lib64/dovecot/libdovecot-storage.so.0(mailbox_search_next_nonblock+0x22) [0x7f0d6ebf7a12] ->
/usr/lib64/dovecot/libdovecot-storage.so.0(mailbox_search_next+0x3d) [0x7f0d6ebf7a7d] ->
/usr/lib64/dovecot/libdovecot-storage.so.0(mail_thread_init+0xae8) [0x7f0d6ec80138] ->
dovecot/imap(cmd_thread+0x16c) [0x7f0d6f13e4fc] -> dovecot/imap(command_exec+0x64) [0x7f0d6f143ce4] ->
dovecot/imap(+0x1ce4f) [0x7f0d6f141e4f] -> dovecot/imap(+0x1ced9) [0x7f0d6f141ed9] ->
dovecot/imap(client_handle_input+0x205) [0x7f0d6f142355] -> dovecot/imap(client_input+0x75) [0x7f0d6f142925] ->
/usr/lib64/dovecot/libdovecot.so.0(io_loop_call_io+0x65) [0x7f0d6e908855] ->
/usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0x12b) [0x7f0d6e90a1cb] ->
/usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run+0x59) [0x7f0d6e908959] ->
/usr/lib64/dovecot/libdovecot.so.0(io_loop_run+0x38) [0x7f0d6e908b98] -> /usr/lib64/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7f0d6e87b313] ->
dovecot/imap(main+0x332) [0x7f0d6f133f32] -> /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f0d6e45e555] -> dovecot/imap(+0xf135) [0x7f0d6f134135]
dovecot の INDEX が破損すると起こるらしい
dovecot.index を mv
mv dovecot.index dovecot.index.old
これで解決した。
maildir なので index 削除でメールが消えることはない
対象のアカウントが大量にある場合
cPanel だと便利コマンドが準備されていた。
/scripts/remove_dovecot_index_files --user hoge --verbose
おしまい