After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 784116 - Preserve header's folding misbehaves for folded boundary parameter
Preserve header's folding misbehaves for folded boundary parameter
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
3.20.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2017-06-23 00:50 UTC by James Bottomley
Modified: 2017-06-26 09:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for the header parser to ignore newlines (1.35 KB, patch)
2017-06-23 22:53 UTC, James Bottomley
none Details | Review

Description James Bottomley 2017-06-23 00:50:22 UTC
commit b9c01bd8230ec788f2e8f1cd54af1e268e5a98e9
Author: Milan Crha <mcrha@redhat.com>
Date:   Mon Apr 18 14:45:15 2016 +0200

    Bug 235681 - Preserve header's folding
 
Breaks the ability to process these calendar entries.  Reversing this patch is sufficient to bring back the capability.

The problem seems to be that lotus notes splits the Content-Type: line within the boundary directive, so on a non showing calendar item it is:

...
Content-Type: multipart/mixed; boundary="=_mixed
 B411FBD3AB4AE8580025813E0015BEB0_="
...
--=_mixed B411FBD3AB4AE8580025813E0015BEB0_=
...

Which causes the multipart mime parsers not to see the boundaries.

This is a regression over the previous behaviour, so it needs fixing in the new strict header regime (perhaps by making the boundary only go through the prior parser) or reverting
Comment 1 Milan Crha 2017-06-23 09:03:29 UTC
Thanks for a bug report. Could you provide a whole test message, please? The thing I see from the above is that the folding is supposed to remove the leading space, while your boundary contains that space, which is basically wrong. As it can be caused by paste into the comment, a real message would be better (also for testing purposes). Thanks in advance.
Comment 2 James Bottomley 2017-06-23 21:25:10 UTC
Unfortunately I pasted that from a recent meeting request, which, as you can appreciate is a bit confidential.  I'll see if I can get someone on notes to generate a test meeting.

However, the problem is that the Content-Type is split over two lines (which I believe is legal according to RFC, so it's seen as _mixed\n B411...

This is what strict header parsing causes to mismatch because it no longer exactly matches the internal email boundaries which don't have the \n
Comment 3 James Bottomley 2017-06-23 22:53:26 UTC
Created attachment 354344 [details] [review]
Fix for the header parser to ignore newlines

This is what I think is the proper fix.  I don't believe it's ever proper not to unfold newlines when parsing headers, so this adds global code to do that.

It fixes my lotus notes problem without reversing bug #235681
Comment 4 Milan Crha 2017-06-26 09:11:28 UTC
Thanks for the patch. I tried to create a similar test message, with which I've been able to reproduce the issue. I do not know whether it's exactly the same content as Lotus would generate, but let's hope it is (as I can reproduce). My initial idea was to add an unfold() call for the Content-Type header, but your change works too and it even fixes an import of such formatted message (without the patch, the last boundary is doubled, with added \n in it, which is wrong). Thus I took your patch and added it into the sources:

Created commit ca2605a in eds master (3.25.4+)
Created commit 357a36c in eds gnome-3-24 (3.24.4+)