sievec

Robert Moskowitz rgm at htt-consult.com
Fri Mar 17 08:50:59 EET 2017


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.

I am writing my own howto, and I would like to think I am doing a better 
job of it.  I hope to have it finished in a couple weeks.  I would say I 
am the proverbial 80% complete.

>
> On 03/16/2017 02:20 PM, Robert Moskowitz wrote:
>
>>   if exists "X-Spam-Flag" {
>
> This isn't needed. If the flag doesn't exist, the 'if header ...' line 
> won't match. You're doing two tests for every message where one is all 
> that's needed.
>
>>     if header :contains "X-Spam-Flag" "NO" {
>
> You can just do "YES" here, and go straight to the command (fileinto). 
> Yes/No is a boolean flag, it will either be one or the other.
>
>>     fileinto "Spam";
>>     stop;
>
> It's not clear that you need the 'stop' here.
>
> hope this helps,

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.... :)

That said, is this what you are advising:

require "fileinto";
   if header :contains "X-Spam-Flag" "YES" {
     } else {
     fileinto "Spam";
   }
   if header :contains "subject" ["***SPAM***"] {
     fileinto "Spam";
   }


Thanks!



More information about the dovecot mailing list