View Single Post
Old 2 Apr 2020, 06:19 AM   #16
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,929
Quote:
Originally Posted by xyzzy View Post
Finally got a response on my ticket on why I don't ever see jmapquery's. It's because it never occurred to me different sieve code for conditions would be generated when you create a rule using no-preview mode as opposed to the new preview mode. I wasn't using preview mode in all my testing since I dislike its UI. But as it turns out creating a rule in preview mode causes the jmapquery to be generated. I suppose checking, say for Subject, with a jmapquery is the same as using a header :contains created with no preview mode. Oh well, it is what it is.
Wow - I never suspected that!
  • See example below showing both creation modes available in the current beta UI (no-preview, then standard rules).
  • The Help currently uses the term "Sieve constructor" rather than "no-preview".
  • To me it's a bit confusing to call the new mode "standard" and the more advanced mode (in most respects) "no-preview mode (regular expressions supported)".
  • I think it might be better to call the two rule creation modes "basic (with preview)" and "advanced (without preview)".
Code:
 ### 4a. Calculate rule actions
if 
  allof( not string :is "${stop}" "Y",
    header :contains "Subject" "ZBJ"
  )
{
  set "L0_Test" "Y";
}

# Search: "subject:SNEEZE"
if 
  allof( not string :is "${stop}" "Y",
    jmapquery text:
  {
     "subject" : "SNEEZE"
  }
.
  )
{
  set "L0_Test" "Y";
}
n5bb is offline   Reply With Quote