Menu

#104 Fix description of tasks in exchange server

closed
nobody
2
2018-10-29
2015-08-17
Khaos
No

Hi I've got the following problem:
We use MS Exchange Server and Outlook 2013.

When I create a task in Outlook with a multiline description like this:
Some Test
Description

Then the debugger shows me, that this is "Some Test\r\nDescription" in reality.

When I call DavMail with a REPORT request for the description of this task I always get
"Some TestnDescription" as return value.

The problem is: in davmail.exchange.VProperty in the appendMultilineEncodedValue method.
There the description of "Some Test\r\nDescription" gets "Some Test\r\nDescription". \n isn't a NL anymore.
So the result of this would be:
Some Test
\nDescription

The class davmail.exchange.ICSBufferedReader however merges the two lines into one and skipps the "\" part. See the readLine method. The comment there says "workaround for broken items with \n as first line character" but this isn't very good, too. because "\n" will become "n". Leaving us with
"Some TestnDescription".

My solution to this issue:
Chage the appendMultilineEncodedValue method of the davmail.exchange.VProperty class to escape "\r" too:
if (c == '\n') {
buffer.append("\n");
} else if ( c == '\r') {
buffer.append("\r");
}

This will set the property to "Some Test\r\nDescription" which will cause a correct result value of
"Some Test\r\nDescription"

Discussion

  • Khaos

    Khaos - 2015-08-17

    Damn it! All the double \ are missing... Why does sourceforge something like this -.-..

     
  • Khaos

    Khaos - 2015-08-17

    Second try:

    The problem is: in davmail.exchange.VProperty in the appendMultilineEncodedValue method.
    There the description of "Some Test\r\nDescription" gets "Some Test\r\\nDescription". \\n isn't a NL anymore.
    So the result of this would be:
    Some Test
    \\nDescription
    The class davmail.exchange.ICSBufferedReader however merges the two lines into one and skipps the "\\" part. See the readLine method. The comment there says "workaround for broken items with \n as first line character" but this isn't very good, too. because "\\n" will become "n". Leaving us with
    "Some TestnDescription".
    My solution to this issue:
    Chage the appendMultilineEncodedValue method of the davmail.exchange.VProperty class to escape "\r" too:
    if (c == '\n') {
    buffer.append("\\n");
    } else if ( c == '\r') {
    buffer.append("\\r");
    }
    This will set the property to "Some Test\\r\\nDescription" which will cause a correct result value of
    "Some Test\r\nDescription"

     

    Last edit: Khaos 2015-08-17
  • Mickael Guessant

    • status: open --> closed
     
  • Mickael Guessant

    Obsolete, please resubmit if this issue happens with latest release

     

Log in to post a comment.