EmailDiscussions.com  

Go Back   EmailDiscussions.com > Email Service Provider-specific Forums > FastMail Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Stay in touch wirelessly

FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc.

Reply
 
Thread Tools
Old 31 Mar 2020, 04:29 AM   #1
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,917
Arrow 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
}
If I add this one rule (everything else left at default):
Quote:
Matches subject:SNEEZE
Add label Testing - Continue to apply other rules
I then get the following sieve containing jmapquery in the ### 4a. Calculate rule actions code:

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
}
I hope this helps those wondering about how jmapquery appears in the new rules system.


Bill
n5bb is online now   Reply With Quote

Old 31 Mar 2020, 05:36 AM   #2
xyzzy
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 06:28 AM.
xyzzy is offline   Reply With Quote
Old 31 Mar 2020, 10:40 AM   #3
gardenweed
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.
gardenweed is offline   Reply With Quote
Old 31 Mar 2020, 12:38 PM   #4
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,917
Lightbulb Beta new rules and labels

Quote:
Originally Posted by gardenweed View Post
Having removed my custom sieve from my rules, I still cannot upgrade to the new rules.
Custom sieve didn't affect my upgrading to the new rules system, so I'm not sure why you think that might be an issue. At this time, I have updated all of my accounts to the new rules and label mode. I'm not sure if these features have been rolled out to all users, since it's still in beta. But here are some questions which might indicate why you are having difficulty:
  • What is your account level?
  • Log into beta.fastmail.com and go to the Settings>Rules screen. At the top of that screen you should see a line titled:
    "Fastmail is improving the way rules and filters work. Learn more and upgrade"
    • Do you see that link (Learn more and upgrade)? If so, what happens if you click it and then choose to upgrade? Do you get an error message?
    • If you don't see the upgrade information at the top of the page while you are logged into beta, then your account (or account level) isn't offering the new features yet.
  • After you have upgraded to the new rules, the rules designation in the Settings screen will change to Filters & Rules (instead of the old Rules). You will also be able to use labels by switching at: Settings>Customize>Preferences>Mail>Labels
Bill
n5bb is online now   Reply With Quote
Old 31 Mar 2020, 01:05 PM   #5
xyzzy
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 01:21 PM.
xyzzy is offline   Reply With Quote
Old 31 Mar 2020, 01:07 PM   #6
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,917
Quote:
Originally Posted by xyzzy View Post
Is the upgrade button disabled? If so do you have any custom sieve code in either or both the user edit blocks before sieve 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 that code and the upgrade button will be enabled.
Oh ... I didn't know that that old sieve was really a problem. How did this show up? Which screen had the disabled button?
n5bb is online now   Reply With Quote
Old 31 Mar 2020, 01:19 PM   #7
gardenweed
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:
Sorry, we can’t upgrade you yet. You have custom Sieve code that may interact with our new rules system. We will be checking these and enabling upgrading in the future. If you would like to upgrade now, please remove any custom Sieve code from the middle of our generated Sieve blocks, or contact support for assistance.
And the upgrade button is greyed out.

I removed the custom sieve but the message remains.
gardenweed is offline   Reply With Quote
Old 31 Mar 2020, 01:30 PM   #8
n5bb
Intergalactic Postmaster
 
Join Date: May 2004
Location: Irving, Texas
Posts: 8,917
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
n5bb is online now   Reply With Quote
Old 31 Mar 2020, 01:39 PM   #9
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 474
Quote:
Originally Posted by gardenweed View Post
I removed the custom sieve but the message remains.
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.
xyzzy is offline   Reply With Quote
Old 31 Mar 2020, 01:41 PM   #10
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 474
Quote:
Originally Posted by n5bb View Post
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.
You were the one that cued me to the problem when you posted in that other thread what user blocks existed in the new code.
xyzzy is offline   Reply With Quote
Old 31 Mar 2020, 02:06 PM   #11
gardenweed
Cornerstone of the Community
 
Join Date: Jun 2008
Location: Perth
Posts: 664
Quote:
Originally Posted by xyzzy View Post
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.
Blank lines!
Yes. That was it.
Removed them and the button is now active.
Thanks.
gardenweed is offline   Reply With Quote
Old 31 Mar 2020, 08:40 PM   #12
JamesHenderson
Cornerstone of the Community
 
Join Date: Jan 2003
Location: Oxfordshire, UK
Posts: 603
Quote:
Originally Posted by gardenweed View Post
Having removed my custom sieve from my rules, I still cannot upgrade to the new rules.
I found. that I still had one single <enter> that prevented me from upgrading. Can you see the words (Insert Sieve code here) in each slot?

Edit: sorry - I added this before realising that you had sorted it already

Last edited by JamesHenderson : 31 Mar 2020 at 08:41 PM. Reason: realised problem has been solved.
JamesHenderson is offline   Reply With Quote
Old 31 Mar 2020, 10:57 PM   #13
SideshowBob
Essential Contributor
 
Join Date: Jan 2017
Posts: 278
Quote:
Originally Posted by n5bb View Post
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.
So where would the custom sieve get inserted in the script at the start of this thread.
SideshowBob is offline   Reply With Quote
Old 1 Apr 2020, 05:58 AM   #14
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 474
Quote:
Originally Posted by SideshowBob View Post
So where would the custom sieve get inserted in the script at the start of this thread.
As I said earlier the only places it doesn't "like" when switching from "old" to "new" are the edit blocks before the "old" sieve code section 4 (Sieve generated for forwarding rules) and section 6 (Sieve generated for calendar preferences? The "old" blocks at the beginning and end are preserved. And the new code does have an edit block before the "new" section 4 (User configured rules).

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 06:26 AM.
xyzzy is offline   Reply With Quote
Old 2 Apr 2020, 05:13 AM   #15
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 474
Quote:
Originally Posted by xyzzy View Post
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...
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.
xyzzy is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 02:42 PM.

 

Copyright EmailDiscussions.com 1998-2022. All Rights Reserved. Privacy Policy