View Single Post
Old 2 Apr 2020, 12:59 PM   #23
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 477
Quote:
Originally Posted by gardenweed View Post
When using sieve years ago, the code for this rule was one block which tested the from header and using ifany (if I recall) dumped the email into the Subscriptions folder. The block of sieve was quite long - ie many subscriptions - but it was all together in one block. Nice and neat.

When the new Rules came along (not the new new rules) this block of sieve got converted to a bucket load of individual rule tests. Looked messy to me but worked. So many rules for one action - file into Subscriptions folder.

Now, with the new-new rules, we can have multiple tests again, ie "If any"
Not sure what you are referring to. If you had existing "old" rule or set up a new rule in no preview mode then it's going to generate the sieve test code something like (ignoring the boilerplate stuff it adds now),

Code:
if anyof(address :is "from" "email address 1",
         address :is "from" "email address 2.
         etc.) {...}
It would be nicer if it generated,

Code:
address :is "from" [ "email address 1", "email address 2", "email address 3"] {...}
but it has never done that (at least in the time I've been using FM - only a few years).

If you created the rule in the new preview mode the test part looks like (still ignoring the extra boilerplate),

Code:
jmapquery text:
  {
    "conditions" : [
      { 
        "from" : "email address 1"
      },
      {
        "from" : "email address 2"
      }, 
      {
        "from" : "email address 3"
      },
    ],
    "operator" : "OR",
 }
.
All those braces on separate lines really spread this stuff out.

Quote:
For my rule that puts email into my Subscriptions bucket - is it better to have many individual rules, or to have one rule that lists all the email from-addresses that should direct to my Subscriptions bucket? Pros/Cons?
IMO from your point of view for execution it probably doesn't matter since this stuff is happening as the server receives the message. It's sort of the same question I had when I saw that for the normal filter case it fileinto :copy's the message into an mailbox and later discards the original.

IMO from an aesthetic/readability point of view it's probably better to keep them together rather than creating a separate rule for each. Personally if it's a bunch all filtering into the same mailbox I probably would just use the most compact form directly in sieve and format it something like

Code:
if address :is "from" [
  "email address 1", 
  "email address 2",
  "email address 3"] {
  ...
}
Makes it easier then to see the entire list and update it as necessary. Of course that just me! I don't mind adding stuff to sieve if it's more compact than spraying it over a bunch of rules in the rules UI.

Last edited by xyzzy : 2 Apr 2020 at 01:26 PM.
xyzzy is online now   Reply With Quote