View Single Post
Old 12 Jan 2022, 06:25 AM   #5
xyzzy
Essential Contributor
 
Join Date: May 2018
Posts: 478
Quote:
Originally Posted by JeremyNicoll View Post
I've never used the Sieve Tester but I have noticed that it gets mentioned every so often.

Unfortunately I'm fairly sure that that's been in discussions about how (a) it doesn't work very well, and (b) that Fastmail have decided not to keep it uptodate. If both those things are still true then errors from it might be misleading.
When I was working on my script additions I used it a lot for testing various constructs as I went up the learning curve. For the most part Sieve Tester works "good enough" for isolated testing. But one "rough spot" I thought worth mentioning is never let Sieve Tester "see" a mailboxexists and mailboxidexists. Mailboxidexists are generated by FM's UI user rules. Sometimes it is desirable to test your entire script on an email for one reason or another. If Sieve Tester encounters a mailboxexists or mailboxidexists in its execution flow Sieve Tester will not produce any results even from the stuff done before it saw mailboxexists or mailboxidexists.

Example:
Code:
require ["fileinto", "mailbox", "editheader", "mailboxid"];
addheader "x" "point1";
if false {if mailboxidexists "xxx" {addheader "x" "point2";}}
if false {if mailboxexists "xyz" {addheader "x" "point3";}}
addheader "x" "point4";
Set either of those false tests to true and none of the script's output is generated. Not very user friendly. Ok Sieve Tester is running outside of the context of the actual mailbox environment but IMO at least something could have been done to not simply behave the way it does. For example always assume the test is true or false.

But having Sieve Testers is better than nothing or having to run the actual script sprinkled with additional trace displays (addheaders usually) and sending test cases that you have to compose and send to yourself.

In a old ticket I once asked why they don't really maintain Sieve Tester and was told they had plans to rewrite it. That was years ago now. They say very few of their users ever write their own Sieve code so it's low priority and they never seem to make any time to work on it. From what I can tell the only changes they make is to fix the require command so it doesn't choke on new extensions that FM might add to their boiler plate code (e.g., the JMAP additions).

Last edited by xyzzy : 12 Jan 2022 at 06:38 AM.
xyzzy is offline   Reply With Quote