View Issue Details

IDProjectCategoryView StatusLast Update
0002298SOGoBackend Calendarpublic2013-06-21 00:19
ReporterJens Erat Assigned Tojraby 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version2.0.5 
Target Versionsoon 
Summary0002298: HTTP Error 404 when uploading ICS files using CalDAV containing 'folded' / split-up UTF-8 characters
Description

Problem Description

When uploading ICS files using CalDAV containing 'folded' / split-up UTF-8 characters. Example:

[snip]
DESCRIPTION:Lorem ipsum dolor sit amet, consectetur adipisicing elit, **BeschÃ
 ¤ftigte** sed do eiusmod tempor incididunt ut labore et dolore magna aliqua...
[snip]

This occurs with us when splitting up a two-byte encoded "Umlaut" which starts at column 75. The second byte will get folded into the next line, divided by \r\n. Sogo seems to decode UTF-8 first (recognising invalid characters and thus refusing the ICS file) and then unfold the file.

RFC 5545 (iCalendar) states:

Lines of text SHOULD NOT be longer than 75 octets [...]

Where there is no other definition for octets than bytes. Actually they're even addressing the issue described above on the next page:

 Note: It is possible for very simple implementations to generate
 improperly folded lines in the middle of a UTF-8 multi-octet
 sequence.  For this reason, implementations need to unfold lines
 in such a way to properly restore the original sequence.

In our case, the "very simple implementation" is a Perl script which unfolds the ICS file, changes some contents and then folds the lines again.

How to reproduce

Upload attached ICS file, which will be refused with an HTTP error 404. If the \r\n sequence is removed in between the split up multibyte character, the upload works as expected.

Expected behavior

The ICS file with folded multibyte character should be accepted and parsed correctly.

Attachments

broken.ics - folded umlaut, doesn't get imported
fixed.ics - removed folding sequence, thus line too long but gets imported

Additional Information

Tested with SOGo versions 2.03a, 2.04b and 2.05a, uploading with DAVFS2/Neon with Content-Type text/calendar set.

TagsNo tags attached.

Activities

2013-04-19 13:48

 

demo-files.tar (5,120 bytes)
jraby

jraby

2013-06-11 14:38

viewer   ~0005648

Hi Jens,

I've been investigating this issue for a while now and I'm getting closer to a fix. In my testing, the 'fixed.ics' file wouldn't upload correctly to SOGo, it would fail with a 404 (same error as broken.ics).

Could you post the raw http request (PUT) that your dav client is doing to upload the fixed.ics file?
The easiest way to get this is probably to tcp{dump,flow} on 127.0.0.1:20000

Thanks.

Issue History

Date Modified Username Field Change
2013-04-19 13:48 Jens Erat New Issue
2013-04-19 13:48 Jens Erat File Added: demo-files.tar
2013-04-23 12:47 ludovic Target Version => soon
2013-05-24 11:22 ludovic Target Version soon => 2.0.6
2013-06-03 14:47 jraby Status new => assigned
2013-06-03 14:47 jraby Assigned To => jraby
2013-06-11 14:38 jraby Note Added: 0005648
2013-06-21 00:19 ludovic Target Version 2.0.6 => soon