[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Dovecot sieve plugin global rules



On 07/01/2013 02:28 PM, staticsafe wrote:
On Sun, Jun 30, 2013 at 11:36:29PM +0300, "M.Atıf CEYLAN" wrote:
  Hi all,
I use Dovecot 2.1.7 on debian squeeze with Sieve plugin. Sieve rules
are working nicely if I use the rules in user directories. But if I
want to use global rule it's not working. My configuration is below,

/etc/dovecot/conf.d/90-sieve.conf :
  plugin {
   sieve = ~/.dovecot.sieve
   sieve_dir = ~/sieve
   sieve_global_dir = /etc/dovecot/sieve/
  }

/etc/dovecot/sieve/dovecot.sieve :

require ["fileinto"];
# rule:[test]
if header :contains "From" "abc.com"
{
         fileinto "INBOX.Junk";
}

This rule is working in the user directory.

Regards,

--
M.Atıf CEYLAN
Yurdum Yazılım

Your configuration is wrong.
sieve_global_dir =

     Directory for :global include scripts for the include extension. The
     Sieve interpreter only recognizes files that end with a .sieve
     extension, so the include extension expects a file called name.sieve
     to exist in the sieve_global_dir directory for the following
     example:

You want:
sieve_before =

     Path to a script file or a directory containing script files that
     need to be executed before the user's script. If the path points to
     a directory, all the Sieve scripts contained therein (with the
     proper .sieve extension) are executed. The order of execution is
     determined by the file names, using a normal 8bit per-character
     comparison.

Source - http://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration
Thanks for the answer.
I tried some different scenarios. But I couldn't run the script. I have commented "sieve_global_dir" parameter.

My new configuration is below :

plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
  sieve_before = /etc/dovecot/sieve/spam.sieve

/etc/dovecot/sieve/spam.sieve (I have compiled manually by sievec) :

   require "fileinto";
   if header :contains "X-Spam-Flag" ["YES"] {
     fileinto "Junk";
     stop;
   }

--
M.Atıf CEYLAN
Yurdum Yazılım


Reply to: