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 791475 - Incorrectly parses headers in certain case
Incorrectly parses headers in certain case
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
3.26.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2017-12-11 12:25 UTC by Milan Crha
Modified: 2018-04-12 16:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Milan Crha 2017-12-11 12:25:12 UTC
I've a message which is parsed incorrectly and shows raw content (like message source) instead of multipart/mixed and multipart/alternative content. The local copy is saved properly on the disk. After some investigation, the trick is that its main Content-Type header looks like this:

Content-Type: multipart/mixed; 
        boundary="----=_Part_1587833_741364485.1510210808363"

where there's a space at the end of the first line and a tab at the beginning of the second line, while the second line begins at byte 4096. When I remove the space at the end of the first line or add a space there, then it's read properly. The shown message source (without changes in the file) has missing boundary parameter.
Comment 1 Milan Crha 2018-01-02 18:55:47 UTC
The message parser should check whether headers are folded after reading next chunk from the stream when the previous chunk ended with '\n'.

Created commit ee4f5257f in eds master (3.27.4+)
Created commit db2650049 in eds gnome-3-26 (3.26.4+)
Comment 2 Milan Crha 2018-02-28 10:55:46 UTC
Err, this change broke evolution-mapi, when parsing PidTagTransportMessageHeaders string, which ends with \n, or \r\n, then this ending had been left in the last header value.
Comment 3 Milan Crha 2018-02-28 11:26:53 UTC
Created commit ed25ae562 in eds master (3.27.92+)
Created commit 6ed82836c in eds gnome-3-26 (3.26.6+)
Comment 4 Milan Crha 2018-04-12 16:32:29 UTC
And also when the headers end at the boundary of the chunks being read (4096, 8192 and so on), then it could truncate the message body and show it empty.

Created commit d99273664 in eds master (3.29.1+)
Created commit a96acb5d8 in eds gnome-3-28 (3.28.2+)