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@dovecot.org", "dovecot-news@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@dovecot.org", "dovecot-news@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@rename-it.nl