All sieve scripts need to be compiled."default" means absence. So default scripts are used when user scripts don't exist. If users have their sieves scripts then the default won't be executed.
If you want to impose your script on all users then use sieve_before not sieve_default. For example, I use a sieve_before script to impose a backup copy of every e-mail delivered to my mailboxes to the corresponding backup mailboxes accounts. Since I want this script to get executed no matter what I use sieve_before not sieve_default. So I guess your SPAM script should also be a sieve_before.
-- Yassine
On Friday, March 17, 2017 8:08 AM, Doug Barton
Doug,
On 03/16/2017 11:23 PM, Doug Barton wrote:
Your pattern seems a little too complicated. See below.
I acquired this script from:
http://www.campworld.net/thewiki/pmwiki.php/LinuxServersCentOS/Cent6VirtMail...
No telling where he got it from. So I greatly appreciate any and all advice.
Blindly following things you find on the Internet is not a path to success. :)
I am writing my own howto, and I would like to think I am doing a better job of it.
You may consider whether your own depth of understanding is sufficient to improve the situation, or whether you are simply adding more noise. I wish you luck in any case.
Not completely. I 'program' in English writing standards like IEEE 802.1AR, 802.15.9, and RFCs. I have not really programmed since the mid-80s with 'B'.
I leave the converting of our carefully worded standards to executables to others.... :)
We all have our own areas of expertise. Nothing wrong with that.
That said, is this what you are advising:
Not precisely. You want to remove the 'else' in there, as the clause you have will do the opposite of what you intend. Also note that I removed your superfluous square brackets.
require "fileinto"; if header :contains "X-Spam-Flag" "YES" { fileinto "Spam"; } if header :contains "subject" "***SPAM***" { fileinto "Spam"; }
The best way to work with this is to start with simple rules on an individual client. Once you get a rule set that works, then you can move on to compiling it for the system. Always start as simple as possible though, and only add to it if your simple thing does not work. This is a pretty good tutorial on the syntax and options for Sieve. Given your intended purpose you should pay special attention to the 'create' modifier for 'fileinto'. Also, I would accomplish both things in the same rule using 'anyof' which should be slightly more efficient (which could make a big difference to server load depending on how many users you are supporting). https://support.tigertech.net/sieve hope this helps, Doug