I use a spam scanner which tags mail, Sieve to filter it in folders and
IMAP to access the folders, but I miss the function "keep mail up to n
days in this folder", as offered by some mail providers, badly.
For that reason, I would like opinions about a Sieve extension, which
allows the mail system to expire mails older than a set amount of time.
I say "allow", as the time of removal should not be specified. Some
systems may do so in daily cleanup jobs, others when delivering the mail.
It is important that this function is not performed by the client,
because I would like to come back from a longer vacation and have the
last 7 days of a mailing list archived, not my mailbox flooded with it.
I can think of different ways right now:
Add an option to fileinto and keep, like:
fileinto :expire 7 "inbox.mailinglist";
The advantage is probably easy implementation for cleanup on delivery,
but the disadvantage is having to specify it multiple times, if a script
files mail into that folder at different places, and more complicated
implementation of daily clenaup jobs. This approach is the opposite:
expire 7 "inbox.mailinglist";
[actual filter code inclduing fileinto ... ]
Using expire to specify expiration times once at the beginning of the
script is more modular. Periodic jobs could extract that information
easily and it separates folder attributes and filter logic.
In case more attributes of folders are required, perhaps a generic
statement would be useful:
folder :expire 7 "inbox.mailinglist";
Do we need a better granularity than days? Does anybody have a better
idea how to add this feature to Sieve?