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

Re: dynamic naming & creation of mailboxes

2002-12-16 11:22:47



Cyrus Daboo wrote:

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.


Or you could have the messages delivered to a dummy user's INBOX and
then rename the INBOX.  Renaming an INBOX in IMAP has special semantics
in which the messages are copied to the destination mailbox without
deleting the INBOX.  This is the same as Cyrus' idea, but makes the
server do the bulk of the work for you.

Ken
-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp

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