|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
|
Thread Tools |
31 Mar 2017, 01:01 AM | #1 |
Essential Contributor
Join Date: Jun 2009
Posts: 395
|
Priority of sieve rules (manually scripted vs. widget created)
Good day.
Over the years, I have scripted many handwritten sieve rules. Some of them are so old that I forget why I scripted them in the first place. Over the next few weeks, I would like to "clean-up" all the rules, including, splitting some long and cumbersome ones. I'm pondering whether or not to start using the rules widget. Before I do so, I would like to know which rules take precedence, the ones manually scripted or the ones created with the widget. For example, if I manually script a rule to store (fileinto) all messages from Bob @ domain.invalid in the "INBOX.Bob" directory (and stop) and create a similar rule with the widget to store all similar messages in the "INBOX.Robert" directory (and stop) , which rule would take precedence? Thank you. -- Jacinto |
31 Mar 2017, 01:54 AM | #2 |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,084
|
There is no simple answer to your question. As a first step in sorting things out, go to Settings->Rules and click on Edit custom sieve code. You can see from the screen that shows how your custom sieve snippets fit around the automatically generated sieve code. If, as I suspect, your current sieve is a bit of a mess, you may find it useful to use the Copy to clipboard feature and past the script into a document file or similar, or print it if preferred. You can then mark it up with your planned cleanup steps.
I do highly recommend that you use rules most of the time. Only in some rare cases is custom sieve necessary or desirable. |
31 Mar 2017, 02:18 AM | #3 |
Essential Contributor
Join Date: Jun 2009
Posts: 395
|
Thank you, BritTim.
Actually, I have all my sieve rules stanzas backed-up as text files on my box. As you know, it's a lot easier to clean them up with a text editor than on the browser screen. At present, I don't have any widget created rules, hence, the purpose of starting this thread. When I became a FastMail subscriber years ago, the rules widget was very rudimentary, perhaps it's more advanced now. I could not have accomplished my filtering preferences back then, except by scripting my own sieve rules. If, in fact, I'm able to create the same handwritten rules with the rules widget, I would follow your suggestion and use it exclusively after I create all the rules that I need with the widget. If for no other reason, than that it should be easier to do so with the widget. We'll see. I still would like to know which rules take precedence before I start using the widget. -- Jacinto |
31 Mar 2017, 05:49 AM | #4 | ||
Essential Contributor
Join Date: Apr 2008
Posts: 371
|
Quote:
Quote:
On this screen, you should see grey blocks that show you the automatically generated Sieve rules, with editable sections in between that allow you to insert custom blocks of sieve code in between the pre-defined and widget-created rules. In the second grey block down, among other things you'll see a couple of lines like this: Code:
### 2. Sieve generated for discard rules # You do not have any discard rules. Then, in the next grey block down, you should see two sections like this: Code:
### 4. Sieve generated for forwarding rules # You do not have any forwarding rules. ### 5. Sieve generated for vacation responses # You do not have vacation responses enabled. Then, among other things in the next block after that come the place where automatically-generated filing rules get inserted.. Code:
### 7. Sieve generated for organise rules # You have no organise rules. ### 8. Sieve generated for pop-link filing # You have no pop-links filing into special folders. Last edited by jhollington : 31 Mar 2017 at 05:54 AM. |
||
31 Mar 2017, 06:46 AM | #5 |
Essential Contributor
Join Date: Jun 2009
Posts: 395
|
Thank you, jhollington.
Your detailed explanation makes clearer what BritTim was referring to. I suppose that I'll have to reread your answer a few times and add some test rules until I get the gist of it (or forget about the widget and clean-up my hand scripted rules). Either way, I need to organize my rules sooner rather than later. Thank you again. -- Jacinto |
31 Mar 2017, 01:31 PM | #6 |
Intergalactic Postmaster
Join Date: May 2004
Location: Irving, Texas
Posts: 8,917
|
Improvements to both sieve language support and rules system
FastMail has made major improvements to their sieve language support and to their rules features in the past few months. For example, you can now easily make a new rule while reading an email, based on the contents of that message.
As pointed out by others, your sieve script consists of the Settings>Rules choices, spam filtering and a few miscellaneous automatic rules, and your custom sieve additions between the automatic blocks. The execution order is sequential, so there is no priority other than that set by the ordering of the sieve statements and stop statements which prevent later steps from being executed. You can prevent automatically generated blocks from executing by encasing the block as described in this post: How to bypass spam filtering for certain addresses Here are some additional references you might want to read. You can also find much more by searching for "sieve" in the help system. The notify sieve support has been completely rewritten and now supports several popular web services which perform automatic actions when triggered by a sieve command.Bill |
31 Mar 2017, 10:07 PM | #7 |
Essential Contributor
Join Date: Jun 2009
Posts: 395
|
Thanks to all who replied.
I've decided not to bother using the widget. My hand scripted sieve rules have served me well for all this years and there is no purpose in reinventing the wheel at this time. All I need to do is delete the ones that no longer have any use, split the ones that are too long and complicated, and make sure they are all in the order I want them to be. I'll leave it to others to play with the widget. -- Jacinto |
1 Apr 2017, 12:44 AM | #8 |
Essential Contributor
Join Date: Jun 2009
Posts: 395
|
Hello.
Started the clean-up this morning. Found the following two enabled sieve generated rules (that I did not script) at the top of the sieve rules (there were others, but they were disabled): Code:
### 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" "*", not header :contains "X-Backscatter-Hosts" ["smtp.[XXXX].com","smtp.[XXXX].org","[XXXX].[XXXX].com"] ) { fileinto "\\Junk"; stop; } if anyof(header :value "gt" :comparator "i;ascii-numeric" "X-Spam-score" "5", header :regex "X-Spam-score" "^5\.[1-9]$") { fileinto "\\Junk"; stop; } } Code:
### 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"; } The second one appears to deal with making or updating calendar entries from received E-Mail messages. I don't really use the calendar and don't want anyone else making or attempting to make calendar entries, hence, unless if by doing so the Earth would stop spinning or the Atlantic Ocean would drain, I'll comment (disable) it. -- Jacinto P.S.: No can do -- the rule's text can't be edited. Last edited by Jacinto : 1 Apr 2017 at 12:53 AM. |
1 Apr 2017, 02:17 AM | #9 |
The "e" in e-mail
Join Date: May 2003
Location: mostly in Thailand
Posts: 3,084
|
To disable snippets of automatically generated sieve code, you need to enclose it with custom sieve. Before it, have the custom sieve
Code:
if false { Code:
} |
1 Apr 2017, 04:35 AM | #10 | ||
Essential Contributor
Join Date: Jun 2009
Posts: 395
|
Quote:
Of course, I have no way to test it. Quote:
Having said that and as I said earlier, my handwritten rules have served me well for many years and they still work as I want them to. Personally, I don't believe that Fastmail is going to abandon sieve or deviate from the standards. If it does, I'll just use an IMAP filtering application that I have used successfully in the past: https://github.com/lefcha/imapfilter Hopefully, I won't have to. By the way, while Fastmail was owned by Opera, especially when it was rumored that Opera was being sold to Facebook, I set up accounts with other mail hosts. However, none of them had FM's filtering capabilities or even came close. Fortunately, I didn't have to change hosts and don't believe I'll have to in the near future. -- Jacinto |
||
Thread Tools | |
|
|