On 11/05/2020 16:45 Gionatan Danti g.danti@assyoma.it wrote:
Dear list, I recently had to delete some messages from an sdbox mailbox, for which I used the canonical "doveadm expunge" command without issues.
However I got curious and, on a test mailbox, I deleted an unimportant message directly from the filesystem (rm u.650). After removing the file, the webmail continued to show it in the mail list - but no text was retrieved when I selected it. I supposed this was due to dovecot.index.cache and, indeed, deleting the cache got rid of the message in the webmail list.
While I understand that it is not recommended (deleting and regenerating the index cache is an expensive operation), I wonder if removing a file from the filesystem, and regenerating the index cache file, is a safe operation when using an sdbox mailstore. Specifically, I would like to know if, after a manual filesystem deletion, the main index file (dovecot.index) is automatically updated by dovecot (reflecting the deletion) or if lingering references are kept in it.
Thanks.
-- Danti Gionatan
If you manually change the mailbox contents like that, you need to run doveadm force-resync to fix the situation.
Aki