View Single Post
Old 2 Apr 2020, 02:59 PM   #26
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 478
Quote:
Originally Posted by gardenweed View Post
Fairly neat & tidy.
Just one block of conditions for all
So if that was the original "old" rules code or you re-created it in the "new" rules in no preview mode the test portion of the code should be the same sequence of code and surrounded by the new rules "bolierplate" I omitted in my earlier example. For your example you should be seeing,

Code:
if  allof( not string :is "${stop}" "Y",
     anyof(
     header :contains "Subject" "some repeating subject",
     address :contains "From" "@abcd.com.au",
     address :contains "From" "efgh.com.au",
     address :contains "From" "@stufflinfo.com",
    ...
    address :contains "From" "news@somepub.com"
     )
   )
{ 
  set "L0_test" "Y";
  
  set "skipinbox" "Y";
  
  set "stop" "Y";
}
The rule's actions are delayed to allow certain rules to be executed in combination with other rules; to control sending to trash or spam, or to do the associated fileinto. The state switches (variables), i.e., stop, deletetotrash, spam, and hasmailbox control the order of the various operations.

I don't mind that they through a bucket of switches at this to control the various rules combinations. I just wish they didn't put a blank line after each setting which needlessly spreads the code out more than it has to.

-------

Off topic meta question: does anybody now why surrounding example code with the code formatting operation inserts so many blank lines at the end of the code? They are not there when I create or edit the post.

Last edited by xyzzy : 2 Apr 2020 at 03:08 PM.
xyzzy is offline   Reply With Quote