[Dovecot] [Dovecot-news] Released Sieve v0.1.10 for Dovecot v1.2.2
Stephan Bosch
stephan at rename-it.nl
Sat Aug 15 23:41:51 EEST 2009
Leo Baltus schreef:
> Op 04/08/2009 om 11:15:39 +0200, schreef Stephan Bosch:
>> What exactly would you like to do with this? I am asking to make sure
>> that there are no other features needed, like for instance the index
>> extension mentioned in RFC5260. That would definitely need changes in
>> the Sieve engine.
>>
>
> I haven't looked at indexes, just basic archiving would be nice:
>
> from the rfc (I hope this is valid syntax):
>
> if currentdate :matches "month" "*" { set "month" "${1}"; }
> if currentdate :matches "year" "*" { set "year" "${1}"; }
>
> # archive all
> fileinto :copy "mail-${year}${month}";
>
> # my favorite list
> if header :contains ["To", "Cc"]
> [ "dovecot at dovecot.org", "dovecot-news at dovecot.org" ]
> {
> fileinto "dovecot-${year}${month}";
> stop;
> }
>
Ok, I've now fully implemented the date extension. It will be included
in the next release. Apart from the test suite, I've tested it on my
test server with the following script:
##
require "date";
require "variables";
require "fileinto";
require "mailbox";
require "copy";
if currentdate :matches "month" "*" { set "month" "${1}"; }
if currentdate :matches "year" "*" { set "year" "${1}"; }
# archive all
fileinto :copy :create "mail-${year}${month}";
# my favorite list
if header :contains ["To", "Cc"]
[ "dovecot at dovecot.org", "dovecot-news at dovecot.org" ]
{
fileinto :create "dovecot-${year}${month}";
stop;
}
##
As you can see, it is based on your example. It works as expected. This
application of the date extension is actually pretty useful. If deliver
is run with -n (like I do), the :create argument for fileinto, as
provided by the mailbox extension, is necessary.
Regards,
--
Stephan Bosch
stephan at rename-it.nl
More information about the dovecot
mailing list