Deleting messages "marked for deletion" older than X days
Bron Gondwana
brong at fastmail.fm
Mon Aug 18 20:05:31 EDT 2008
On Mon, Aug 18, 2008 at 05:09:53PM -0500, Kenneth Marshall wrote:
> In the manual page, the definition of the '-X' option seems to
> do what you want:
>
> -X expunge-days
> Expunge previously deleted messages older than expunge-days
> (when using the "delayed" expunge mode). The default is
> 0 (zero) days, which will expunge all previously deleted messages.
Messages go through the following life cycle in "traditional IMAP",
example:
Created (\Recent) - LMTP DELIVER (UID = 9)
No flags () - A001 SELECT INBOX (clears the \Recent)
Viewed (\Seen) - A002 UID FETCH 9 RFC822
Deleted (\Deleted \Seen) - A003 UID STORE 9 +FLAGS (\Deleted)
Purged (no message) - A004 EXPUNGE
Now, what the -X option actually does is turns this into:
Created (\Recent) - LMTP DELIVER (UID = 9)
No flags () - A001 SELECT INBOX (clears the \Recent)
Viewed (\Seen) - A002 UID FETCH 9 RFC822
Deleted (\Deleted \Seen) - A003 UID STORE 9 +FLAGS (\Deleted)
Purged (no index record)- A004 EXPUNGE
but the file is still on disk, just the index record has been moved
from the file cyrus.index to a new file cyrus.expunge. A week later:
Cleaned up (no file) - cyr_expire -X 7
The cyrus.expunge record and the actual spool file itself get deleted at
this point. Until then you can un-delete the record using the
"unexpunge" command in cyrus 2.3.X.
---
I think what the original requestor was actually looking for is a tool
that can run the "EXPUNGE" phase on a regular basis. As far as I'm
aware there's nothing that ships with Cyrus that can do it. If I was
writing something for the job I would make an admin IMAP connection to
Cyrus and just cycle through the folders calling 'EXPUNGE' on them.
Cheap and nasty, but it would do the trick. You can do this in any
language with a TCP library, though something with an IMAP interface
library would be nicer. I'd use Perl and Mail::IMAPTalk, but that's
just because that's what I already use!
Bron.
More information about the Info-cyrus
mailing list