|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
|
Thread Tools |
31 Mar 2020, 03:29 AM | #1 | |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,926
|
New rules and jmapquery
After moving to the new rules system and moving to label mode (in beta late March 2020), with no rules I see the following base sieve:
Code:
require ["fileinto", "reject", "vacation", "notify", "envelope", "body", "relational", "regex", "subaddress", "copy", "mailbox", "mboxmetadata", "servermetadata", "date", "index", "comparator-i;ascii-numeric", "variables", "imap4flags", "editheader", "duplicate", "vacation-seconds", "fcc", "x-cyrus-jmapquery"]; ### 1. Sieve generated for save-on-SMTP identities # You do not have any identities with special filing. ### 2. Sieve generated for blocked senders # You have no blocked senders. ### 3. Sieve generated for spam protection if not header :matches "X-Spam-Known-Sender" "yes*" { if allof( header :contains "X-Backscatter" "yes", not header :matches "X-LinkName" "*" ) { fileinto "\\Junk"; stop; } if header :value "ge" :comparator "i;ascii-numeric" "X-Spam-score" "5" { fileinto "\\Junk"; stop; } } ### 4. User configured rules ### 4a. Calculate rule actions # No user configured rules ### 4b. Rule sent message to trash if string :is "${deletetotrash}" "Y" { fileinto "\\Trash"; } ### 4c. Rule says message is spam elsif string :is "${spam}" "Y" { fileinto "\\Junk"; } ### 4d. Do rule actions else { if string :is "${skipinbox}" "Y" { if string :is "${hasmailbox}" "Y" { discard; } else { fileinto "\\Archive"; } } else { ### 4e. Sieve generated for fetch mail filing # You have no pop-links filing into special folders. } ### 5. Sieve generated for vacation responses # You do not have vacation responses enabled. ### 6. Sieve generated for calendar preferences if allof( header :is "X-ME-Cal-Method" "request", not exists "X-ME-Cal-Exists", header :contains "X-Spam-Known-Sender" "in-addressbook" ) { notify :method "addcal"; } elsif exists "X-ME-Cal-Exists" { notify :method "updatecal"; } } if string :is "${stop}" "Y" { # For backwards compatibility } Quote:
Code:
require ["fileinto", "reject", "vacation", "notify", "envelope", "body", "relational", "regex", "subaddress", "copy", "mailbox", "mboxmetadata", "servermetadata", "date", "index", "comparator-i;ascii-numeric", "variables", "imap4flags", "editheader", "duplicate", "vacation-seconds", "fcc", "x-cyrus-jmapquery"]; ### 1. Sieve generated for save-on-SMTP identities # You do not have any identities with special filing. ### 2. Sieve generated for blocked senders # You have no blocked senders. ### 3. Sieve generated for spam protection if not header :matches "X-Spam-Known-Sender" "yes*" { if allof( header :contains "X-Backscatter" "yes", not header :matches "X-LinkName" "*" ) { fileinto "\\Junk"; stop; } if header :value "ge" :comparator "i;ascii-numeric" "X-Spam-score" "5" { fileinto "\\Junk"; stop; } } ### 4. User configured rules ### 4a. Calculate rule actions # Search: "subject:SNEEZE" if allof( not string :is "${stop}" "Y", jmapquery text: { "subject" : "SNEEZE" } . ) { set "L0_Testing" "Y"; } ### 4b. Rule sent message to trash if string :is "${deletetotrash}" "Y" { fileinto "\\Trash"; } ### 4c. Rule says message is spam elsif string :is "${spam}" "Y" { fileinto "\\Junk"; } ### 4d. Do rule actions else { if string :is "${L0_Testing}" "Y" { set "hasmailbox" "Y"; fileinto :copy "INBOX.Testing"; } if string :is "${skipinbox}" "Y" { if string :is "${hasmailbox}" "Y" { discard; } else { fileinto "\\Archive"; } } else { ### 4e. Sieve generated for fetch mail filing # You have no pop-links filing into special folders. } ### 5. Sieve generated for vacation responses # You do not have vacation responses enabled. ### 6. Sieve generated for calendar preferences if allof( header :is "X-ME-Cal-Method" "request", not exists "X-ME-Cal-Exists", header :contains "X-Spam-Known-Sender" "in-addressbook" ) { notify :method "addcal"; } elsif exists "X-ME-Cal-Exists" { notify :method "updatecal"; } } if string :is "${stop}" "Y" { # For backwards compatibility } Bill |
|
31 Mar 2020, 04:36 AM | #2 |
Essential Contributor
Join Date: May 2018
Posts: 474
|
I'm out of ideas as to why I cannot reproduce it.
Back in January I submitted a ticket asking about the appearance of x-cyrus-jmapquery in the require list. I just reopened that ticket to ask about what triggers the jmapquery vs. header test. Stay tuned... Last edited by xyzzy : 31 Mar 2020 at 05:28 AM. |
31 Mar 2020, 09:40 AM | #3 |
Cornerstone of the Community
Join Date: Jun 2008
Location: Perth
Posts: 664
|
Having removed my custom sieve from my rules, I still cannot upgrade to the new rules.
|
31 Mar 2020, 11:38 AM | #4 | |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,926
|
Beta new rules and labels
Quote:
|
|
31 Mar 2020, 12:05 PM | #5 |
Essential Contributor
Join Date: May 2018
Posts: 474
|
When you click learn more and upgrade (assuming it's there) is the activate new rules button disabled and a message at the top indicating a reason? If so do you have any custom sieve code in either or both the sieve user edit blocks before ("old") sieve code section 4 (Sieve generated for forwarding rules) and/or section 6 (Sieve generated for calendar preferences)? If so that was my problem until n5bb cued me on to what was causing the problem. Remove (or move) that code and the activate button should be enabled.
Note the reason for this is the edit block before section 6 no longer exists in the new sieve code. Oddly there still is a edit block before the new section 4 so I don't know why the upgrade should complain about that one but it does. Also be careful about making any changes to the new sieve code since you will lose it if you revert back to the old code. Last edited by xyzzy : 31 Mar 2020 at 12:21 PM. |
31 Mar 2020, 12:07 PM | #6 | |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,926
|
Quote:
|
|
31 Mar 2020, 12:19 PM | #7 | |
Cornerstone of the Community
Join Date: Jun 2008
Location: Perth
Posts: 664
|
Yes I get the message at the top of the upgrade screen:
Quote:
I removed the custom sieve but the message remains. |
|
31 Mar 2020, 12:30 PM | #8 |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,926
|
Ah! I didn't know about that sieve limitation, since I didn't have custom code in those locations. The old system let you put custom code in several places which are no longer allowed.
Bil |
31 Mar 2020, 12:39 PM | #9 |
Essential Contributor
Join Date: May 2018
Posts: 474
|
Should work. That error message is the same one I was getting. Are you should you removed all the text in those two sections including blank lines? If all if it is removed you should see "(Insert Sieve code here)" in light grey in those sections.
|
31 Mar 2020, 12:41 PM | #10 | |
Essential Contributor
Join Date: May 2018
Posts: 474
|
Quote:
|
|
31 Mar 2020, 01:06 PM | #11 | |
Cornerstone of the Community
Join Date: Jun 2008
Location: Perth
Posts: 664
|
Quote:
Yes. That was it. Removed them and the button is now active. Thanks. |
|
31 Mar 2020, 07:40 PM | #12 | |
Cornerstone of the Community
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 603
|
Quote:
Edit: sorry - I added this before realising that you had sorted it already Last edited by JamesHenderson : 31 Mar 2020 at 07:41 PM. Reason: realised problem has been solved. |
|
31 Mar 2020, 09:57 PM | #13 |
Essential Contributor
Join Date: Jan 2017
Posts: 278
|
So where would the custom sieve get inserted in the script at the start of this thread.
|
1 Apr 2020, 04:58 AM | #14 | |
Essential Contributor
Join Date: May 2018
Posts: 474
|
Quote:
Also remember that if you use that "new" block before section 4 you will lose what you put in there should you decide to want to switch back to the "old" code for some reason. They snapshot your "old" sieve script at the time you switch from "old" to "new" and restore from it if you switch back from "new" back to "old". Bottom line, the stuff you added at the beginning and end might still be ok. Last edited by xyzzy : 1 Apr 2020 at 05:26 AM. |
|
2 Apr 2020, 04:13 AM | #15 |
Essential Contributor
Join Date: May 2018
Posts: 474
|
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.
|