Sieve script won't compile. Compiler output isn't helpful.

Stephan Bosch stephan at rename-it.nl
Wed Nov 30 10:44:55 UTC 2016



Op 30-11-2016 om 11:04 schreef Steven Mainor:
> Hello Martin,
>
> Wow. That was indeed the problem. I have been staring at that small 
> script for a week and I just couldn't see it. I even had a friend look 
> at it and he couldn't find it either. I feel a bit ridiculous now.

Making the handling/reporting of unterminated quoted strings better has 
been on my list for a while now. You're the first to actually complain 
about it so far. :)

The main problem is that Sieve quoted strings are allowed to contain 
newlines, which means that a string doesn't necessarily end before the 
end of the line.

Regards,

Stephan.

>
> On 11/30/2016 04:48 AM, Martin Wheldon wrote:
>> Hi Steven,
>>
>> OK a on closer inspection :)
>>
>> You are missing a closing double quote on line 59:
>>
>>> fileinto :create "Lists/Debain/News;
>>
>> should be:
>>
>> fileinto :create "Lists/Debain/News";
>>
>> Best Regards
>>
>> Martin
>>
>> On 2016-11-30 09:30, Steven Mainor wrote:
>>> Hey martin,
>>>
>>> Thanks for the reply! I made the changes you suggested but I got the
>>> same results.
>>>
>>> According to my understanding, #header "from" "person at example.com"# is
>>> correct for an exact match.
>>>
>>>
>>> On 11/30/2016 04:10 AM, Martin Wheldon wrote:
>>>> Hi Steven,
>>>>
>>>> I think you may be missing the :contains from the two header lines 
>>>> below:
>>>>
>>>>> if anyof (header "From" "store-news at amazon.com",
>>>>>          envelope :contains "From" "menswearhouse.com",
>>>>>          envelope :contains "From" "officedepot.com",
>>>>>          envelope :contains "From" "walgreens.com",
>>>>>          header "From" "promo at email.newegg.com") {
>>>>>     fileinto :create "Promo";
>>>>>     stop;
>>>>
>>>> if anyof (header :contains "From" "store-news at amazon.com",
>>>>           envelope :contains "From" "menswearhouse.com",
>>>>           envelope :contains "From" "officedepot.com",
>>>>           envelope :contains "From" "walgreens.com",
>>>>           header :contains "From" "promo at email.newegg.com") {
>>>>      fileinto :create "Promo";
>>>>      stop;
>>>>
>>>> Hope that helps
>>>>
>>>> Best Regards
>>>>
>>>> Martin
>>>>
>>>> On 2016-11-30 08:47, Steven Mainor wrote:
>>>>> Hello! I hope you will forgive my ignorance but I have a problem I
>>>>> have been trying to solve for a week and I'm not sure where else to
>>>>> turn.
>>>>>
>>>>> I'm trying to write a sieve script to sort all of my mail. I was
>>>>> writing this script to replace the one I am currently using but I
>>>>> can't seem to get it to compile. I don't know a lot about sieve or
>>>>> really scripting of any kind and I just can't figure out what I'm
>>>>> doing wrong.
>>>>>
>>>>> The compiler just puts out a bunch of output that doesn't make sense.
>>>>> like "unexpected character" when I know the character works there
>>>>> because I am already running a script with some of the same lines.
>>>>>
>>>>> I'm attaching the script with some names and addresses changed and 
>>>>> the
>>>>> sieve output to this email.
>>>>>
>>>>> I would greatly appreciate any help anyone could offer.



More information about the dovecot mailing list