View Single Post
Old 5 May 2019, 09:14 PM   #4
blurk
Member
 
Join Date: May 2006
Location: Sydney, Australia
Posts: 32
Quote:
Originally Posted by xyzzy View Post
You said you reworked your sieve script. Maybe it has a bug. Have you tried it in Sieve Tester with a test case to see if its going down the expected path?
Wise advice. Following a classic divide and conquer debug strategy of adding traces and adding stops at different places to narrow down the point at which a working script stops working, my initial results suggest that the addheader Sieve extension command is somehow breaking the addflag Sieve extension command.

Go figure. It's not a syntax error, because the way my script fails would be totally different (in fact, I believe I wouldn't even be allowed to save a script with a syntax error).

Next thing to see is if it's the details of my addheader commands at fault, or whether there's a fundamental incompatibility between the two extensions. The latter would, in my opinion, be a bug. The odd thing is that I'm pretty sure I only added the addheader commands to trace my script, to see why addflag wasn't working. Chicken. Egg.

Update:

Works:
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"];

addflag "\\Flagged";
Fails to add flag:
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"];


addflag "\\Flagged";
addheader "X-Sieve" "x";

Last edited by blurk : 5 May 2019 at 09:53 PM.
blurk is offline   Reply With Quote