I'm developping a gromox maintenance script since 2024 in order to resolve various grommunio mailbox issues.
The script allows to:
- check / repair mailbox structure (via gromox-mbck)
- check / repair mailbox exchange database (via sqlite3)
- check / regenerate midb databases (via gromox-mkmidb, thanks to @WalterH for his documentation about midb)
- cleanup mailboxes
So far, I've been running it from time to time to service a couple of small servers which I have since 2023, without any (known) data loss.
The mailbox cleaning works like gromox-cleaner, but the later stops running through all mailboxes on any single mailbox issue.
The repair operations take the necessary steps to stop/restart gromox services before doing actual repairs in order to guarantee coherent data.
The midb regeneration only prepares an empty midb database, so next time user connects via pop3/imap, the sync process will happen. This is a design choice to avoid unnecessary disk space loss. Actual data regeneration can be triggered as suggested by @WalterH here.
Regenerating empty midb databases is especially useful after a successful migration via imapsync, where new users would only use exchange MAPI/EWS/ActiveSync services, but disk space would still be used by midb.
I'd be glad to get some reviews / feedback, script is available here