Support multiple \r as long as they are followed by a single \n? #4

Closed
opened 2023-07-23 17:26:00 +00:00 by quentin · 0 comments
Owner

I have found an email with something like:

Subject: XXXX\r\r\n
Content-Type: text/plain\r\n
\r\n
content

My parser thinks that we have 2 new lines and that the body is starting...

Ref

$ cat resources/thirdparty/000.eml
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="bound"

mime header

and

$ xxd resources/thirdparty/000.eml
00000000: 4d49 4d45 2d56 6572 7369 6f6e 3a20 312e  MIME-Version: 1.
00000010: 300d 0d0a 436f 6e74 656e 742d 5479 7065  0...Content-Type
00000020: 3a20 6d75 6c74 6970 6172 742f 616c 7465  : multipart/alte
00000030: 726e 6174 6976 653b 0d0d 0a20 626f 756e  rnative;... boun
00000040: 6461 7279 3d22 626f 756e 6422 0d0d 0a0d  dary="bound"....
00000050: 0d0a 6d69 6d65 2068 6561 6465 720d 0d0a  ..mime header...
00000060: 0d0d 0a2d 2d62 6f75 6e64 0d0d 0a43 6f6e  ...--bound...Con

See:

30 0d 0d 0a 43 6f 
 0 CR CR LF  C  o
I have found an email with something like: ``` Subject: XXXX\r\r\n Content-Type: text/plain\r\n \r\n content ``` My parser thinks that we have 2 new lines and that the body is starting... ### Ref ``` $ cat resources/thirdparty/000.eml MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="bound" mime header ``` and ``` $ xxd resources/thirdparty/000.eml 00000000: 4d49 4d45 2d56 6572 7369 6f6e 3a20 312e MIME-Version: 1. 00000010: 300d 0d0a 436f 6e74 656e 742d 5479 7065 0...Content-Type 00000020: 3a20 6d75 6c74 6970 6172 742f 616c 7465 : multipart/alte 00000030: 726e 6174 6976 653b 0d0d 0a20 626f 756e rnative;... boun 00000040: 6461 7279 3d22 626f 756e 6422 0d0d 0a0d dary="bound".... 00000050: 0d0a 6d69 6d65 2068 6561 6465 720d 0d0a ..mime header... 00000060: 0d0d 0a2d 2d62 6f75 6e64 0d0d 0a43 6f6e ...--bound...Con ``` See: ``` 30 0d 0d 0a 43 6f 0 CR CR LF C o ```
quentin added the
cat
compat
label 2023-07-23 17:30:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/eml-codec#4
No description provided.