On 2012-03-28 8:50 AM, Xavier Beaudouin wrote: > Hi there, > > I am trying to move from lmtpd (lmtpd.sf.net) to dovecot sieve. > > One thing used by some of powerusers are archiving mail automatically > with autocreated folders based on year + month. > > Is there any good way to make that with sieve... > > One example > > require "fileinto"; > > if address :is ["From", "To"] "dovecot@dovecot.org" { > fileinto "INBOX.mls.%Y.%m.dovecot"; > } > > This will fill any mails into INBOX.mls.2012.03.dovecot uppon > receiving... > > I don't know if some sieve guru can tell me how to do that... ? > > Kind regards, > > Xavier
I don't remember where I found out how to do this, but the following is what I use: require ["fileinto", "imap4flags", "date", "variables"]; if currentdate :matches "month" "*" { set "month" "${1}"; } if currentdate :matches "year" "*" { set "year" "${1}"; } fileinto :flags "\\seen" "${year}-${month}"; Deliver/lmtp is set to allow creation of folders. -Greg
signature.asc
Description: OpenPGP digital signature