7

I've configured dovecot with a sieve filtering (also I've configured roundcube, but this does not matter I think).

It's working fine, I've set up some filters. But now I've got a huge unfiltered INBOX folder which I don't want to filter manually.

Is there any way to say: "Hey, sieve! Scan specified folder for specified user and invoke some filters on it!" ?

Sieve as plugin enabled for two protocols: lda and lmtp:

protocol lda {
  mail_plugins = $mail_plugins sieve
}

protocol lmtp {
  postmaster_address = postmaster@example.com
  mail_plugins = sieve
}
12

To execute your filters on your existent mailbox you can manually run sieve-filter from the command line.

To (dry) run the sieve-script example.sieve as user test on the mailbox INBOX use the following command:

sieve-filter -v -C -u test /path/to/sieve/example.sieve 'INBOX'

Once you like the actions sieve would perform you can execute the script with adding -e for execute and -W to give sieve write access.

For more information look at the official man page: http://pigeonhole.dovecot.org/doc/man1/sieve-filter.1.html

  • sadly, it seems like the duplicate-extension does not work in the sieve-filter context. – helt Aug 25 '16 at 14:24
0

It's easy :(

sudo su user-which-owns-mails
sieve-filter -e -W -u targetuset@domain.com /path/to/sieve/script.sieve INBOX

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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