Skip to content

Mailbox check / repair script - #246

Closed
deajan wants to merge 22 commits into
grommunio:primefrom
netinvent:repair-script
Closed

deajan wants to merge 22 commits into
grommunio:primefrom
netinvent:repair-script

Conversation

@deajan

@deajan deajan commented May 20, 2026

Copy link
Copy Markdown

Using this script since more than a year without any major trouble nor data loss.

Main functions:

  • Iter over a single or all maildirs
  • Check mailbox using gromox-mbck
  • Repair mailbox if error detected
  • Check exchange.sqlite3 via sqlite3
  • Recover exchange.sqlite3 via sqlite3 and keep a backup copy of original file
  • Check midb.sqlite3 via gromox-mkmidb --integrity
  • Recreate midb.sqlite3 on error
  • Takes care to stop / restart gromox services in case an sqlite3 file needs to be repaired

Perhaps it could be useful to add it to gromox.
Feel free to change headers / licence / whatever if needed.

Respects sqlite3 checks as per #147

@deajan

deajan commented Sep 8, 2026

Copy link
Copy Markdown
Author

Have been running this script on multiple grommunio systems to cope with incoherent data, comming from gromox itself or various power outages. Script works quite well, never lost any data, respects repair actions where grommunio needs to be shutdown.

All in all I think it would be nice for admins to have a single repair script instead of having to run multiple small tools, which is nice for specialized admins.
Would you consider merging it, or is there a better place for it somewhere out there ?

@jengelh

jengelh commented Sep 16, 2026

Copy link
Copy Markdown
Member

sh is awkward. The more one wants to do, the more awkward the syntax gets.

Overall, that script looks like it wants to be gromox-mbop. At that point, mbop should just be made to do it.

Choosing not to go with shell scripts.

@jengelh jengelh closed this Sep 16, 2026
@deajan

deajan commented Sep 17, 2026

Copy link
Copy Markdown
Author

Fair enough, thanks for your viewpoint.

The most crucial missing part today would be gromox-mbck also being able to repair sqlite3 files (gromox-mbck repairs a mailbox, but sqlite3 still finds errors in said file).

The other part would be to allow iter over multiple mailboxes, hence the shell script.

I'll keep my script around until integrated tools handle those scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants