11

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 = [email protected]
  mail_plugins = sieve
}

2 Answers 2

15

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

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

It's easy :(

sudo su user-which-owns-mails
sieve-filter -e -W -u [email protected] /path/to/sieve/script.sieve INBOX

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .