[Dovecot] Automating message archiving

Timo Sirainen tss at iki.fi
Mon Jul 4 01:03:00 EEST 2005


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:
>
> 1) Auto-archive old mail.
> 2) Drop old mail.
> 3) "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:

1) 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 $"

2) just delete instead of moving anywhere:

dovecot-mailutil -u username -m inbox -s "before 2005-06-01" -a 
"expunge $"

3) 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.. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://dovecot.org/pipermail/dovecot/attachments/20050704/f1caf602/attachment-0001.bin>


More information about the dovecot mailing list