From 6da7920ab66bb95feb17535d9b2f76cf5da45cd1 Mon Sep 17 00:00:00 2001 From: Maurus Decimus <11444311+mdecimus@users.noreply.github.com> Date: Sun, 21 Jun 2026 09:07:56 +0200 Subject: [PATCH] Leniently decode quoted-printable bodies with invalid `=` escapes (closes #144) --- CHANGELOG.md | 1 + examples/repro144.rs | 28 - resources/eml/malformed/018.crlf.json | 4 +- resources/eml/malformed/018.json | 4 +- resources/eml/malformed/020.crlf.json | 291 +++++++++ resources/eml/malformed/020.eml | 41 ++ resources/eml/malformed/020.json | 291 +++++++++ resources/eml/malformed/021.crlf.json | 291 +++++++++ resources/eml/malformed/021.eml | 40 ++ resources/eml/malformed/021.json | 291 +++++++++ resources/eml/thirdparty/016.crlf.json | 489 +++++++++++++++ resources/eml/thirdparty/016.eml | 42 ++ resources/eml/thirdparty/016.json | 489 +++++++++++++++ resources/eml/thirdparty/017.crlf.json | 563 +++++++++++++++++ resources/eml/thirdparty/017.eml | 56 ++ resources/eml/thirdparty/017.json | 563 +++++++++++++++++ resources/eml/thirdparty/018.crlf.json | 737 ++++++++++++++++++++++ resources/eml/thirdparty/018.eml | 59 ++ resources/eml/thirdparty/018.json | 737 ++++++++++++++++++++++ resources/eml/thirdparty/019.crlf.json | 811 +++++++++++++++++++++++++ resources/eml/thirdparty/019.eml | 73 +++ resources/eml/thirdparty/019.json | 811 +++++++++++++++++++++++++ src/decoders/quoted_printable.rs | 17 +- src/parsers/message.rs | 1 - 24 files changed, 6693 insertions(+), 37 deletions(-) delete mode 100644 examples/repro144.rs create mode 100644 resources/eml/malformed/020.crlf.json create mode 100644 resources/eml/malformed/020.eml create mode 100644 resources/eml/malformed/020.json create mode 100644 resources/eml/malformed/021.crlf.json create mode 100644 resources/eml/malformed/021.eml create mode 100644 resources/eml/malformed/021.json create mode 100644 resources/eml/thirdparty/016.crlf.json create mode 100644 resources/eml/thirdparty/016.eml create mode 100644 resources/eml/thirdparty/016.json create mode 100644 resources/eml/thirdparty/017.crlf.json create mode 100644 resources/eml/thirdparty/017.eml create mode 100644 resources/eml/thirdparty/017.json create mode 100644 resources/eml/thirdparty/018.crlf.json create mode 100644 resources/eml/thirdparty/018.eml create mode 100644 resources/eml/thirdparty/018.json create mode 100644 resources/eml/thirdparty/019.crlf.json create mode 100644 resources/eml/thirdparty/019.eml create mode 100644 resources/eml/thirdparty/019.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c007c1..814f33f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ mail-parser 0.11.4 - Add `Message::received_all()` to iterate over all Received header fields (#146) - Reject dates with invalid month names. - `parse_date()` doesn't handle UTC+12 and greater (#148) +- Leniently decode quoted-printable bodies with invalid `=` escapes (#144) mail-parser 0.11.3 ================================ diff --git a/examples/repro144.rs b/examples/repro144.rs deleted file mode 100644 index 61c0aef..0000000 --- a/examples/repro144.rs +++ /dev/null @@ -1,28 +0,0 @@ -use mail_parser::{MessageParser, PartType}; -use std::fs; - -fn main() { - let dir = "/tmp/tbtest"; - for entry in fs::read_dir(dir).unwrap() { - let path = entry.unwrap().path(); - if path.extension().map_or(true, |e| e != "eml") { continue; } - let raw = fs::read(&path).unwrap(); - let msg = MessageParser::default().parse(&raw).unwrap(); - println!("\n=== {} ===", path.file_name().unwrap().to_string_lossy()); - println!("text_body={:?} html_body={:?} attachments={:?}", msg.text_body, msg.html_body, msg.attachments); - for (i, p) in msg.parts.iter().enumerate() { - let kind = match &p.body { - PartType::Text(t) => format!("Text({} bytes, starts {:?})", t.len(), &t.chars().take(40).collect::()), - PartType::Html(t) => format!("Html({} bytes)", t.len()), - PartType::Binary(_) => "Binary".into(), - PartType::InlineBinary(_) => "InlineBinary".into(), - PartType::Message(_) => "Message".into(), - PartType::Multipart(ids) => format!("Multipart{:?}", ids), - }; - let ct = p.headers.iter().find(|h| matches!(h.name, mail_parser::HeaderName::ContentType)) - .and_then(|h| h.value.as_content_type()) - .map(|c| format!("{}/{}", c.ctype(), c.subtype().unwrap_or(""))); - println!(" [{}] ct={:?} -> {}", i, ct, kind); - } - } -} diff --git a/resources/eml/malformed/018.crlf.json b/resources/eml/malformed/018.crlf.json index 10099ad..bb890a2 100644 --- a/resources/eml/malformed/018.crlf.json +++ b/resources/eml/malformed/018.crlf.json @@ -46,9 +46,9 @@ "offset_end": 116 } ], - "is_encoding_problem": true, + "is_encoding_problem": false, "body": { - "Text": "Best\r\nEnviado desde mi BlackBerry=AE de Vodafone=\r\n\r\n\r\n\r\n\r\n\r\n" + "Text": "Best\r\nEnviado desde mi BlackBerry® de Vodafone\r\n\r\n\r\n\r\n\r\n" }, "offset_header": 0, "offset_body": 118, diff --git a/resources/eml/malformed/018.json b/resources/eml/malformed/018.json index c9d1ae1..8df537a 100644 --- a/resources/eml/malformed/018.json +++ b/resources/eml/malformed/018.json @@ -46,9 +46,9 @@ "offset_end": 112 } ], - "is_encoding_problem": true, + "is_encoding_problem": false, "body": { - "Text": "Best\nEnviado desde mi BlackBerry=AE de Vodafone=\n\n\n\n\n\n" + "Text": "Best\nEnviado desde mi BlackBerry® de Vodafone\n\n\n\n\n" }, "offset_header": 0, "offset_body": 113, diff --git a/resources/eml/malformed/020.crlf.json b/resources/eml/malformed/020.crlf.json new file mode 100644 index 0000000..cc06954 --- /dev/null +++ b/resources/eml/malformed/020.crlf.json @@ -0,0 +1,291 @@ +{ + "html_body": [ + 1 + ], + "text_body": [ + 1 + ], + "attachments": [ + 2 + ], + "parts": [ + { + "headers": [ + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": "test", + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 5, + "offset_end": 31 + }, + { + "name": "subject", + "value": { + "Text": "test multipart, related first, with image" + }, + "offset_field": 31, + "offset_start": 39, + "offset_end": 83 + }, + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": "test2", + "address": "test2@example.com" + } + ] + } + }, + "offset_field": 83, + "offset_start": 86, + "offset_end": 114 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2016, + "month": 2, + "day": 27, + "hour": 17, + "minute": 11, + "second": 45, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 114, + "offset_start": 119, + "offset_end": 153 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 153, + "offset_start": 166, + "offset_end": 172 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------related" + } + ] + } + }, + "offset_field": 172, + "offset_start": 185, + "offset_end": 239 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 2 + ] + }, + "offset_header": 0, + "offset_body": 241, + "offset_end": 1036 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + { + "name": "boundary", + "value": "------------alternative" + } + ] + } + }, + "offset_field": 264, + "offset_start": 277, + "offset_end": 339 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + { + "name": "charset", + "value": "UTF-8" + }, + { + "name": "format", + "value": "flowed" + } + ] + } + }, + "offset_field": 339, + "offset_start": 352, + "offset_end": 395 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "8bit" + }, + "offset_field": 395, + "offset_start": 421, + "offset_end": 428 + } + ], + "is_encoding_problem": false, + "body": { + "Text": "Plain Text\r\n\r\n--------------alternative\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Transfer-Encoding: 8bit\r\n\r\n\r\n \r\n \r\n \r\n \r\n HTML Body
\r\n \"\"
\r\n \r\n\r\n\r\n--------------alternative\r\n" + }, + "offset_header": 264, + "offset_body": 430, + "offset_end": 797 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": null + } + }, + "offset_field": 822, + "offset_start": 835, + "offset_end": 847 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 847, + "offset_start": 873, + "offset_end": 882 + }, + { + "name": "content_id", + "value": { + "Text": "part1" + }, + "offset_field": 882, + "offset_start": 893, + "offset_end": 903 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 6, + 0, + 0, + 0, + 11, + 8, + 2, + 0, + 0, + 0, + 211, + 48, + 107, + 193, + 0, + 0, + 0, + 17, + 73, + 68, + 65, + 84, + 8, + 153, + 99, + 224, + 178, + 46, + 67, + 67, + 12, + 67, + 90, + 8, + 0, + 148, + 33, + 48, + 55, + 230, + 6, + 126, + 38, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 822, + "offset_body": 905, + "offset_end": 1009 + } + ] +} \ No newline at end of file diff --git a/resources/eml/malformed/020.eml b/resources/eml/malformed/020.eml new file mode 100644 index 0000000..5e965f3 --- /dev/null +++ b/resources/eml/malformed/020.eml @@ -0,0 +1,41 @@ +From: test +Subject: test multipart, related first, with image +To: test2 +Date: Sat, 27 Feb 2016 17:11:45 +0100 +MIME-Version: 1.0 +Content-Type: multipart/related; + boundary="------------related" + +--------------related +Content-Type: multipart/alternative; + boundary="------------alternative" +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 8bit + +Plain Text + +--------------alternative +Content-Type: text/html; charset=UTF-8 +Content-Transfer-Encoding: 8bit + + + + + + + HTML Body
+
+ + + +--------------alternative + +--------------related +Content-Type: image/png +Content-Transfer-Encoding: base64 +Content-ID: + +iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAIAAADTMGvBAAAAEUlEQVQImWPgsi5DQwxDWggA +lCEwN+YGfiYAAAAASUVORK5CYII= + +--------------related-- diff --git a/resources/eml/malformed/020.json b/resources/eml/malformed/020.json new file mode 100644 index 0000000..b241c7b --- /dev/null +++ b/resources/eml/malformed/020.json @@ -0,0 +1,291 @@ +{ + "html_body": [ + 1 + ], + "text_body": [ + 1 + ], + "attachments": [ + 2 + ], + "parts": [ + { + "headers": [ + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": "test", + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 5, + "offset_end": 30 + }, + { + "name": "subject", + "value": { + "Text": "test multipart, related first, with image" + }, + "offset_field": 30, + "offset_start": 38, + "offset_end": 81 + }, + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": "test2", + "address": "test2@example.com" + } + ] + } + }, + "offset_field": 81, + "offset_start": 84, + "offset_end": 111 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2016, + "month": 2, + "day": 27, + "hour": 17, + "minute": 11, + "second": 45, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 111, + "offset_start": 116, + "offset_end": 149 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 149, + "offset_start": 162, + "offset_end": 167 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------related" + } + ] + } + }, + "offset_field": 167, + "offset_start": 180, + "offset_end": 232 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 2 + ] + }, + "offset_header": 0, + "offset_body": 233, + "offset_end": 995 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + { + "name": "boundary", + "value": "------------alternative" + } + ] + } + }, + "offset_field": 255, + "offset_start": 268, + "offset_end": 328 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + { + "name": "charset", + "value": "UTF-8" + }, + { + "name": "format", + "value": "flowed" + } + ] + } + }, + "offset_field": 328, + "offset_start": 341, + "offset_end": 383 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "8bit" + }, + "offset_field": 383, + "offset_start": 409, + "offset_end": 415 + } + ], + "is_encoding_problem": false, + "body": { + "Text": "Plain Text\n\n--------------alternative\nContent-Type: text/html; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\n\n \n \n \n \n HTML Body
\n \"\"
\n \n\n\n--------------alternative\n" + }, + "offset_header": 255, + "offset_body": 416, + "offset_end": 766 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": null + } + }, + "offset_field": 789, + "offset_start": 802, + "offset_end": 813 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 813, + "offset_start": 839, + "offset_end": 847 + }, + { + "name": "content_id", + "value": { + "Text": "part1" + }, + "offset_field": 847, + "offset_start": 858, + "offset_end": 867 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 6, + 0, + 0, + 0, + 11, + 8, + 2, + 0, + 0, + 0, + 211, + 48, + 107, + 193, + 0, + 0, + 0, + 17, + 73, + 68, + 65, + 84, + 8, + 153, + 99, + 224, + 178, + 46, + 67, + 67, + 12, + 67, + 90, + 8, + 0, + 148, + 33, + 48, + 55, + 230, + 6, + 126, + 38, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 789, + "offset_body": 868, + "offset_end": 970 + } + ] +} \ No newline at end of file diff --git a/resources/eml/malformed/021.crlf.json b/resources/eml/malformed/021.crlf.json new file mode 100644 index 0000000..333845d --- /dev/null +++ b/resources/eml/malformed/021.crlf.json @@ -0,0 +1,291 @@ +{ + "html_body": [ + 1 + ], + "text_body": [ + 1 + ], + "attachments": [ + 2 + ], + "parts": [ + { + "headers": [ + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": "test", + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 5, + "offset_end": 31 + }, + { + "name": "subject", + "value": { + "Text": "test multipart, related first" + }, + "offset_field": 31, + "offset_start": 39, + "offset_end": 71 + }, + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": "test2", + "address": "test2@example.com" + } + ] + } + }, + "offset_field": 71, + "offset_start": 74, + "offset_end": 102 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2016, + "month": 2, + "day": 27, + "hour": 17, + "minute": 11, + "second": 45, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 102, + "offset_start": 107, + "offset_end": 141 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 141, + "offset_start": 154, + "offset_end": 160 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------related" + } + ] + } + }, + "offset_field": 160, + "offset_start": 173, + "offset_end": 227 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 2 + ] + }, + "offset_header": 0, + "offset_body": 229, + "offset_end": 1078 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + { + "name": "boundary", + "value": "------------alternative" + } + ] + } + }, + "offset_field": 252, + "offset_start": 265, + "offset_end": 327 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + { + "name": "charset", + "value": "UTF-8" + }, + { + "name": "format", + "value": "flowed" + } + ] + } + }, + "offset_field": 327, + "offset_start": 340, + "offset_end": 383 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "8bit" + }, + "offset_field": 383, + "offset_start": 409, + "offset_end": 416 + } + ], + "is_encoding_problem": false, + "body": { + "Text": "áóúäöüß\r\n\r\n--------------alternative\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Transfer-Encoding: 8bit\r\n\r\n \r\n \r\n \r\n \r\n \r\n áóúäöüß
\r\n \"\"
\r\n \r\n\r\n--------------alternative\r\n" + }, + "offset_header": 252, + "offset_body": 418, + "offset_end": 839 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": null + } + }, + "offset_field": 864, + "offset_start": 877, + "offset_end": 889 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 889, + "offset_start": 915, + "offset_end": 924 + }, + { + "name": "content_id", + "value": { + "Text": "part1" + }, + "offset_field": 924, + "offset_start": 935, + "offset_end": 945 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 6, + 0, + 0, + 0, + 11, + 8, + 2, + 0, + 0, + 0, + 211, + 48, + 107, + 193, + 0, + 0, + 0, + 17, + 73, + 68, + 65, + 84, + 8, + 153, + 99, + 224, + 178, + 46, + 67, + 67, + 12, + 67, + 90, + 8, + 0, + 148, + 33, + 48, + 55, + 230, + 6, + 126, + 38, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 864, + "offset_body": 947, + "offset_end": 1051 + } + ] +} \ No newline at end of file diff --git a/resources/eml/malformed/021.eml b/resources/eml/malformed/021.eml new file mode 100644 index 0000000..3b43154 --- /dev/null +++ b/resources/eml/malformed/021.eml @@ -0,0 +1,40 @@ +From: test +Subject: test multipart, related first +To: test2 +Date: Sat, 27 Feb 2016 17:11:45 +0100 +MIME-Version: 1.0 +Content-Type: multipart/related; + boundary="------------related" + +--------------related +Content-Type: multipart/alternative; + boundary="------------alternative" +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 8bit + +áóúäöüß + +--------------alternative +Content-Type: text/html; charset=UTF-8 +Content-Transfer-Encoding: 8bit + + + + + + + áóúäöüß
+
+ + +--------------alternative + +--------------related +Content-Type: image/png +Content-Transfer-Encoding: base64 +Content-ID: + +iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAIAAADTMGvBAAAAEUlEQVQImWPgsi5DQwxDWggA +lCEwN+YGfiYAAAAASUVORK5CYII= + +--------------related-- diff --git a/resources/eml/malformed/021.json b/resources/eml/malformed/021.json new file mode 100644 index 0000000..108b017 --- /dev/null +++ b/resources/eml/malformed/021.json @@ -0,0 +1,291 @@ +{ + "html_body": [ + 1 + ], + "text_body": [ + 1 + ], + "attachments": [ + 2 + ], + "parts": [ + { + "headers": [ + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": "test", + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 5, + "offset_end": 30 + }, + { + "name": "subject", + "value": { + "Text": "test multipart, related first" + }, + "offset_field": 30, + "offset_start": 38, + "offset_end": 69 + }, + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": "test2", + "address": "test2@example.com" + } + ] + } + }, + "offset_field": 69, + "offset_start": 72, + "offset_end": 99 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2016, + "month": 2, + "day": 27, + "hour": 17, + "minute": 11, + "second": 45, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 99, + "offset_start": 104, + "offset_end": 137 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 137, + "offset_start": 150, + "offset_end": 155 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------related" + } + ] + } + }, + "offset_field": 155, + "offset_start": 168, + "offset_end": 220 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 2 + ] + }, + "offset_header": 0, + "offset_body": 221, + "offset_end": 1038 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + { + "name": "boundary", + "value": "------------alternative" + } + ] + } + }, + "offset_field": 243, + "offset_start": 256, + "offset_end": 316 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + { + "name": "charset", + "value": "UTF-8" + }, + { + "name": "format", + "value": "flowed" + } + ] + } + }, + "offset_field": 316, + "offset_start": 329, + "offset_end": 371 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "8bit" + }, + "offset_field": 371, + "offset_start": 397, + "offset_end": 403 + } + ], + "is_encoding_problem": false, + "body": { + "Text": "áóúäöüß\n\n--------------alternative\nContent-Type: text/html; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\n \n \n \n \n \n áóúäöüß
\n \"\"
\n \n\n--------------alternative\n" + }, + "offset_header": 243, + "offset_body": 404, + "offset_end": 809 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": null + } + }, + "offset_field": 832, + "offset_start": 845, + "offset_end": 856 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 856, + "offset_start": 882, + "offset_end": 890 + }, + { + "name": "content_id", + "value": { + "Text": "part1" + }, + "offset_field": 890, + "offset_start": 901, + "offset_end": 910 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 6, + 0, + 0, + 0, + 11, + 8, + 2, + 0, + 0, + 0, + 211, + 48, + 107, + 193, + 0, + 0, + 0, + 17, + 73, + 68, + 65, + 84, + 8, + 153, + 99, + 224, + 178, + 46, + 67, + 67, + 12, + 67, + 90, + 8, + 0, + 148, + 33, + 48, + 55, + 230, + 6, + 126, + 38, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 832, + "offset_body": 911, + "offset_end": 1013 + } + ] +} \ No newline at end of file diff --git a/resources/eml/thirdparty/016.crlf.json b/resources/eml/thirdparty/016.crlf.json new file mode 100644 index 0000000..c6f5384 --- /dev/null +++ b/resources/eml/thirdparty/016.crlf.json @@ -0,0 +1,489 @@ +{ + "html_body": [ + 1 + ], + "text_body": [ + 1 + ], + "attachments": [ + 2 + ], + "parts": [ + { + "headers": [ + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 3, + "offset_end": 22 + }, + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 22, + "offset_start": 27, + "offset_end": 46 + }, + { + "name": "subject", + "value": { + "Text": "25 HTML + embedded image" + }, + "offset_field": 46, + "offset_start": 54, + "offset_end": 81 + }, + { + "name": "message_id", + "value": { + "Text": "c1ddcd5d-71c1-9c9d-1b81-e3b9abb99030@example.com" + }, + "offset_field": 81, + "offset_start": 92, + "offset_end": 145 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2017, + "month": 12, + "day": 30, + "hour": 19, + "minute": 26, + "second": 23, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 145, + "offset_start": 150, + "offset_end": 184 + }, + { + "name": { + "other": "User-Agent" + }, + "value": { + "Text": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101\r\n Thunderbird/59.0a1" + }, + "offset_field": 184, + "offset_start": 195, + "offset_end": 283 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 283, + "offset_start": 296, + "offset_end": 302 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------B2BBD36A919AB2B2F84E2469" + } + ] + } + }, + "offset_field": 302, + "offset_start": 315, + "offset_end": 386 + }, + { + "name": "content_language", + "value": { + "Text": "en-GB" + }, + "offset_field": 386, + "offset_start": 403, + "offset_end": 411 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 2 + ] + }, + "offset_header": 0, + "offset_body": 413, + "offset_end": 1499 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": [ + { + "name": "charset", + "value": "utf-8" + } + ] + } + }, + "offset_field": 499, + "offset_start": 512, + "offset_end": 541 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 541, + "offset_start": 567, + "offset_end": 586 + } + ], + "is_encoding_problem": false, + "body": { + "Html": "\r\n \r\n\r\n \r\n \r\n \r\n

Search for höhö

\r\n

\"\"

\r\n \r\n\r\n" + }, + "offset_header": 499, + "offset_body": 588, + "offset_end": 873 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 915, + "offset_start": 928, + "offset_end": 971 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 971, + "offset_start": 997, + "offset_end": 1006 + }, + { + "name": "content_id", + "value": { + "Text": "part1.8C5E6A81.D0C1B91A@example.com" + }, + "offset_field": 1006, + "offset_start": 1017, + "offset_end": 1057 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1057, + "offset_start": 1077, + "offset_end": 1121 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 16, + 0, + 0, + 0, + 16, + 8, + 2, + 0, + 0, + 0, + 144, + 145, + 104, + 54, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 105, + 73, + 68, + 65, + 84, + 56, + 79, + 221, + 208, + 59, + 18, + 128, + 32, + 12, + 69, + 209, + 236, + 76, + 62, + 110, + 7, + 113, + 255, + 77, + 124, + 4, + 70, + 50, + 136, + 128, + 173, + 111, + 110, + 197, + 112, + 40, + 160, + 221, + 158, + 200, + 155, + 168, + 10, + 221, + 156, + 77, + 253, + 23, + 16, + 145, + 190, + 154, + 43, + 192, + 227, + 182, + 228, + 76, + 204, + 193, + 0, + 136, + 209, + 175, + 148, + 90, + 96, + 183, + 35, + 157, + 18, + 49, + 115, + 215, + 140, + 64, + 215, + 76, + 0, + 214, + 152, + 57, + 192, + 180, + 89, + 2, + 216, + 109, + 86, + 1, + 38, + 230, + 241, + 173, + 3, + 128, + 225, + 188, + 130, + 218, + 59, + 192, + 62, + 2, + 230, + 11, + 203, + 69, + 57, + 197, + 69, + 41, + 47, + 201, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 915, + "offset_body": 1123, + "offset_end": 1455 + } + ] +} \ No newline at end of file diff --git a/resources/eml/thirdparty/016.eml b/resources/eml/thirdparty/016.eml new file mode 100644 index 0000000..8559e10 --- /dev/null +++ b/resources/eml/thirdparty/016.eml @@ -0,0 +1,42 @@ +To: test@example.com +From: test@example.com +Subject: 25 HTML + embedded image +Message-ID: +Date: Sat, 30 Dec 2017 19:26:23 +0100 +User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 + Thunderbird/59.0a1 +MIME-Version: 1.0 +Content-Type: multipart/related; + boundary="------------B2BBD36A919AB2B2F84E2469" +Content-Language: en-GB + +This is a multi-part message in MIME format. +--------------B2BBD36A919AB2B2F84E2469 +Content-Type: text/html; charset="utf-8" +Content-Transfer-Encoding: quoted-printable + + + + + + + +

Search for h=C3=B6h=C3=B6

+

+ + + +--------------B2BBD36A919AB2B2F84E2469 +Content-Type: image/png; + name="kigaaldcbanejcbi.png" +Content-Transfer-Encoding: base64 +Content-ID: +Content-Disposition: inline; + filename="kigaaldcbanejcbi.png" + +iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1B +AACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAASdEVYdFNvZnR3YXJlAEdyZWVuc2hv +dF5VCAUAAABpSURBVDhP3dA7EoAgDEXR7Ew+bgdx/018BEYyiICtb27FcCig3Z7Im6gK3ZxN +/RcQkb6aK8DjtuRMzMEAiNGvlFpgtyOdEjFz14xA10wA1pg5wLRZAthtVgEm5vGtA4DhvILa +O8A+AuYLy0U5xUUpL8kAAAAASUVORK5CYII= +--------------B2BBD36A919AB2B2F84E2469-- diff --git a/resources/eml/thirdparty/016.json b/resources/eml/thirdparty/016.json new file mode 100644 index 0000000..f22b700 --- /dev/null +++ b/resources/eml/thirdparty/016.json @@ -0,0 +1,489 @@ +{ + "html_body": [ + 1 + ], + "text_body": [ + 1 + ], + "attachments": [ + 2 + ], + "parts": [ + { + "headers": [ + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 3, + "offset_end": 21 + }, + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 21, + "offset_start": 26, + "offset_end": 44 + }, + { + "name": "subject", + "value": { + "Text": "25 HTML + embedded image" + }, + "offset_field": 44, + "offset_start": 52, + "offset_end": 78 + }, + { + "name": "message_id", + "value": { + "Text": "c1ddcd5d-71c1-9c9d-1b81-e3b9abb99030@example.com" + }, + "offset_field": 78, + "offset_start": 89, + "offset_end": 141 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2017, + "month": 12, + "day": 30, + "hour": 19, + "minute": 26, + "second": 23, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 141, + "offset_start": 146, + "offset_end": 179 + }, + { + "name": { + "other": "User-Agent" + }, + "value": { + "Text": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101\n Thunderbird/59.0a1" + }, + "offset_field": 179, + "offset_start": 190, + "offset_end": 276 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 276, + "offset_start": 289, + "offset_end": 294 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------B2BBD36A919AB2B2F84E2469" + } + ] + } + }, + "offset_field": 294, + "offset_start": 307, + "offset_end": 376 + }, + { + "name": "content_language", + "value": { + "Text": "en-GB" + }, + "offset_field": 376, + "offset_start": 393, + "offset_end": 400 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 2 + ] + }, + "offset_header": 0, + "offset_body": 401, + "offset_end": 1457 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": [ + { + "name": "charset", + "value": "utf-8" + } + ] + } + }, + "offset_field": 485, + "offset_start": 498, + "offset_end": 526 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 526, + "offset_start": 552, + "offset_end": 570 + } + ], + "is_encoding_problem": false, + "body": { + "Html": "\n \n\n \n \n \n

Search for höhö

\n

\"\"

\n \n\n" + }, + "offset_header": 485, + "offset_body": 571, + "offset_end": 846 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 886, + "offset_start": 899, + "offset_end": 940 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 940, + "offset_start": 966, + "offset_end": 974 + }, + { + "name": "content_id", + "value": { + "Text": "part1.8C5E6A81.D0C1B91A@example.com" + }, + "offset_field": 974, + "offset_start": 985, + "offset_end": 1024 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1024, + "offset_start": 1044, + "offset_end": 1086 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 16, + 0, + 0, + 0, + 16, + 8, + 2, + 0, + 0, + 0, + 144, + 145, + 104, + 54, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 105, + 73, + 68, + 65, + 84, + 56, + 79, + 221, + 208, + 59, + 18, + 128, + 32, + 12, + 69, + 209, + 236, + 76, + 62, + 110, + 7, + 113, + 255, + 77, + 124, + 4, + 70, + 50, + 136, + 128, + 173, + 111, + 110, + 197, + 112, + 40, + 160, + 221, + 158, + 200, + 155, + 168, + 10, + 221, + 156, + 77, + 253, + 23, + 16, + 145, + 190, + 154, + 43, + 192, + 227, + 182, + 228, + 76, + 204, + 193, + 0, + 136, + 209, + 175, + 148, + 90, + 96, + 183, + 35, + 157, + 18, + 49, + 115, + 215, + 140, + 64, + 215, + 76, + 0, + 214, + 152, + 57, + 192, + 180, + 89, + 2, + 216, + 109, + 86, + 1, + 38, + 230, + 241, + 173, + 3, + 128, + 225, + 188, + 130, + 218, + 59, + 192, + 62, + 2, + 230, + 11, + 203, + 69, + 57, + 197, + 69, + 41, + 47, + 201, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 886, + "offset_body": 1087, + "offset_end": 1415 + } + ] +} \ No newline at end of file diff --git a/resources/eml/thirdparty/017.crlf.json b/resources/eml/thirdparty/017.crlf.json new file mode 100644 index 0000000..6ae9307 --- /dev/null +++ b/resources/eml/thirdparty/017.crlf.json @@ -0,0 +1,563 @@ +{ + "html_body": [ + 3 + ], + "text_body": [ + 1 + ], + "attachments": [ + 4 + ], + "parts": [ + { + "headers": [ + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 3, + "offset_end": 22 + }, + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 22, + "offset_start": 27, + "offset_end": 46 + }, + { + "name": "subject", + "value": { + "Text": "27 plaintext + (HTML + embedded image)" + }, + "offset_field": 46, + "offset_start": 54, + "offset_end": 95 + }, + { + "name": "message_id", + "value": { + "Text": "fd7a5d4a-6a3a-8b9b-b3e4-9e9391c3c703@example.com" + }, + "offset_field": 95, + "offset_start": 106, + "offset_end": 159 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2017, + "month": 12, + "day": 30, + "hour": 19, + "minute": 36, + "second": 0, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 159, + "offset_start": 164, + "offset_end": 198 + }, + { + "name": { + "other": "User-Agent" + }, + "value": { + "Text": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101\r\n Thunderbird/59.0a1" + }, + "offset_field": 198, + "offset_start": 209, + "offset_end": 297 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 297, + "offset_start": 310, + "offset_end": 316 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + { + "name": "boundary", + "value": "------------77E82F0826A0A90EABD21FC3" + } + ] + } + }, + "offset_field": 316, + "offset_start": 329, + "offset_end": 404 + }, + { + "name": "content_language", + "value": { + "Text": "en-GB" + }, + "offset_field": 404, + "offset_start": 421, + "offset_end": 429 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 2 + ] + }, + "offset_header": 0, + "offset_body": 431, + "offset_end": 1865 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + { + "name": "charset", + "value": "utf-8" + }, + { + "name": "format", + "value": "flowed" + } + ] + } + }, + "offset_field": 517, + "offset_start": 530, + "offset_end": 575 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 575, + "offset_start": 601, + "offset_end": 620 + } + ], + "is_encoding_problem": false, + "body": { + "Text": "Search for hähä\r\n\r\n" + }, + "offset_header": 517, + "offset_body": 622, + "offset_end": 651 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------D719681335F2A7D71D3761B1" + } + ] + } + }, + "offset_field": 693, + "offset_start": 706, + "offset_end": 777 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 3, + 4 + ] + }, + "offset_header": 693, + "offset_body": 779, + "offset_end": 1821 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": [ + { + "name": "charset", + "value": "utf-8" + } + ] + } + }, + "offset_field": 821, + "offset_start": 834, + "offset_end": 863 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 863, + "offset_start": 889, + "offset_end": 908 + } + ], + "is_encoding_problem": false, + "body": { + "Html": "\r\n \r\n\r\n \r\n \r\n \r\n

Search for höhö

\r\n

\"\"

\r\n \r\n\r\n" + }, + "offset_header": 821, + "offset_body": 910, + "offset_end": 1195 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1237, + "offset_start": 1250, + "offset_end": 1293 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 1293, + "offset_start": 1319, + "offset_end": 1328 + }, + { + "name": "content_id", + "value": { + "Text": "part1.8C5E6A81.D0C1B91A@example.com" + }, + "offset_field": 1328, + "offset_start": 1339, + "offset_end": 1379 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1379, + "offset_start": 1399, + "offset_end": 1443 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 16, + 0, + 0, + 0, + 16, + 8, + 2, + 0, + 0, + 0, + 144, + 145, + 104, + 54, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 105, + 73, + 68, + 65, + 84, + 56, + 79, + 221, + 208, + 59, + 18, + 128, + 32, + 12, + 69, + 209, + 236, + 76, + 62, + 110, + 7, + 113, + 255, + 77, + 124, + 4, + 70, + 50, + 136, + 128, + 173, + 111, + 110, + 197, + 112, + 40, + 160, + 221, + 158, + 200, + 155, + 168, + 10, + 221, + 156, + 77, + 253, + 23, + 16, + 145, + 190, + 154, + 43, + 192, + 227, + 182, + 228, + 76, + 204, + 193, + 0, + 136, + 209, + 175, + 148, + 90, + 96, + 183, + 35, + 157, + 18, + 49, + 115, + 215, + 140, + 64, + 215, + 76, + 0, + 214, + 152, + 57, + 192, + 180, + 89, + 2, + 216, + 109, + 86, + 1, + 38, + 230, + 241, + 173, + 3, + 128, + 225, + 188, + 130, + 218, + 59, + 192, + 62, + 2, + 230, + 11, + 203, + 69, + 57, + 197, + 69, + 41, + 47, + 201, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1237, + "offset_body": 1445, + "offset_end": 1777 + } + ] +} \ No newline at end of file diff --git a/resources/eml/thirdparty/017.eml b/resources/eml/thirdparty/017.eml new file mode 100644 index 0000000..b2945ae --- /dev/null +++ b/resources/eml/thirdparty/017.eml @@ -0,0 +1,56 @@ +To: test@example.com +From: test@example.com +Subject: 27 plaintext + (HTML + embedded image) +Message-ID: +Date: Sat, 30 Dec 2017 19:36:00 +0100 +User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 + Thunderbird/59.0a1 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="------------77E82F0826A0A90EABD21FC3" +Content-Language: en-GB + +This is a multi-part message in MIME format. +--------------77E82F0826A0A90EABD21FC3 +Content-Type: text/plain; charset="utf-8"; format=flowed +Content-Transfer-Encoding: quoted-printable + +Search for h=C3=A4h=C3=A4 + + +--------------77E82F0826A0A90EABD21FC3 +Content-Type: multipart/related; + boundary="------------D719681335F2A7D71D3761B1" + + +--------------D719681335F2A7D71D3761B1 +Content-Type: text/html; charset="utf-8" +Content-Transfer-Encoding: quoted-printable + + + + + + + +

Search for h=C3=B6h=C3=B6

+

+ + + +--------------D719681335F2A7D71D3761B1 +Content-Type: image/png; + name="kigaaldcbanejcbi.png" +Content-Transfer-Encoding: base64 +Content-ID: +Content-Disposition: inline; + filename="kigaaldcbanejcbi.png" + +iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1B +AACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAASdEVYdFNvZnR3YXJlAEdyZWVuc2hv +dF5VCAUAAABpSURBVDhP3dA7EoAgDEXR7Ew+bgdx/018BEYyiICtb27FcCig3Z7Im6gK3ZxN +/RcQkb6aK8DjtuRMzMEAiNGvlFpgtyOdEjFz14xA10wA1pg5wLRZAthtVgEm5vGtA4DhvILa +O8A+AuYLy0U5xUUpL8kAAAAASUVORK5CYII= +--------------D719681335F2A7D71D3761B1-- + +--------------77E82F0826A0A90EABD21FC3-- diff --git a/resources/eml/thirdparty/017.json b/resources/eml/thirdparty/017.json new file mode 100644 index 0000000..2fb3b59 --- /dev/null +++ b/resources/eml/thirdparty/017.json @@ -0,0 +1,563 @@ +{ + "html_body": [ + 3 + ], + "text_body": [ + 1 + ], + "attachments": [ + 4 + ], + "parts": [ + { + "headers": [ + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 3, + "offset_end": 21 + }, + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 21, + "offset_start": 26, + "offset_end": 44 + }, + { + "name": "subject", + "value": { + "Text": "27 plaintext + (HTML + embedded image)" + }, + "offset_field": 44, + "offset_start": 52, + "offset_end": 92 + }, + { + "name": "message_id", + "value": { + "Text": "fd7a5d4a-6a3a-8b9b-b3e4-9e9391c3c703@example.com" + }, + "offset_field": 92, + "offset_start": 103, + "offset_end": 155 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2017, + "month": 12, + "day": 30, + "hour": 19, + "minute": 36, + "second": 0, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 155, + "offset_start": 160, + "offset_end": 193 + }, + { + "name": { + "other": "User-Agent" + }, + "value": { + "Text": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101\n Thunderbird/59.0a1" + }, + "offset_field": 193, + "offset_start": 204, + "offset_end": 290 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 290, + "offset_start": 303, + "offset_end": 308 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + { + "name": "boundary", + "value": "------------77E82F0826A0A90EABD21FC3" + } + ] + } + }, + "offset_field": 308, + "offset_start": 321, + "offset_end": 394 + }, + { + "name": "content_language", + "value": { + "Text": "en-GB" + }, + "offset_field": 394, + "offset_start": 411, + "offset_end": 418 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 2 + ] + }, + "offset_header": 0, + "offset_body": 419, + "offset_end": 1809 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + { + "name": "charset", + "value": "utf-8" + }, + { + "name": "format", + "value": "flowed" + } + ] + } + }, + "offset_field": 503, + "offset_start": 516, + "offset_end": 560 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 560, + "offset_start": 586, + "offset_end": 604 + } + ], + "is_encoding_problem": false, + "body": { + "Text": "Search for hähä\n\n" + }, + "offset_header": 503, + "offset_body": 605, + "offset_end": 632 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------D719681335F2A7D71D3761B1" + } + ] + } + }, + "offset_field": 672, + "offset_start": 685, + "offset_end": 754 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 3, + 4 + ] + }, + "offset_header": 672, + "offset_body": 755, + "offset_end": 1767 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": [ + { + "name": "charset", + "value": "utf-8" + } + ] + } + }, + "offset_field": 795, + "offset_start": 808, + "offset_end": 836 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 836, + "offset_start": 862, + "offset_end": 880 + } + ], + "is_encoding_problem": false, + "body": { + "Html": "\n \n\n \n \n \n

Search for höhö

\n

\"\"

\n \n\n" + }, + "offset_header": 795, + "offset_body": 881, + "offset_end": 1156 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1196, + "offset_start": 1209, + "offset_end": 1250 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 1250, + "offset_start": 1276, + "offset_end": 1284 + }, + { + "name": "content_id", + "value": { + "Text": "part1.8C5E6A81.D0C1B91A@example.com" + }, + "offset_field": 1284, + "offset_start": 1295, + "offset_end": 1334 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1334, + "offset_start": 1354, + "offset_end": 1396 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 16, + 0, + 0, + 0, + 16, + 8, + 2, + 0, + 0, + 0, + 144, + 145, + 104, + 54, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 105, + 73, + 68, + 65, + 84, + 56, + 79, + 221, + 208, + 59, + 18, + 128, + 32, + 12, + 69, + 209, + 236, + 76, + 62, + 110, + 7, + 113, + 255, + 77, + 124, + 4, + 70, + 50, + 136, + 128, + 173, + 111, + 110, + 197, + 112, + 40, + 160, + 221, + 158, + 200, + 155, + 168, + 10, + 221, + 156, + 77, + 253, + 23, + 16, + 145, + 190, + 154, + 43, + 192, + 227, + 182, + 228, + 76, + 204, + 193, + 0, + 136, + 209, + 175, + 148, + 90, + 96, + 183, + 35, + 157, + 18, + 49, + 115, + 215, + 140, + 64, + 215, + 76, + 0, + 214, + 152, + 57, + 192, + 180, + 89, + 2, + 216, + 109, + 86, + 1, + 38, + 230, + 241, + 173, + 3, + 128, + 225, + 188, + 130, + 218, + 59, + 192, + 62, + 2, + 230, + 11, + 203, + 69, + 57, + 197, + 69, + 41, + 47, + 201, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1196, + "offset_body": 1397, + "offset_end": 1725 + } + ] +} \ No newline at end of file diff --git a/resources/eml/thirdparty/018.crlf.json b/resources/eml/thirdparty/018.crlf.json new file mode 100644 index 0000000..4cbf437 --- /dev/null +++ b/resources/eml/thirdparty/018.crlf.json @@ -0,0 +1,737 @@ +{ + "html_body": [ + 2 + ], + "text_body": [ + 2 + ], + "attachments": [ + 3, + 4 + ], + "parts": [ + { + "headers": [ + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 3, + "offset_end": 22 + }, + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 22, + "offset_start": 27, + "offset_end": 46 + }, + { + "name": "subject", + "value": { + "Text": "29 (HTML + embedded image) + attachment" + }, + "offset_field": 46, + "offset_start": 54, + "offset_end": 96 + }, + { + "name": "message_id", + "value": { + "Text": "cdf5bf44-03a4-4be1-c9c7-88cb4a5838ed@example.com" + }, + "offset_field": 96, + "offset_start": 107, + "offset_end": 160 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2017, + "month": 12, + "day": 30, + "hour": 20, + "minute": 19, + "second": 46, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 160, + "offset_start": 165, + "offset_end": 199 + }, + { + "name": { + "other": "User-Agent" + }, + "value": { + "Text": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101\r\n Thunderbird/59.0a1" + }, + "offset_field": 199, + "offset_start": 210, + "offset_end": 298 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 298, + "offset_start": 311, + "offset_end": 317 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + { + "name": "boundary", + "value": "------------F5CEBCED9FC06ACB07B3D485" + } + ] + } + }, + "offset_field": 317, + "offset_start": 330, + "offset_end": 399 + }, + { + "name": "content_language", + "value": { + "Text": "en-GB" + }, + "offset_field": 399, + "offset_start": 416, + "offset_end": 424 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 4 + ] + }, + "offset_header": 0, + "offset_body": 426, + "offset_end": 2085 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------1722706F2C203820A6CAA06F" + } + ] + } + }, + "offset_field": 512, + "offset_start": 525, + "offset_end": 596 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 2, + 3 + ] + }, + "offset_header": 512, + "offset_body": 598, + "offset_end": 1640 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": [ + { + "name": "charset", + "value": "utf-8" + } + ] + } + }, + "offset_field": 640, + "offset_start": 653, + "offset_end": 682 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 682, + "offset_start": 708, + "offset_end": 727 + } + ], + "is_encoding_problem": false, + "body": { + "Html": "\r\n \r\n\r\n \r\n \r\n \r\n

Search for höhö

\r\n

\"\"

\r\n \r\n\r\n" + }, + "offset_header": 640, + "offset_body": 729, + "offset_end": 1014 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1056, + "offset_start": 1069, + "offset_end": 1112 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 1112, + "offset_start": 1138, + "offset_end": 1147 + }, + { + "name": "content_id", + "value": { + "Text": "part1.8C5E6A81.D0C1B91A@example.com" + }, + "offset_field": 1147, + "offset_start": 1158, + "offset_end": 1198 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1198, + "offset_start": 1218, + "offset_end": 1262 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 16, + 0, + 0, + 0, + 16, + 8, + 2, + 0, + 0, + 0, + 144, + 145, + 104, + 54, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 105, + 73, + 68, + 65, + 84, + 56, + 79, + 221, + 208, + 59, + 18, + 128, + 32, + 12, + 69, + 209, + 236, + 76, + 62, + 110, + 7, + 113, + 255, + 77, + 124, + 4, + 70, + 50, + 136, + 128, + 173, + 111, + 110, + 197, + 112, + 40, + 160, + 221, + 158, + 200, + 155, + 168, + 10, + 221, + 156, + 77, + 253, + 23, + 16, + 145, + 190, + 154, + 43, + 192, + 227, + 182, + 228, + 76, + 204, + 193, + 0, + 136, + 209, + 175, + 148, + 90, + 96, + 183, + 35, + 157, + 18, + 49, + 115, + 215, + 140, + 64, + 215, + 76, + 0, + 214, + 152, + 57, + 192, + 180, + 89, + 2, + 216, + 109, + 86, + 1, + 38, + 230, + 241, + 173, + 3, + 128, + 225, + 188, + 130, + 218, + 59, + 192, + 62, + 2, + 230, + 11, + 203, + 69, + 57, + 197, + 69, + 41, + 47, + 201, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1056, + "offset_body": 1264, + "offset_end": 1596 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "attach2.png" + } + ] + } + }, + "offset_field": 1682, + "offset_start": 1695, + "offset_end": 1729 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 1729, + "offset_start": 1755, + "offset_end": 1764 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "attach2.png" + } + ] + } + }, + "offset_field": 1764, + "offset_start": 1784, + "offset_end": 1823 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 14, + 0, + 0, + 0, + 14, + 8, + 2, + 0, + 0, + 0, + 144, + 42, + 186, + 134, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 21, + 73, + 68, + 65, + 84, + 40, + 83, + 99, + 248, + 79, + 52, + 24, + 85, + 58, + 170, + 148, + 104, + 165, + 255, + 255, + 3, + 0, + 211, + 78, + 73, + 211, + 59, + 213, + 209, + 91, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1682, + "offset_body": 1825, + "offset_end": 2041 + } + ] +} \ No newline at end of file diff --git a/resources/eml/thirdparty/018.eml b/resources/eml/thirdparty/018.eml new file mode 100644 index 0000000..07c89fa --- /dev/null +++ b/resources/eml/thirdparty/018.eml @@ -0,0 +1,59 @@ +To: test@example.com +From: test@example.com +Subject: 29 (HTML + embedded image) + attachment +Message-ID: +Date: Sat, 30 Dec 2017 20:19:46 +0100 +User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 + Thunderbird/59.0a1 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------F5CEBCED9FC06ACB07B3D485" +Content-Language: en-GB + +This is a multi-part message in MIME format. +--------------F5CEBCED9FC06ACB07B3D485 +Content-Type: multipart/related; + boundary="------------1722706F2C203820A6CAA06F" + + +--------------1722706F2C203820A6CAA06F +Content-Type: text/html; charset="utf-8" +Content-Transfer-Encoding: quoted-printable + + + + + + + +

Search for h=C3=B6h=C3=B6

+

+ + + +--------------1722706F2C203820A6CAA06F +Content-Type: image/png; + name="kigaaldcbanejcbi.png" +Content-Transfer-Encoding: base64 +Content-ID: +Content-Disposition: inline; + filename="kigaaldcbanejcbi.png" + +iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1B +AACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAASdEVYdFNvZnR3YXJlAEdyZWVuc2hv +dF5VCAUAAABpSURBVDhP3dA7EoAgDEXR7Ew+bgdx/018BEYyiICtb27FcCig3Z7Im6gK3ZxN +/RcQkb6aK8DjtuRMzMEAiNGvlFpgtyOdEjFz14xA10wA1pg5wLRZAthtVgEm5vGtA4DhvILa +O8A+AuYLy0U5xUUpL8kAAAAASUVORK5CYII= +--------------1722706F2C203820A6CAA06F-- + +--------------F5CEBCED9FC06ACB07B3D485 +Content-Type: image/png; + name="attach2.png" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="attach2.png" + +iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAIAAACQKrqGAAAAAXNSR0IArs4c6QAAAARnQU1B +AACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAASdEVYdFNvZnR3YXJlAEdyZWVuc2hv +dF5VCAUAAAAVSURBVChTY/hPNBhVOqqUaKX//wMA005J0zvV0VsAAAAASUVORK5CYII= +--------------F5CEBCED9FC06ACB07B3D485-- diff --git a/resources/eml/thirdparty/018.json b/resources/eml/thirdparty/018.json new file mode 100644 index 0000000..82c439c --- /dev/null +++ b/resources/eml/thirdparty/018.json @@ -0,0 +1,737 @@ +{ + "html_body": [ + 2 + ], + "text_body": [ + 2 + ], + "attachments": [ + 3, + 4 + ], + "parts": [ + { + "headers": [ + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 3, + "offset_end": 21 + }, + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 21, + "offset_start": 26, + "offset_end": 44 + }, + { + "name": "subject", + "value": { + "Text": "29 (HTML + embedded image) + attachment" + }, + "offset_field": 44, + "offset_start": 52, + "offset_end": 93 + }, + { + "name": "message_id", + "value": { + "Text": "cdf5bf44-03a4-4be1-c9c7-88cb4a5838ed@example.com" + }, + "offset_field": 93, + "offset_start": 104, + "offset_end": 156 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2017, + "month": 12, + "day": 30, + "hour": 20, + "minute": 19, + "second": 46, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 156, + "offset_start": 161, + "offset_end": 194 + }, + { + "name": { + "other": "User-Agent" + }, + "value": { + "Text": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101\n Thunderbird/59.0a1" + }, + "offset_field": 194, + "offset_start": 205, + "offset_end": 291 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 291, + "offset_start": 304, + "offset_end": 309 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + { + "name": "boundary", + "value": "------------F5CEBCED9FC06ACB07B3D485" + } + ] + } + }, + "offset_field": 309, + "offset_start": 322, + "offset_end": 389 + }, + { + "name": "content_language", + "value": { + "Text": "en-GB" + }, + "offset_field": 389, + "offset_start": 406, + "offset_end": 413 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 4 + ] + }, + "offset_header": 0, + "offset_body": 414, + "offset_end": 2026 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------1722706F2C203820A6CAA06F" + } + ] + } + }, + "offset_field": 498, + "offset_start": 511, + "offset_end": 580 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 2, + 3 + ] + }, + "offset_header": 498, + "offset_body": 581, + "offset_end": 1593 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": [ + { + "name": "charset", + "value": "utf-8" + } + ] + } + }, + "offset_field": 621, + "offset_start": 634, + "offset_end": 662 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 662, + "offset_start": 688, + "offset_end": 706 + } + ], + "is_encoding_problem": false, + "body": { + "Html": "\n \n\n \n \n \n

Search for höhö

\n

\"\"

\n \n\n" + }, + "offset_header": 621, + "offset_body": 707, + "offset_end": 982 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1022, + "offset_start": 1035, + "offset_end": 1076 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 1076, + "offset_start": 1102, + "offset_end": 1110 + }, + { + "name": "content_id", + "value": { + "Text": "part1.8C5E6A81.D0C1B91A@example.com" + }, + "offset_field": 1110, + "offset_start": 1121, + "offset_end": 1160 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1160, + "offset_start": 1180, + "offset_end": 1222 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 16, + 0, + 0, + 0, + 16, + 8, + 2, + 0, + 0, + 0, + 144, + 145, + 104, + 54, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 105, + 73, + 68, + 65, + 84, + 56, + 79, + 221, + 208, + 59, + 18, + 128, + 32, + 12, + 69, + 209, + 236, + 76, + 62, + 110, + 7, + 113, + 255, + 77, + 124, + 4, + 70, + 50, + 136, + 128, + 173, + 111, + 110, + 197, + 112, + 40, + 160, + 221, + 158, + 200, + 155, + 168, + 10, + 221, + 156, + 77, + 253, + 23, + 16, + 145, + 190, + 154, + 43, + 192, + 227, + 182, + 228, + 76, + 204, + 193, + 0, + 136, + 209, + 175, + 148, + 90, + 96, + 183, + 35, + 157, + 18, + 49, + 115, + 215, + 140, + 64, + 215, + 76, + 0, + 214, + 152, + 57, + 192, + 180, + 89, + 2, + 216, + 109, + 86, + 1, + 38, + 230, + 241, + 173, + 3, + 128, + 225, + 188, + 130, + 218, + 59, + 192, + 62, + 2, + 230, + 11, + 203, + 69, + 57, + 197, + 69, + 41, + 47, + 201, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1022, + "offset_body": 1223, + "offset_end": 1551 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "attach2.png" + } + ] + } + }, + "offset_field": 1633, + "offset_start": 1646, + "offset_end": 1678 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 1678, + "offset_start": 1704, + "offset_end": 1712 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "attach2.png" + } + ] + } + }, + "offset_field": 1712, + "offset_start": 1732, + "offset_end": 1769 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 14, + 0, + 0, + 0, + 14, + 8, + 2, + 0, + 0, + 0, + 144, + 42, + 186, + 134, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 21, + 73, + 68, + 65, + 84, + 40, + 83, + 99, + 248, + 79, + 52, + 24, + 85, + 58, + 170, + 148, + 104, + 165, + 255, + 255, + 3, + 0, + 211, + 78, + 73, + 211, + 59, + 213, + 209, + 91, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1633, + "offset_body": 1770, + "offset_end": 1984 + } + ] +} \ No newline at end of file diff --git a/resources/eml/thirdparty/019.crlf.json b/resources/eml/thirdparty/019.crlf.json new file mode 100644 index 0000000..4da6b24 --- /dev/null +++ b/resources/eml/thirdparty/019.crlf.json @@ -0,0 +1,811 @@ +{ + "html_body": [ + 4 + ], + "text_body": [ + 2 + ], + "attachments": [ + 5, + 6 + ], + "parts": [ + { + "headers": [ + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 3, + "offset_end": 22 + }, + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 22, + "offset_start": 27, + "offset_end": 46 + }, + { + "name": "subject", + "value": { + "Text": "30 plaintext + (HTML + embedded image) + attachment" + }, + "offset_field": 46, + "offset_start": 54, + "offset_end": 108 + }, + { + "name": "message_id", + "value": { + "Text": "1e58c8f2-3a15-96e7-76b7-046cf6e1ce1e@example.com" + }, + "offset_field": 108, + "offset_start": 119, + "offset_end": 172 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2017, + "month": 12, + "day": 30, + "hour": 20, + "minute": 50, + "second": 1, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 172, + "offset_start": 177, + "offset_end": 211 + }, + { + "name": { + "other": "User-Agent" + }, + "value": { + "Text": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101\r\n Thunderbird/59.0a1" + }, + "offset_field": 211, + "offset_start": 222, + "offset_end": 310 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 310, + "offset_start": 323, + "offset_end": 329 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + { + "name": "boundary", + "value": "------------B94553864BC0A4472640622E" + } + ] + } + }, + "offset_field": 329, + "offset_start": 342, + "offset_end": 411 + }, + { + "name": "content_language", + "value": { + "Text": "en-GB" + }, + "offset_field": 411, + "offset_start": 428, + "offset_end": 436 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 6 + ] + }, + "offset_header": 0, + "offset_body": 438, + "offset_end": 2454 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + { + "name": "boundary", + "value": "------------B24EA868A72E5E6144485481" + } + ] + } + }, + "offset_field": 524, + "offset_start": 537, + "offset_end": 612 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 2, + 3 + ] + }, + "offset_header": 524, + "offset_body": 614, + "offset_end": 2009 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + { + "name": "charset", + "value": "windows-1252" + }, + { + "name": "format", + "value": "flowed" + } + ] + } + }, + "offset_field": 656, + "offset_start": 669, + "offset_end": 719 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 719, + "offset_start": 745, + "offset_end": 764 + } + ], + "is_encoding_problem": false, + "body": { + "Text": "Search for hähä\r\n\r\n" + }, + "offset_header": 656, + "offset_body": 766, + "offset_end": 789 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------D1360749D11EBC0C64444B6C" + } + ] + } + }, + "offset_field": 831, + "offset_start": 844, + "offset_end": 915 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 4, + 5 + ] + }, + "offset_header": 831, + "offset_body": 917, + "offset_end": 1965 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": [ + { + "name": "charset", + "value": "windows-1252" + } + ] + } + }, + "offset_field": 959, + "offset_start": 972, + "offset_end": 1006 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 1006, + "offset_start": 1032, + "offset_end": 1051 + } + ], + "is_encoding_problem": false, + "body": { + "Html": "\r\n \r\n\r\n \r\n \r\n \r\n

Search for höhö

\r\n

\"\"

\r\n \r\n\r\n" + }, + "offset_header": 959, + "offset_body": 1053, + "offset_end": 1339 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1381, + "offset_start": 1394, + "offset_end": 1437 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 1437, + "offset_start": 1463, + "offset_end": 1472 + }, + { + "name": "content_id", + "value": { + "Text": "part1.8C5E6A81.D0C1B91A@example.com" + }, + "offset_field": 1472, + "offset_start": 1483, + "offset_end": 1523 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1523, + "offset_start": 1543, + "offset_end": 1587 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 16, + 0, + 0, + 0, + 16, + 8, + 2, + 0, + 0, + 0, + 144, + 145, + 104, + 54, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 105, + 73, + 68, + 65, + 84, + 56, + 79, + 221, + 208, + 59, + 18, + 128, + 32, + 12, + 69, + 209, + 236, + 76, + 62, + 110, + 7, + 113, + 255, + 77, + 124, + 4, + 70, + 50, + 136, + 128, + 173, + 111, + 110, + 197, + 112, + 40, + 160, + 221, + 158, + 200, + 155, + 168, + 10, + 221, + 156, + 77, + 253, + 23, + 16, + 145, + 190, + 154, + 43, + 192, + 227, + 182, + 228, + 76, + 204, + 193, + 0, + 136, + 209, + 175, + 148, + 90, + 96, + 183, + 35, + 157, + 18, + 49, + 115, + 215, + 140, + 64, + 215, + 76, + 0, + 214, + 152, + 57, + 192, + 180, + 89, + 2, + 216, + 109, + 86, + 1, + 38, + 230, + 241, + 173, + 3, + 128, + 225, + 188, + 130, + 218, + 59, + 192, + 62, + 2, + 230, + 11, + 203, + 69, + 57, + 197, + 69, + 41, + 47, + 201, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1381, + "offset_body": 1589, + "offset_end": 1921 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "attach2.png" + } + ] + } + }, + "offset_field": 2051, + "offset_start": 2064, + "offset_end": 2098 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 2098, + "offset_start": 2124, + "offset_end": 2133 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "attach2.png" + } + ] + } + }, + "offset_field": 2133, + "offset_start": 2153, + "offset_end": 2192 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 14, + 0, + 0, + 0, + 14, + 8, + 2, + 0, + 0, + 0, + 144, + 42, + 186, + 134, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 21, + 73, + 68, + 65, + 84, + 40, + 83, + 99, + 248, + 79, + 52, + 24, + 85, + 58, + 170, + 148, + 104, + 165, + 255, + 255, + 3, + 0, + 211, + 78, + 73, + 211, + 59, + 213, + 209, + 91, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 2051, + "offset_body": 2194, + "offset_end": 2410 + } + ] +} \ No newline at end of file diff --git a/resources/eml/thirdparty/019.eml b/resources/eml/thirdparty/019.eml new file mode 100644 index 0000000..8c0777d --- /dev/null +++ b/resources/eml/thirdparty/019.eml @@ -0,0 +1,73 @@ +To: test@example.com +From: test@example.com +Subject: 30 plaintext + (HTML + embedded image) + attachment +Message-ID: <1e58c8f2-3a15-96e7-76b7-046cf6e1ce1e@example.com> +Date: Sat, 30 Dec 2017 20:50:01 +0100 +User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 + Thunderbird/59.0a1 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------B94553864BC0A4472640622E" +Content-Language: en-GB + +This is a multi-part message in MIME format. +--------------B94553864BC0A4472640622E +Content-Type: multipart/alternative; + boundary="------------B24EA868A72E5E6144485481" + + +--------------B24EA868A72E5E6144485481 +Content-Type: text/plain; charset=windows-1252; format=flowed +Content-Transfer-Encoding: quoted-printable + +Search for h=E4h=E4 + + +--------------B24EA868A72E5E6144485481 +Content-Type: multipart/related; + boundary="------------D1360749D11EBC0C64444B6C" + + +--------------D1360749D11EBC0C64444B6C +Content-Type: text/html; charset=windows-1252 +Content-Transfer-Encoding: quoted-printable + + + + + + + +

Search for h=F6h=F6

+

+ + + +--------------D1360749D11EBC0C64444B6C +Content-Type: image/png; + name="kigaaldcbanejcbi.png" +Content-Transfer-Encoding: base64 +Content-ID: +Content-Disposition: inline; + filename="kigaaldcbanejcbi.png" + +iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1B +AACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAASdEVYdFNvZnR3YXJlAEdyZWVuc2hv +dF5VCAUAAABpSURBVDhP3dA7EoAgDEXR7Ew+bgdx/018BEYyiICtb27FcCig3Z7Im6gK3ZxN +/RcQkb6aK8DjtuRMzMEAiNGvlFpgtyOdEjFz14xA10wA1pg5wLRZAthtVgEm5vGtA4DhvILa +O8A+AuYLy0U5xUUpL8kAAAAASUVORK5CYII= +--------------D1360749D11EBC0C64444B6C-- + +--------------B24EA868A72E5E6144485481-- + +--------------B94553864BC0A4472640622E +Content-Type: image/png; + name="attach2.png" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="attach2.png" + +iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAIAAACQKrqGAAAAAXNSR0IArs4c6QAAAARnQU1B +AACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAASdEVYdFNvZnR3YXJlAEdyZWVuc2hv +dF5VCAUAAAAVSURBVChTY/hPNBhVOqqUaKX//wMA005J0zvV0VsAAAAASUVORK5CYII= +--------------B94553864BC0A4472640622E-- diff --git a/resources/eml/thirdparty/019.json b/resources/eml/thirdparty/019.json new file mode 100644 index 0000000..2e08210 --- /dev/null +++ b/resources/eml/thirdparty/019.json @@ -0,0 +1,811 @@ +{ + "html_body": [ + 4 + ], + "text_body": [ + 2 + ], + "attachments": [ + 5, + 6 + ], + "parts": [ + { + "headers": [ + { + "name": "to", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 0, + "offset_start": 3, + "offset_end": 21 + }, + { + "name": "from", + "value": { + "Address": { + "List": [ + { + "name": null, + "address": "test@example.com" + } + ] + } + }, + "offset_field": 21, + "offset_start": 26, + "offset_end": 44 + }, + { + "name": "subject", + "value": { + "Text": "30 plaintext + (HTML + embedded image) + attachment" + }, + "offset_field": 44, + "offset_start": 52, + "offset_end": 105 + }, + { + "name": "message_id", + "value": { + "Text": "1e58c8f2-3a15-96e7-76b7-046cf6e1ce1e@example.com" + }, + "offset_field": 105, + "offset_start": 116, + "offset_end": 168 + }, + { + "name": "date", + "value": { + "DateTime": { + "year": 2017, + "month": 12, + "day": 30, + "hour": 20, + "minute": 50, + "second": 1, + "tz_before_gmt": false, + "tz_hour": 1, + "tz_minute": 0 + } + }, + "offset_field": 168, + "offset_start": 173, + "offset_end": 206 + }, + { + "name": { + "other": "User-Agent" + }, + "value": { + "Text": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101\n Thunderbird/59.0a1" + }, + "offset_field": 206, + "offset_start": 217, + "offset_end": 303 + }, + { + "name": "mime_version", + "value": { + "Text": "1.0" + }, + "offset_field": 303, + "offset_start": 316, + "offset_end": 321 + }, + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + { + "name": "boundary", + "value": "------------B94553864BC0A4472640622E" + } + ] + } + }, + "offset_field": 321, + "offset_start": 334, + "offset_end": 401 + }, + { + "name": "content_language", + "value": { + "Text": "en-GB" + }, + "offset_field": 401, + "offset_start": 418, + "offset_end": 425 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 1, + 6 + ] + }, + "offset_header": 0, + "offset_body": 426, + "offset_end": 2381 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + { + "name": "boundary", + "value": "------------B24EA868A72E5E6144485481" + } + ] + } + }, + "offset_field": 510, + "offset_start": 523, + "offset_end": 596 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 2, + 3 + ] + }, + "offset_header": 510, + "offset_body": 597, + "offset_end": 1948 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + { + "name": "charset", + "value": "windows-1252" + }, + { + "name": "format", + "value": "flowed" + } + ] + } + }, + "offset_field": 637, + "offset_start": 650, + "offset_end": 699 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 699, + "offset_start": 725, + "offset_end": 743 + } + ], + "is_encoding_problem": false, + "body": { + "Text": "Search for hähä\n\n" + }, + "offset_header": 637, + "offset_body": 744, + "offset_end": 765 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": [ + { + "name": "boundary", + "value": "------------D1360749D11EBC0C64444B6C" + } + ] + } + }, + "offset_field": 805, + "offset_start": 818, + "offset_end": 887 + } + ], + "is_encoding_problem": false, + "body": { + "Multipart": [ + 4, + 5 + ] + }, + "offset_header": 805, + "offset_body": 888, + "offset_end": 1906 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": [ + { + "name": "charset", + "value": "windows-1252" + } + ] + } + }, + "offset_field": 928, + "offset_start": 941, + "offset_end": 974 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "quoted-printable" + }, + "offset_field": 974, + "offset_start": 1000, + "offset_end": 1018 + } + ], + "is_encoding_problem": false, + "body": { + "Html": "\n \n\n \n \n \n

Search for höhö

\n

\"\"

\n \n\n" + }, + "offset_header": 928, + "offset_body": 1019, + "offset_end": 1295 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1335, + "offset_start": 1348, + "offset_end": 1389 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 1389, + "offset_start": 1415, + "offset_end": 1423 + }, + { + "name": "content_id", + "value": { + "Text": "part1.8C5E6A81.D0C1B91A@example.com" + }, + "offset_field": 1423, + "offset_start": 1434, + "offset_end": 1473 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "kigaaldcbanejcbi.png" + } + ] + } + }, + "offset_field": 1473, + "offset_start": 1493, + "offset_end": 1535 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 16, + 0, + 0, + 0, + 16, + 8, + 2, + 0, + 0, + 0, + 144, + 145, + 104, + 54, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 105, + 73, + 68, + 65, + 84, + 56, + 79, + 221, + 208, + 59, + 18, + 128, + 32, + 12, + 69, + 209, + 236, + 76, + 62, + 110, + 7, + 113, + 255, + 77, + 124, + 4, + 70, + 50, + 136, + 128, + 173, + 111, + 110, + 197, + 112, + 40, + 160, + 221, + 158, + 200, + 155, + 168, + 10, + 221, + 156, + 77, + 253, + 23, + 16, + 145, + 190, + 154, + 43, + 192, + 227, + 182, + 228, + 76, + 204, + 193, + 0, + 136, + 209, + 175, + 148, + 90, + 96, + 183, + 35, + 157, + 18, + 49, + 115, + 215, + 140, + 64, + 215, + 76, + 0, + 214, + 152, + 57, + 192, + 180, + 89, + 2, + 216, + 109, + 86, + 1, + 38, + 230, + 241, + 173, + 3, + 128, + 225, + 188, + 130, + 218, + 59, + 192, + 62, + 2, + 230, + 11, + 203, + 69, + 57, + 197, + 69, + 41, + 47, + 201, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1335, + "offset_body": 1536, + "offset_end": 1864 + }, + { + "headers": [ + { + "name": "content_type", + "value": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + { + "name": "name", + "value": "attach2.png" + } + ] + } + }, + "offset_field": 1988, + "offset_start": 2001, + "offset_end": 2033 + }, + { + "name": "content_transfer_encoding", + "value": { + "Text": "base64" + }, + "offset_field": 2033, + "offset_start": 2059, + "offset_end": 2067 + }, + { + "name": "content_disposition", + "value": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": [ + { + "name": "filename", + "value": "attach2.png" + } + ] + } + }, + "offset_field": 2067, + "offset_start": 2087, + "offset_end": 2124 + } + ], + "is_encoding_problem": false, + "body": { + "Binary": [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 14, + 0, + 0, + 0, + 14, + 8, + 2, + 0, + 0, + 0, + 144, + 42, + 186, + 134, + 0, + 0, + 0, + 1, + 115, + 82, + 71, + 66, + 0, + 174, + 206, + 28, + 233, + 0, + 0, + 0, + 4, + 103, + 65, + 77, + 65, + 0, + 0, + 177, + 143, + 11, + 252, + 97, + 5, + 0, + 0, + 0, + 9, + 112, + 72, + 89, + 115, + 0, + 0, + 14, + 195, + 0, + 0, + 14, + 195, + 1, + 199, + 111, + 168, + 100, + 0, + 0, + 0, + 18, + 116, + 69, + 88, + 116, + 83, + 111, + 102, + 116, + 119, + 97, + 114, + 101, + 0, + 71, + 114, + 101, + 101, + 110, + 115, + 104, + 111, + 116, + 94, + 85, + 8, + 5, + 0, + 0, + 0, + 21, + 73, + 68, + 65, + 84, + 40, + 83, + 99, + 248, + 79, + 52, + 24, + 85, + 58, + 170, + 148, + 104, + 165, + 255, + 255, + 3, + 0, + 211, + 78, + 73, + 211, + 59, + 213, + 209, + 91, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130 + ] + }, + "offset_header": 1988, + "offset_body": 2125, + "offset_end": 2339 + } + ] +} \ No newline at end of file diff --git a/src/decoders/quoted_printable.rs b/src/decoders/quoted_printable.rs index bb2aefa..b41dfa5 100644 --- a/src/decoders/quoted_printable.rs +++ b/src/decoders/quoted_printable.rs @@ -157,8 +157,10 @@ impl<'x> MessageStream<'x> { if hex1 != -1 { state = QuotedPrintableState::Hex1; } else if !ch.is_ascii_whitespace() { - self.restore(); - return (usize::MAX, b""[..].into()); + state = QuotedPrintableState::None; + buf.push(b'='); + buf.push(ch); + ws_count = 0; } } QuotedPrintableState::Hex1 => { @@ -169,8 +171,10 @@ impl<'x> MessageStream<'x> { buf.push(((hex1 as u8) << 4) | hex2 as u8); ws_count = 0; } else { - self.restore(); - return (usize::MAX, b""[..].into()); + buf.push(b'='); + buf.push(last_ch); + buf.push(ch); + ws_count = 0; } } }, @@ -346,6 +350,11 @@ mod tests { #[test] fn decode_quoted_printable_mime() { for (encoded_str, expected_result) in [ + ( + " h=C3=B6\n--boundary", + " hö", + ), + ("first=AZ second\n--boundary", "first=AZ second"), ( "=E2=80=94=E2=80=89Antoine de Saint-Exup=C3=A9ry\n--boundary", "— Antoine de Saint-Exupéry", diff --git a/src/parsers/message.rs b/src/parsers/message.rs index 82d5fe6..0705e34 100644 --- a/src/parsers/message.rs +++ b/src/parsers/message.rs @@ -243,7 +243,6 @@ impl MessageParser { // Attempt to recover contents of an invalid message let mut is_encoding_problem = offset_end == usize::MAX; - eprintln!("DBG part={} ct={:?} mime_type={:?} is_text={} is_inline={} enc_problem={} offset_end={}", state.parts, content_type.map(|c| format!("{}/{}", c.ctype(), c.subtype().unwrap_or(""))), mime_type, is_text, is_inline, is_encoding_problem, offset_end as i64); if is_encoding_problem { encoding = Encoding::None; if mime_type != MimeType::TextPlain {