@crpb I appreciate the response to not "leave me totaly hanging here" 😉
I do run a couple of small servers, of which some date back to 2023. I didn't had problems often, until I ran into a bigger VM problem involving qemu-kvm cache handling which only bit me on OpenSUSE (https://github.com/openzfs/zfs/issues/17669#issuecomment-4659864075)
Since I had a couple of segaults on my Grommunio servers, I expected things to be messed up, hence I worked on this script in order to make sure I don't run into bigger problems later.
Script found errors while running repair_mbox and repair_sql.
The cleanup part could indeed be removed in favor of Walter's script which seems quite more complete.
The neat part is finding which MIDB files are stale and remove them with --purge-midb-old.
Since I did some imapsync migrations on start, I actually kept midb files for years without needing them, since I only do MAPI/Activesync.
Anyway, hope the script might help people.
I opened a PR at gromox, but didn't get any answers, and I'm not really sure if that tool should go there anyway.
Cheers.