|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
|
Thread Tools |
2 Apr 2020, 06:19 AM | #16 | |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,929
|
Quote:
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"; } |
|
2 Apr 2020, 07:08 AM | #17 | ||
Essential Contributor
Join Date: May 2018
Posts: 477
|
Quote:
He also indicated another oddity with jmapquery. First the restriction on the rules conditions are because search can't handle any others with it and the surprising one I didn't know about search is, and I quote... Quote:
At any rate it doesn't matter I don't like the UI for constructing rules in that preview mode and always use the "no preview" mode which is why I was never able to cause the jmapquery's to be generated. |
||
2 Apr 2020, 07:36 AM | #18 | |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,929
|
Quote:
Bill |
|
2 Apr 2020, 07:50 AM | #19 |
Cornerstone of the Community
Join Date: Jun 2008
Location: Perth
Posts: 664
|
Philosophical question??
Background
I have a bundle of individual rules that filter selected emails into a folder called Subscriptions. It's a simple Inbox management rule where I dump all those not so important subscription emails so as not to clutter my inbox. 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" My question: 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? |
2 Apr 2020, 11:16 AM | #20 | |
Essential Contributor
Join Date: May 2018
Posts: 477
|
Quote:
Maybe I should go back to that ticket, challenge him on his statement, and escalate it if necessary. By the way I don't think being in labels or folders mode is significant for this search stuff. |
|
2 Apr 2020, 11:46 AM | #21 |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,929
|
Using subdomain addressing to automatically deliver messages to folders
Since you asked a philosophical question, I will respond with my philosophy on this issue.
Bill |
2 Apr 2020, 12:34 PM | #22 | |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,929
|
Stemming search
Quote:
https://www.fastmail.com/help/receive/search.html Quotes (single ' or double ") around a word or phrase cause only those exact characters to be matched (ignoring case). They might be using the Porter stemming algorithm. See: https://raw.githubusercontent.com/sn...porter/voc.txt https://tartarus.org/martin/PorterStemmer/ That stemming algorithm matches the fox/foxes and goose/gooses/geese behavior I noted above. Bill |
|
2 Apr 2020, 12:59 PM | #23 | ||
Essential Contributor
Join Date: May 2018
Posts: 477
|
Quote:
Code:
if anyof(address :is "from" "email address 1", address :is "from" "email address 2. etc.) {...} Code:
address :is "from" [ "email address 1", "email address 2", "email address 3"] {...} 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", } . Quote:
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"] { ... } Last edited by xyzzy : 2 Apr 2020 at 01:26 PM. |
||
2 Apr 2020, 01:35 PM | #24 |
Essential Contributor
Join Date: May 2018
Posts: 477
|
|
2 Apr 2020, 01:45 PM | #25 |
Cornerstone of the Community
Join Date: Jun 2008
Location: Perth
Posts: 664
|
@xyzzy
Very much like the 1st example Sieve used to look like: Code:
if anyof( header :contains "subject" "some repeating subject", header :contains "from" "@abcd.com.au", header :contains "from" "efgh.com.au", header :contains "from" "@stufflinfo.com", .... header :contains "from" "news@somepub.com" ) { fileinto "INBOX.Subscriptions"; stop; } Just one block of conditions for all |
2 Apr 2020, 02:59 PM | #26 |
Essential Contributor
Join Date: May 2018
Posts: 477
|
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"; } 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. |
2 Apr 2020, 04:16 PM | #27 |
Cornerstone of the Community
Join Date: Jun 2008
Location: Perth
Posts: 664
|
|
6 Apr 2020, 08:01 AM | #28 |
Essential Contributor
Join Date: Oct 2003
Posts: 327
|
Is there a risk that upgrading to the new system will mess up the custom sieve rules?
|
6 Apr 2020, 08:17 AM | #29 | |
Cornerstone of the Community
Join Date: Jun 2008
Location: Perth
Posts: 664
|
Quote:
I had to remove my custom sieve before I was allowed to upgrade. So I converted the few custom rules I still had to the existing rules system and then removed the custom sieve. Then I was able to select the upgrade button. |
|
6 Apr 2020, 10:40 AM | #30 | |
Essential Contributor
Join Date: May 2018
Posts: 477
|
Quote:
So IMO essentially the new FM-generated sieve code should not screw up your existing additions at the beginning and/or end. But you'll have to figure out how to convert anything you had in the "old" middle two blocks to work with the new code. |
|