I have my icedove client set to auto-compact certain folders each evening.
I receive over 1000 emails a day, most of which are filtered into sub-folders,
checked, then deleted some time later. So without auto-compaction, things
fairly quickly grind to a halt. The trouble with compacting while new messages
are arriving and being filtered (and filtering is done as copy-then-delete) is
that it’s prone to failure. In itself that’s not a problem cos there’s a fair
chance it’ll succeed the following evening. The problem is that in that event,
icedove leaves behind a file nstmp-??. On my machine I just found that
6 GB was being consumed by these useless files. So now I have a scheduled
cleanup job that runs between compaction and the evening backup:

#MM HH dd mm dow command

# Delete redundant files due to failed compaction
30 18  *  * 1-5 find $HOME/.icedove -type f -name 'nstmp*' -mmin +30
| xargs -r rm -f

(That crontab job is all one line.)