[Tickets #12527] Distorted looking Kolab XML mime data

noreply at bugs.horde.org noreply at bugs.horde.org
Fri Aug 2 10:05:26 UTC 2013


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/12527
------------------------------------------------------------------------------
  Ticket             | 12527
  Created By         | Thomas Jarosch <thomas.jarosch at intra2net.com>
  Summary            | Distorted looking Kolab XML mime data
  Queue              | Horde Framework Packages
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


Thomas Jarosch <thomas.jarosch at intra2net.com> (2013-08-02 10:05) wrote:

Hi,

with the recent line ending bugfix for Horde_Mime (#12452),
the Kolab XML data is rather unreadable.

Before the fix it looked like this:
----------------------------------
Content-Type: application/x-vnd.kolab.note; name=groupware.xml
Content-Disposition: inline; x-kolab-type=xml; filename=groupware.xml
Content-Transfer-Encoding: quoted-printable

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<note version=3D"1.0">
   <uid>51fb73b0-ff4c-4c56-819d-09e1ac100191</uid>
   <body>Mit EOL5</body>
   <categories></categories>
   <creation-date>2013-08-02T08:54:08Z</creation-date>
   <last-modification-date>2013-08-02T09:12:48Z</last-modification-date>
   <sensitivity>public</sensitivity>
   <product-id>Intranator Web Client-2.0.3 (api version: 1)</product-id>
   <summary>Mit EOL5</summary>
   <background-color>#000000</background-color>
   <foreground-color>#ffff00</foreground-color>
</note>
----------------------------------

With the fix it looks like this:
----------------------------------
Content-Type: application/x-vnd.kolab.note; name=groupware.xml
Content-Disposition: inline; x-kolab-type=xml; filename=groupware.xml
Content-Transfer-Encoding: quoted-printable

<?xml version=3D"1.0" encoding=3D"UTF-8"?>=0A<note version=3D"1.0">=0A  <ui=
d>51fb73b0-ff4c-4c56-819d-09e1ac100191</uid>=0A  <body>Mit EOL5</body>=0A  =
<categories></categories>=0A  <creation-date>2013-08-02T08:54:08Z</creation=
-date>=0A  <last-modification-date>2013-08-02T09:10:32Z</last-modification-=
date>=0A  <sensitivity>public</sensitivity>=0A  <product-id>Intranator Web =
Client-2.0.3 (api version: 1)</product-id>=0A  <summary>Mit EOL5</summary>=
=0A  <background-color>#000000</background-color>=0A  <foreground-color>#ff=
ff00</foreground-color>=0A</note>=0A
----------------------------------

Horde_Kolab_Storage_Object::_appendMessage() calls Horde_Mime_Part->toString()
with 'canonical' set to true. Using a '\r\n' line ending is a good thing
for storing the message on an IMAP server.

I guess PHP's DOMDocument uses plain '\n' for the line ending
and this gets encoded by Horde_Mime to preserve it.

The most simple fix seems to convert the XML text line endings to '\r\n'
before passing it to Horde_Mime.

As a safety check, I would ensure there is no '\r\n' already in the  
XML text output
before replacing the line endings. Line endings inside XML data
should be XML encoded anyway. Any drawbacks to anticipate?

Cheers,
Thomas






More information about the bugs mailing list