On 1.7.2005, at 11:24, Steffen Kaiser wrote:
I recently stumple over some discussion about Sieve and what's the advantage to integrate it into the server rather than the LDA.
Most of the filtering capabilites local users want to have performed are related to the INBOX or more preciesly the way to filter the message coming in.
However, there are few tasks left:
- Auto-archive old mail.
- Drop old mail.
- "Seen" mails are moved from INBOX to somewhere else.
Hmm. I'm not really sure how these should be done. Sieve scripting doesn't seem like a correct place for this. It doesn't support expunging or moving mails so without some kind of extension none of these could even be done.
Is there some Dovecot tool that one can use to manipulate the mail storage? UW-IMAP ships such thing (mailutil), but it does not support Maildir and it would be nice, when the Dovecot extensions are created well.
I've been thinking about some scripting-friendly protocol, kind of a replacement for imap itself. I guess the "protocol" could be used as command line parameters directly as well. Anyway its main point is to separate search condition and action for it. So your tasks could be done something like:
- move all mails received before June 01 to inbox-05:
dovecot-mailutil -u username -m inbox -s "before 2005-06-01" -a "copy $ inbox-05" -a "expunge $"
- just delete instead of moving anywhere:
dovecot-mailutil -u username -m inbox -s "before 2005-06-01" -a "expunge $"
- move seen mails:
dovecot-mailutil -u username -m inbox -s "seen" -a "copy $ inbox-seen" -a "expunge $"
-s would tell the search condition (like IMAP's SEARCH) and -a tell the action what to do with the mails that were found.
Now it'd just have to be implemented.. :)