You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Boris Burtin (JIRA)" <se...@james.apache.org> on 2009/10/28 01:02:59 UTC

[jira] Created: (JSIEVE-74) Script parsing fails when the string contains a backslash

Script parsing fails when the string contains a backslash
---------------------------------------------------------

                 Key: JSIEVE-74
                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
             Project: JAMES jSieve
          Issue Type: Bug
          Components: JSieve (Main)
    Affects Versions: 0.3
            Reporter: Boris Burtin


The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.

require ["fileinto", "reject", "tag", "flag"];

# test
if allof (header :contains "to" "\\") {
    keep;
    stop;
}

# test2
if anyof (header :contains "subject" "foo") {
    keep;
    stop;
}

org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Assigned: (JSIEVE-74) Script parsing fails when the string contains a backslash

Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JSIEVE-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Burrell Donkin reassigned JSIEVE-74:
-------------------------------------------

    Assignee:     (was: Robert Burrell Donkin)

I'm not sure when I'll next find some free  time.

> Script parsing fails when the string contains a backslash
> ---------------------------------------------------------
>
>                 Key: JSIEVE-74
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
>             Project: JAMES jSieve
>          Issue Type: Bug
>          Components: JSieve (Main)
>    Affects Versions: 0.3
>            Reporter: Boris Burtin
>
> The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.
> require ["fileinto", "reject", "tag", "flag"];
> # test
> if allof (header :contains "to" "\\") {
>     keep;
>     stop;
> }
> # test2
> if anyof (header :contains "subject" "foo") {
>     keep;
>     stop;
> }
> org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Assigned: (JSIEVE-74) Script parsing fails when the string contains a backslash

Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JSIEVE-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Burrell Donkin reassigned JSIEVE-74:
-------------------------------------------

    Assignee: Robert Burrell Donkin

> Script parsing fails when the string contains a backslash
> ---------------------------------------------------------
>
>                 Key: JSIEVE-74
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
>             Project: JAMES jSieve
>          Issue Type: Bug
>          Components: JSieve (Main)
>    Affects Versions: 0.3
>            Reporter: Boris Burtin
>            Assignee: Robert Burrell Donkin
>
> The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.
> require ["fileinto", "reject", "tag", "flag"];
> # test
> if allof (header :contains "to" "\\") {
>     keep;
>     stop;
> }
> # test2
> if anyof (header :contains "subject" "foo") {
>     keep;
>     stop;
> }
> org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JSIEVE-74) Script parsing fails when the string contains a backslash

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSIEVE-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773473#action_12773473 ] 

Norman Maurer commented on JSIEVE-74:
-------------------------------------

Does it work with this rule? :

if allof (header :contains "to" "\\\\") { 


Thx,
Norman


> Script parsing fails when the string contains a backslash
> ---------------------------------------------------------
>
>                 Key: JSIEVE-74
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
>             Project: JAMES jSieve
>          Issue Type: Bug
>          Components: JSieve (Main)
>    Affects Versions: 0.3
>            Reporter: Boris Burtin
>
> The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.
> require ["fileinto", "reject", "tag", "flag"];
> # test
> if allof (header :contains "to" "\\") {
>     keep;
>     stop;
> }
> # test2
> if anyof (header :contains "subject" "foo") {
>     keep;
>     stop;
> }
> org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JSIEVE-74) Script parsing fails when the string contains a backslash

Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSIEVE-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778150#action_12778150 ] 

Robert Burrell Donkin commented on JSIEVE-74:
---------------------------------------------

I've added a test case (main/src/test/java/org/apache/jsieve/LiteralEscapeTest.java) but don't seem to be able to reproduce the problem. i have some vague memory of fixing an escaping bug so it could already be fixed.

Boris - could you check that the test case is correct and - if so - whether this issue is reproduceable using the latest code. 

Cheers

Robert

> Script parsing fails when the string contains a backslash
> ---------------------------------------------------------
>
>                 Key: JSIEVE-74
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
>             Project: JAMES jSieve
>          Issue Type: Bug
>          Components: JSieve (Main)
>    Affects Versions: 0.3
>            Reporter: Boris Burtin
>            Assignee: Robert Burrell Donkin
>
> The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.
> require ["fileinto", "reject", "tag", "flag"];
> # test
> if allof (header :contains "to" "\\") {
>     keep;
>     stop;
> }
> # test2
> if anyof (header :contains "subject" "foo") {
>     keep;
>     stop;
> }
> org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JSIEVE-74) Script parsing fails when the string contains a backslash

Posted by "Boris Burtin (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSIEVE-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778667#action_12778667 ] 

Boris Burtin commented on JSIEVE-74:
------------------------------------

Just downloaded the latest 0.4 jar and got the same parse error:

Exception in thread "main" org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n} \n"
	at org.apache.jsieve.parser.generated.SieveParserTokenManager.getNextToken(SieveParserTokenManager.java:609)
	at org.apache.jsieve.parser.generated.SieveParser.getToken(SieveParser.java:640)
	at org.apache.jsieve.parser.generated.SieveParser.jjtreeOpenNodeScope(SieveParser.java:10)
	at org.apache.jsieve.parser.generated.SieveParser.arguments(SieveParser.java:195)
	at org.apache.jsieve.parser.generated.SieveParser.test(SieveParser.java:320)
	at org.apache.jsieve.parser.generated.SieveParser.arguments(SieveParser.java:218)
	at org.apache.jsieve.parser.generated.SieveParser.test(SieveParser.java:320)
	at org.apache.jsieve.parser.generated.SieveParser.arguments(SieveParser.java:218)
	at org.apache.jsieve.parser.generated.SieveParser.test(SieveParser.java:320)
	at org.apache.jsieve.parser.generated.SieveParser.test_list(SieveParser.java:356)
	at org.apache.jsieve.parser.generated.SieveParser.arguments(SieveParser.java:221)
	at org.apache.jsieve.parser.generated.SieveParser.test(SieveParser.java:320)
	at org.apache.jsieve.parser.generated.SieveParser.arguments(SieveParser.java:218)
	at org.apache.jsieve.parser.generated.SieveParser.command(SieveParser.java:117)
	at org.apache.jsieve.parser.generated.SieveParser.commands(SieveParser.java:84)
	at org.apache.jsieve.parser.generated.SieveParser.start(SieveParser.java:29)
	at org.apache.jsieve.SieveFactory.parse(SieveFactory.java:101)
	at com.zimbra.cs.filter.RuleManager.parse(RuleManager.java:394)
	at Test.main(Test.java:33)


> Script parsing fails when the string contains a backslash
> ---------------------------------------------------------
>
>                 Key: JSIEVE-74
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
>             Project: JAMES jSieve
>          Issue Type: Bug
>          Components: JSieve (Main)
>    Affects Versions: 0.3
>            Reporter: Boris Burtin
>
> The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.
> require ["fileinto", "reject", "tag", "flag"];
> # test
> if allof (header :contains "to" "\\") {
>     keep;
>     stop;
> }
> # test2
> if anyof (header :contains "subject" "foo") {
>     keep;
>     stop;
> }
> org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JSIEVE-74) Script parsing fails when the string contains a backslash

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSIEVE-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773461#action_12773461 ] 

Norman Maurer commented on JSIEVE-74:
-------------------------------------

Just for the record, here is the rfc part which is relevant to this buf:


   A quoted string starts and ends with a single double quote (the <">
   character, ASCII 34).  A backslash ("\", ASCII 92) inside of a quoted
   string is followed by either another backslash or a double quote.
   This two-character sequence represents a single backslash or double-
   quote within the string, respectively.


Read more: http://www.faqs.org/rfcs/rfc3028.html#ixzz0VtMQx6Hm



> Script parsing fails when the string contains a backslash
> ---------------------------------------------------------
>
>                 Key: JSIEVE-74
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
>             Project: JAMES jSieve
>          Issue Type: Bug
>          Components: JSieve (Main)
>    Affects Versions: 0.3
>            Reporter: Boris Burtin
>
> The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.
> require ["fileinto", "reject", "tag", "flag"];
> # test
> if allof (header :contains "to" "\\") {
>     keep;
>     stop;
> }
> # test2
> if anyof (header :contains "subject" "foo") {
>     keep;
>     stop;
> }
> org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JSIEVE-74) Script parsing fails when the string contains a backslash

Posted by "Boris Burtin (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSIEVE-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773609#action_12773609 ] 

Boris Burtin commented on JSIEVE-74:
------------------------------------

I saw the problem with both two and four backslashes.

> Script parsing fails when the string contains a backslash
> ---------------------------------------------------------
>
>                 Key: JSIEVE-74
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
>             Project: JAMES jSieve
>          Issue Type: Bug
>          Components: JSieve (Main)
>    Affects Versions: 0.3
>            Reporter: Boris Burtin
>
> The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.
> require ["fileinto", "reject", "tag", "flag"];
> # test
> if allof (header :contains "to" "\\") {
>     keep;
>     stop;
> }
> # test2
> if anyof (header :contains "subject" "foo") {
>     keep;
>     stop;
> }
> org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (JSIEVE-74) Script parsing fails when the string contains a backslash

Posted by "Boris Burtin (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JSIEVE-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Burtin updated JSIEVE-74:
-------------------------------

    Attachment: backslash-rule.sieve

Sieve script that causes the parsing problem.

> Script parsing fails when the string contains a backslash
> ---------------------------------------------------------
>
>                 Key: JSIEVE-74
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-74
>             Project: JAMES jSieve
>          Issue Type: Bug
>          Components: JSieve (Main)
>    Affects Versions: 0.3
>            Reporter: Boris Burtin
>         Attachments: backslash-rule.sieve
>
>
> The following script fails to parse because one of the string literals contains a backslash.  The parser also reports an error in the wrong line.
> require ["fileinto", "reject", "tag", "flag"];
> # test
> if allof (header :contains "to" "\\") {
>     keep;
>     stop;
> }
> # test2
> if anyof (header :contains "subject" "foo") {
>     keep;
>     stop;
> }
> org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at line 14, column 0.  Encountered: <EOF> after : "\") {\n    keep;\n    stop;\n}\n"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org