Auto-deletion of messages in Junk-folder after a certain time

Bron Gondwana brong at fastmail.fm
Tue Jul 15 05:50:10 EDT 2008


On Mon, Jul 14, 2008 at 01:54:01PM +0200, Marten Lehmann wrote:
> Hello,
> 
> we have a virtual domain configuration and I want to remove all messages 
> within the folder
> 
> user/<any-userpart>@<any-domain>/Junk/*

Being the filty perl programmer that I am, I would just make an admin
IMAP connection to the server, LIST all mailboxes, regex match the ones
I wanted, select them and process them.

> I don't want to mark old messages as deleted and expunge them, because 
> then maybe I'm expunging messages, that haven't been flagged as deleted 
> by me but the owner of the mailbox and aren't ment to be expunged at 
> this moment.

We do this by setting our own special flag (in addition to the regular
\Deleted flag) and then SEARCH for those messages only and UIDEXPUNGE
them.

But if you're deleting ALL messages, then it doesn't really matter does
it?  Unless you're doing some sort of age based thing, in which case
like I said - UIDEXPUNGE.  The flag just lets us persist the action
across dropped connections.

Bron.


More information about the Info-cyrus mailing list