sievec

Doug Barton dougb at dougbarton.us
Fri Mar 17 09:07:58 EET 2017


On 03/16/2017 11:50 PM, Robert Moskowitz wrote:
> 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/Cent6VirtMailServer
>
>
> 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



More information about the dovecot mailing list