On 03/21/2017 09:06 AM, chaouche yacine wrote:> Hi Ger, > > sieve_before should be a path to sieve script file, not to a directory. > in your configuration, you set sieve_before to /var/lib/dovecot/sieve/before which is a directory.I don't get that reading: https://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration Either file or directory. If a file, it searches for the svbin of that name, otherwise compiles your script. If directory, executes all in the directory.> what you need to do is figure out which sieve script you'd like to execute and its path rather. > If you think that default2.sieve is the right script then > > set sieve_before to /var/lib/dovecot/sieve/before/default2.sieve > > -- Yassine. > > > > > On Tuesday, March 21, 2017 12:56 PM, Ger Hooton Scoil Chro? ?osa Blarney <ghooton at scins.ie> wrote: > > > > > >> Hi All, >> [...] >> plugin { >> [...] >> >> >> sieve_before = /var/lib/dovecot/sieve/before >> ................................. >> >> In /var/lib/dovecot/sieve/before I have : >> >> drwxrwxrwx 3 mail mail 4096 Mar 20 23:47 .. >> >> -rw-rw-rw- 1 root root 195 Mar 21 09:57 default2.svbin >> >> -rwxrwxrwx 1 mail mail 157 Mar 21 11:12 default2.sieve >> >> default2.sieve is as follows: >> >> require ["fileinto"]; >> >> if allof (header :matches "subject" "*JUNK*") { >> >> fileinto "INBOX.Junk"; >> >> }
>On Tuesday, March 21, 2017 3:03 PM, Robert Moskowitz <rgm at htt-consult.com> wrote: >On 03/21/2017 09:06 AM, chaouche yacine wrote: >> Hi Ger, >> >> sieve_before should be a path to sieve script file, not to a directory. >> in your configuration, you set sieve_before to /var/lib/dovecot/sieve/before which is a directory. >I don't get that reading: >https://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration > >Either file or directory. If a file, it searches for the svbin of that >name, otherwise compiles your script. If directory, executes all in the > >directory.Well spotted Robert, I didn't know that. It also says here https://wiki2.dovecot.org/Pigeonhole/Sieve/Usage#scriptcompile that one must be aware of permission issues with auto-compiled scripts : if the system user used by sieve to compile the script doesn't have write access to the directory where the script lives then it can't write the compiled version in that location. This is why one should consider pre-compiling scripts himself to make sure the compiled version is written to disk As mentionned in the link you gave : "IMPORTANT: Be sure to manually pre-compile the scripts specified by sieve_before and sieve_after using the sievec tool, as explained here." -- Yassine
On 03/21/2017 11:32 AM, chaouche yacine wrote:>> On Tuesday, March 21, 2017 3:03 PM, Robert Moskowitz <rgm at htt-consult.com> wrote: >> On 03/21/2017 09:06 AM, chaouche yacine wrote: >>> Hi Ger, >>> >>> sieve_before should be a path to sieve script file, not to a directory. >>> in your configuration, you set sieve_before to /var/lib/dovecot/sieve/before which is a directory. >> I don't get that reading: >> https://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration >> >> Either file or directory. If a file, it searches for the svbin of that >> name, otherwise compiles your script. If directory, executes all in the >> >> directory. > Well spotted Robert, I didn't know that. It also says here https://wiki2.dovecot.org/Pigeonhole/Sieve/Usage#scriptcompile that one must be aware of permission issues with auto-compiled scripts : if the system user used by sieve to compile the script doesn't have write access to the directory where the script lives then it can't write the compiled version in that location. This is why one should consider pre-compiling scripts himself to make sure the compiled version is written to disk > > As mentionned in the link you gave : > > "IMPORTANT: Be sure to manually pre-compile the scripts specified by sieve_before and sieve_after using the sievec tool, as explained here."The howto I am making has: mkdir /home/sieve cat <<EOF>/home/sieve/globalfilter.sieve || exit 1 require "fileinto"; if anyof ( header :contains "X-Spam-Flag" "YES", header :contains "subject" "***SPAM***" ) { fileinto "Spam"; } EOF sievec /home/sieve/globalfilter.sieve chown -R vmail:mail /home/sieve With: sed -i -e "s/#sieve_before =/sieve_before = \/home\/sieve\/globalfilter.sieve/w /dev/stdout" /etc/dovecot/conf.d/90-sieve.conf