Posible bug on MIME.Message parsing complex boundary mails (2nd level) with surrogated breaks or spaces
destopa <[email protected]> Mon, 23 Oct 2017 07:49:34 -0700 (MST)
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
Hy, Pike Guys.
I'w appreciate your help with a problem facing with the use of
MIME.Message() in some situations.
There are some MIME messages that when we process, throw an error like:
multipart message improperly terminated ("\n");
If we inspect it manually at low level, we found that some of them there are
correct syntactically, and others clients can process
it without any problem. When we process mime messages with only one level of
boundaries, this problem occours only when some Epilogue text is found at
the end of the message data.
When we process more complex mime messages (2nd level, or with two distinct
boundary headers), this problem is raised when some extra break is present
in the middle Epilogue zone.
Specially, when this message is throwed, we found that in many cases, three
are some break ("\n") or some blank line to ignore between the final
boundary of the Multipart/alternative message (in 2nd level) and the next
boundary for the main Mime parts (for example, if the main header is a
multipart/mixed).
We are using pike 8.0, but this error was also detected on previous
versions. We do not use laxed option, because this is a poison for all
other invalid or unfformated messages, but we thing that maybe something is
not done correctly with the mime "Epilogue" (that would be ignored) or when
a complex mime (more than one level) is processed.
See here, that I'm refering with the processing of the "Epilogue" and
"Preamble" (that these data seems must be ignored):
https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
Finally, I attach two data samples to reproduce it, a mime example that
cannot be processed correctly with pike (original data) and the same one
modified manually to pass the current pike process of MIME.Message to make
an object.
> MIME.Message(Stdio.read_bytes("original.eml"));
multipart message improperly terminated ("\n")
/usr/lib/pike7.8/modules/MIME.pmod/module.pmod:1518:
Message(([ ]))->create("From [email protected] Tue Jul 18
14:14:15 2017\nReturn-Path: <[email protected]>\nX-Original-To:
[email protected]\nDe
livered-To: correo@certi"+[2676],UNDEFINED,UNDEFINED,UNDEFINED)
/usr/lib/pike7.8/modules/MIME.pmod/module.pmod:818: MIME->Message()
HilfeInput:1: HilfeInput()->___HilfeWrapper()
> MIME.Message(Stdio.read_bytes("modified.eml"));
(1) Result: Message(([ ]))
You can use meld or similar tool to see visually that they differ minimally
and the mime construction in original.eml seems to be also valid.
Can you analise if we are in reason or not? If the pike process is not 100%
correct, can you suggest us a modification to bypas correctly these
situations (without throwing an error)?
Kind regards
modified.eml <http://pike.1058338.n5.nabble.com/file/t339041/modified.eml>
original.eml <http://pike.1058338.n5.nabble.com/file/t339041/original.eml>
--
Sent from: http://pike.1058338.n5.nabble.com/Pike-User-f4601254.html