Manual (file system level) message deletion

Thierry de Montaudry thierry at odry.net
Thu Dec 4 00:23:49 UTC 2014


> On 04 Dec 2014, at 01:03, absolutely_free at libero.it wrote:
> 
> Hi,I use Dovecot + Postfix on CentOS server. I use maildir.
> What happen if I manually delete some messages (eg. the ones older than 6 months) for every use?I think that dovecot's indexes will be wrong... is this a potential performance issue?If so, how can I "rebuild" index file for every user?
> Thank you

Hi,
As far as I experienced, dovecot can nicely recover from manually deleting some mails in a maildir tree, but still, I wouldn’t recommend it, as it take more time to resync a folder with a lot of mails.
In your case, I would rather recommend to use the ‘dovecot expunge’ command as it updates the indexes while removing files. I do use it to remove older files in Trash and Spam folder, and it can be used per user or for all users. Here’s and example of the command line to remove any mail older than 6 weeks in the Spam folder:

doveadm expunge -u “email"  mailbox Spam savedbefore 6w

Replace '-u “email”’ with ‘-A’ to run it on all users.

Regards,
	Thierry


More information about the dovecot mailing list