[Dovecot] Purging Deleted Messages
I noticed today I checked a users mailbox with the mutt command:
mutt -f /home/bob/email/
There I saw he had 100 messages that had been deleted but not yet purged from his inbox so they're still using up disk storage on my email server. My question is does Dovecot have a process to automatically delete these messages after a certain period of time? I would like to think that they don't just sit in a users mailbox for years waiting to be purged, right? Does anyone know exactly how this works?
I checked my own mailbox using mutt and I see 11 messages that are deleted from my Thunderbird client but are still on the server (marked for deletion).
How long do these messages stay there?
-- Man your battle stations...
on 6-2-2008 10:36 AM Carlos Williams spake the following:
I noticed today I checked a users mailbox with the mutt command:
mutt -f /home/bob/email/
There I saw he had 100 messages that had been deleted but not yet purged from his inbox so they're still using up disk storage on my email server. My question is does Dovecot have a process to automatically delete these messages after a certain period of time? I would like to think that they don't just sit in a users mailbox for years waiting to be purged, right? Does anyone know exactly how this works?
I checked my own mailbox using mutt and I see 11 messages that are deleted from my Thunderbird client but are still on the server (marked for deletion).
How long do these messages stay there?
They stay until they are purged. There are plugins that will help if you are using maildir, but I don't know of anything for mbox if you are using that.
-- MailScanner is like deodorant... You hope everybody uses it, and you notice quickly if they don't!!!!
On Mon, 2008-06-02 at 13:36 -0400, Carlos Williams wrote:
I noticed today I checked a users mailbox with the mutt command:
mutt -f /home/bob/email/
There I saw he had 100 messages that had been deleted but not yet purged from his inbox so they're still using up disk storage on my email server. My question is does Dovecot have a process to automatically delete these messages after a certain period of time? I would like to think that they don't just sit in a users mailbox for years waiting to be purged, right? Does anyone know exactly how this works?
Dovecot doesn't keep track of when flag changes have been done, so there's no simple way to say "expunge messages which have been marked as \Deleted after 7 days". With maildir you could check the file's ctime, but with mbox there's just no way.
A nightly job that expunges all deleted messages would work though. You could probably create a script to do that somewhat easily. I don't know of any existing scripts/plugins that do this.
On Jun 2 2008, Timo Sirainen wrote:
Dovecot doesn't keep track of when flag changes have been done, so there's no simple way to say "expunge messages which have been marked as \Deleted after 7 days". With maildir you could check the file's ctime, but with mbox there's just no way.
We were toying with the idea of modding Dovecot to write an X-DeletedFlag-Changed-At header when deleting messages for exactly this reason. What's your thought on this idea, Timo?
-Brian Hayden University of Minnesota OIT
On Mon, 2008-06-02 at 13:48 -0500, bhayden@umn.edu wrote:
On Jun 2 2008, Timo Sirainen wrote:
Dovecot doesn't keep track of when flag changes have been done, so there's no simple way to say "expunge messages which have been marked as \Deleted after 7 days". With maildir you could check the file's ctime, but with mbox there's just no way.
We were toying with the idea of modding Dovecot to write an X-DeletedFlag-Changed-At header when deleting messages for exactly this reason. What's your thought on this idea, Timo?
Be sure to add it to mbox_hide_headers[] and mbox_save_drop_headers[] arrays in mbox-storage.c and hope that it doesn't exist in any of your existing mails. :) Other than that there shouldn't be problems.
participants (4)
-
bhayden@umn.edu
-
Carlos Williams
-
Scott Silva
-
Timo Sirainen