I'd like to archive messages by year, perhaps month. I can create a new rule each month, but I'd rather do it automatically.

Move all messages to a folder called ARCHIVE/%y/%m or something like it.

I'd prefer to use the webinterface to sieve provided by roundcube, but I can access the server if needed.


I don't expect you can do this through Roundcube's web interface, but here's a solution for manually writing Sieve scripts. Moving into date-based folders is possible by combining several sieve extensions: fileinto, date and mailbox.

require ["fileinto", "date", "mailbox"]

Put the current date into variables:

if currentdate :matches "year" "*" { set "year" "${1}"; }
if currentdate :matches "month" "*" { set "month" "${1}"; }

And to file the message, run:

fileinto :create "Archive.${year}.${month}"

Depending on your IMAP path settings, you might require / instead of .. :create enables creation of folders if they do not exist yet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.