ietf-mta-filters
[Top] [All Lists]

Re: dynamic naming & creation of mailboxes

2002-12-16 11:07:47

Hi Andrew,

--On Monday, December 16, 2002 12:36 PM -0500 Andrew Hammond <andrew(_dot_)hammond(_at_)surveysite(_dot_)com> wrote:

| I'm looking to create a new sub-folder / day setup for an mailbox that
| gets a couple of hundred messages every day.  Then automatically deliver
| messages to today's folder.
|
| I've checked the mailing list archives, googled, and read the Sieve RFC.
| It looks to me like there's now way to do this easily with Sieve.
|
| My current solution is a perl script run by a cron job that makes the
| sub-folder and writes a new .sieve.
|
| Is there a better way to do this?

Why not leave the sieve script set to deliver into a mailbox called 'sent-active' all the time, then simply have the perl script rename that to yesterday's date and recreate the active mailbox again. You then do not need to edit the sieve script each day. The only problem with this is a possible race condition in which a message delivery to the mailbox is attempted between the rename and re-create actions. An alternative might be to create yesterday's mailbox and then copy all messages from the active one into that and expunge those. That way the active mailbox is around all the time avoiding the race. However, that requires a lot more work on the IMAP side as you have to select (open) the mailbox to do the copying.

--
Cyrus Daboo

<Prev in Thread] Current Thread [Next in Thread>