Bug 122870 - Bug in parsing of ManageSieve protocol for Sieve scripts
Summary: Bug in parsing of ManageSieve protocol for Sieve scripts
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-01 00:32 UTC by Aaron Stone
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Stone 2006-03-01 00:32:45 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    I Don't Know

I wrote the ManageSieve implementation for the DBMail mail system, and one of users of our latest development releases has not been able to use KMail to manage his Sieve scripts. The problem was traced down to this:

Oleg Lapshin wrote:

Solution is very simple :)
I wrote simple perl script, that emulate dbmail-timsieved and done some experiments

Now dbmail-timsieved do this:

C: GETSCRIPT "main"
S: {size+}
S: ...script....
S: OK

But, it must replay so:

C: GETSCRIPT "main"
S: {size}
S: ...script....
S: OK

without "+" (plus) in script size...

When I changed line 673 of timsieve.c from:
"{%u+}\r\n",
to
"{%u}\r\n",
kmail can get script to change it!!!

That's cool, but that + is stipulated by the draft RFC:
http://www.ietf.org/internet-drafts/draft-martin-managesieve-06.txt

See section 2.9, GETSCRIPT:

2.9.  GETSCRIPT Command

    Arguments:
         String - Script name

    This command gets the contents of the specified script.
    If the script does not exist the server MUST reply with
    a NO response. Upon success a string with the contents
    of the script is returned followed by a OK response.

    Example:

    C: Getscript "myscript"
    S: {48+}
    S: #this is my wonderful script
    S: reject "I reject all";
    S:
    S: OK

The encoding for a literal string is this:

    literal               = "{" number  "+}" CRLF *OCTET
        ;; The number represents the number of octets.
        ;; Sieve scripts MUST be sent as literal-utf8.
        ;; <<literal-utf8>> is defined in ACAP.

So uh, I think my server does the right thing and your client does the wrong thing :-P
Comment 1 Allen Winter 2007-08-06 19:29:47 UTC
This has been fixed for the KDE 3.5.8 and KDE 4.0 releases.