So I had a couple requests recently to restore deleted emails, but they didn’t know when or what was deleted.
I created the following bash script and run it from inside the mailcow-borgmatic container to restore any emails missing from particular domain or user.
https://gist.github.com/rallisf1/db2869c921d765c3ea227bfad9834982
You can then copy over what you need and run docker compose exec dovecot-mailcow doveadm quota recalc -u "user@domain"
to rebuild the dovecot cache.