Compare commits

..
64 Commits
Author SHA1 Message Date
Mauro D 4e49dff9e5 v0.5.0 2022-07-15 13:49:17 +00:00
Mauro D 6b23f08ee0 MimePart refactoring. 2022-07-15 08:12:57 +00:00
Mauro D 7f86ea13f9 MimePart refactoring. 2022-07-15 07:58:36 +00:00
Mauro D 371d0ff12e Improved handling of corrupted MIME messages. 2022-07-13 13:28:41 +00:00
Mauro D 5d4c0538ca Raw body parts offset support. 2022-07-12 15:18:22 +00:00
Mauro D ff1e2ee70a Raw body parts offset support. 2022-07-12 14:12:46 +00:00
Mauro D aeb02dcc4d Revert "Add offset_last_part to Message (#25)"
This reverts commit db61a0364c.
2022-07-10 06:36:00 +00:00
Quentin Dufour db61a0364c Add offset_last_part to Message (#25) 2022-07-06 18:57:51 +02:00
Mauro D 6dc27dd69b Removed incorrect license (#24) 2022-07-05 12:38:38 +02:00
Mauro D b76c9f510c Merge branch 'main' of github.com:stalwartlabs/mail-parser into main 2022-06-30 06:42:22 +00:00
Mauro D c391056b92 DecoderFnc less restrictive lifetime. 2022-06-30 06:42:09 +00:00
Johann150 0064d3443a derive Clone for DateTime (#23)
This might be useful for `struct`s that want to store a `DateTime` while also deriving `Clone` themself.
2022-06-22 22:01:07 +02:00
Mauro D e604f8fcec get_bytes_to_boundary fix (#21) 2022-06-06 18:19:18 +00:00
Mauro D 907984861e get_bytes_to_boundary fix (#21) 2022-06-06 18:18:39 +00:00
Mauro D 28fe4d3aff get_bytes_to_boundary fix (#21) 2022-06-06 18:18:18 +00:00
Mauro D 0891cb0292 v0.4.7 2022-06-03 06:50:26 +00:00
Mauro D 2805e029ff v0.4.7 2022-06-03 06:40:21 +00:00
Mauro D 35b4846c7e Added get_header function. 2022-06-02 17:33:39 +00:00
Mauro D 75d9a9e96a Added get_raw_headers function. 2022-06-02 17:27:45 +00:00
Mauro D 1e8dfd31cf Handle clients sending malformed Return-Path fields. 2022-06-02 13:13:58 +00:00
Bryan Leong 0be5ed4a41 Add support for ks_c_5601 charsets (#20)
* Add mapping for ks_c_5601-1987 charset

* Add mapping for ks_c_5601-1989 charset
2022-06-02 11:12:00 +02:00
Mauro D 62057172d0 Into implementations for RfcHeader 2022-05-20 12:05:17 +00:00
Mauro D a963f0caa7 DateTime into i64. 2022-05-19 14:56:26 +00:00
Mauro D e2b33a90f3 Zero offset timezones should be positive (#17) 2022-04-08 08:20:43 +00:00
BryanLeong d157525b1c Zero offset timezones should be positive (#17) 2022-04-08 10:19:17 +02:00
Mauro D 9f1edeed33 Updated copyright notice. 2022-04-04 14:55:30 +00:00
Mauro D 509fb718f3 DateTime to_timestamp fix #15. 2022-03-19 18:07:41 +00:00
Alex Wennerberg eab28c0b2d Change date is_valid check to inclusive range (#15)
* Use inclusive range for is_valid check

* Remove year check
2022-03-19 19:03:15 +01:00
Mauro D 2cae61c6d2 Replaced overflowing_add with wrapping_add. 2022-03-15 14:35:57 +00:00
Mauro D da4a9d9a47 v0.4.5 2022-03-14 17:09:24 +00:00
Mauro D c3b36dd0d6 Fixed issue #14 2022-03-08 06:43:48 +00:00
Mauro D 2f380451f5 Unwrap header name. 2022-02-01 16:59:39 +00:00
Mauro D 1a2ac1d027 Fixed build with --no-default-features #12 2022-01-30 11:41:22 +00:00
Mauro D beb21b3d03 Fixed \r leftover in get_bytes_to_boundary 2022-01-30 01:35:49 +00:00
Mauro D c77f3e2cb4 Parsing header name succeeds on EOF. 2022-01-29 15:10:48 +00:00
Mauro D 94522f1179 HeaderName::as_str 2022-01-26 14:01:41 +00:00
Mauro D 6749649e8c v0.4.4 2022-01-24 22:18:34 +00:00
Mauro D 63a4620407 Allow multiline headers 2022-01-16 23:09:25 +00:00
Mauro D ccdee2332e RfcHeader to string support. 2022-01-13 16:48:05 +00:00
Mauro D 35754eeaa8 Message preview support. 2022-01-13 13:26:16 +00:00
Mauro D 4a6ec957d2 Added support for subpart raw headers. 2022-01-11 17:00:01 +00:00
Mauro D b48e2d711b Improved raw header parsing. 2022-01-08 15:32:44 +00:00
Mauro D d4c75e74a6 InReplyTo parsed as ID. 2022-01-05 16:37:20 +00:00
Mauro D f7281e09cf v.0.4.3 2021-12-31 08:14:48 +00:00
Mauro D 46a8db9a54 MBox mailbox parsing support. 2021-12-29 18:40:23 +00:00
Mauro D a0448c31e9 Bincode serialization support. 2021-12-28 17:51:41 +00:00
Mauro D 41de06fd4e Thread name parsing. 2021-12-22 15:26:30 +00:00
Mauro D 7792452a88 Thread name parsing support. 2021-12-18 10:55:52 +00:00
Mauro D fdf7075e37 MessageAttachment is now an enum. 2021-12-17 18:20:03 +00:00
Mauro D bbb2979e4b Added get_attachment_name() 2021-12-17 11:58:12 +00:00
Mauro D c29fcdc8bf Nested message parsing improvements. 2021-12-17 11:47:44 +00:00
Mauro D 715fbbab46 Lazy decoding of nested messages. 2021-12-16 15:54:18 +00:00
Mauro D 09ae0216ca Lazy decoding of nested messages. 2021-12-16 15:53:03 +00:00
Mauro D d88bc20336 Improved API. 2021-12-16 10:01:32 +00:00
Mauro D 3f99761706 Improved storage of headers. 2021-12-15 14:24:57 +00:00
Mauro D ac87792052 Improved storage of headers. 2021-12-15 14:24:28 +00:00
Mauro D 3ebe77098a Lazy HTML/text body conversion. 2021-12-14 15:23:07 +00:00
Mauro D ba750b4dee Fixed tests. 2021-12-14 13:45:25 +00:00
Mauro D de82b6ea34 Body structure and raw offsets support. 2021-12-14 12:30:35 +00:00
Geert Stappers 6ddbedae48 Rust bytes (#6)
* Use rust byte string, introduction of byte string

Replacing "input" with a multi-line rust byte string.
The `assert_eq!(old, new);` proofs no changes.

(this part one of a two part change)

* Using rust byte string, removing assembled string

(this is part two of a two part change)

Now removing the assembled input.
Also removal of the test on both byte strings being equal.
2021-11-18 09:28:38 +01:00
Mauro D bd78d654c2 Structs made public. 2021-11-16 11:02:33 +00:00
Mauro D f820cee04a v0.3.0: Added CHANGELOG. 2021-11-09 10:36:41 +00:00
Mauro D ea23e474d3 v0.3.0: Improved API. 2021-11-08 11:55:28 +00:00
Mauro D 3c14e77932 v0.2.2 2021-11-04 07:24:36 +00:00
131 changed files with 25468 additions and 9068 deletions
+95
View File
@@ -0,0 +1,95 @@
mail-parser 0.5.0
================================
- `Message` headers are now stored as a `MessagePart` with index 0.
- Improved `MessagePart` API.
- Nested base64/quoted-printable encoded message/rfc822 parts are automatically parsed when calling `get_message`.
- Better handling of malformed MIME messages.
- Added raw offsets to MIME parts.
mail-parser 0.4.8
================================
- get_bytes_to_boundary fix (#21)
mail-parser 0.4.7
================================
- Retrieving message headers in order (#19)
- Added `get_raw_headers` and `get_header` methods.
- Added `get_return_address` method to obtain the return address from the Return-Path or From headers.
- Support for malformed Return-Path headers.
- Support for ks_c_5601 charsets (#20)
mail-parser 0.4.6
================================
- DateTime is_valid() fix (#15)
mail-parser 0.4.5
================================
- DateTime to UNIX timestamp conversion.
- Ord, PartialOrd support for DateTime (#13).
- Fixed Message::parse() panic on duplicate Content-Type headers (#14).
mail-parser 0.4.4
================================
- Support for multi-line headers.
- Text and HTML message body preview.
- Improved support for raw headers.
mail-parser 0.4.3
================================
- Mbox file parsing support (issue #11) conforming to the [QMail specification](http://qmail.org/qmail-manual-html/man5/mbox.html).
- Support for bincode serialize/deserialize.
mail-parser 0.4.2
================================
- Added `Message::get_thread_name()` to obtain the base subject of a message as defined in [RFC 5957 - Internet Message Access Protocol - SORT and THREAD Extensions (Section 2.1)](https://datatracker.ietf.org/doc/html/rfc5256#section-2.1).
- Added `MimeHeader::get_attachment_name` for simplified access to a MIME attachment file name.
mail-parser 0.4.1
================================
- Lazy parsing of nested e-mail messages.
- Support for base64/quoted-printable nested messages.
mail-parser 0.4.0
================================
- Lazy conversion to/from HTML an plain text parts.
- Improved API.
- Parts are now generics.
mail-parser 0.3.1
================================
- Support for non-standard headers.
- Raw message offsets are stored in the message object.
- Message body structure is now stored in the message object.
mail-parser 0.3
================================
- Improved API, now `Message::parse` returns `Option<Message>` to indicate when parsing was successful.
- Headers are now stored internally in a `HashMap` instead of `struct` fields.
- Added support for new RFCs:
- [RFC 2557 - MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)](https://datatracker.ietf.org/doc/html/rfc2557)
- [RFC 2392 - Content-ID and Message-ID Uniform Resource Locators](https://datatracker.ietf.org/doc/html/rfc2392)
- [RFC 3282 - Content Language Headers](https://datatracker.ietf.org/doc/html/rfc3282)
- [RFC 3339 - Date and Time on the Internet: Timestamps](https://datatracker.ietf.org/doc/html/rfc3339)
mail-parser 0.2.1
================================
- Performance enhacements, now *mail-parser* is almost as fast as the `unsafe` 0.1 version.
mail-parser 0.2
================================
- Re-factoring to use **100% safe** Rust after a [discussion on Reddit](https://www.reddit.com/r/rust/comments/qkc5rk/fast_and_robust_email_parsing_library_for_rust/).
- Added `Message::is_empty`.
mail-parser 0.1.1
================================
- Bug-fixing after **fuzzing** the library.
mail-parser 0.1
================================
- Initial release with plenty of `unsafe` code to speed things up.
-23
View File
@@ -1,23 +0,0 @@
Copyright (C) 2020-2022, Stalwart Labs, Minter Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Generated
+117 -45
View File
@@ -4,9 +4,18 @@ version = 3
[[package]]
name = "autocfg"
version = "1.0.1"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "bincode"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
"serde",
]
[[package]]
name = "cfg-if"
@@ -15,16 +24,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "dtoa"
version = "0.4.8"
name = "chrono"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0"
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
dependencies = [
"libc",
"num-integer",
"num-traits",
"time",
"winapi",
]
[[package]]
name = "encoding_rs"
version = "0.8.28"
version = "0.8.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065"
checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
dependencies = [
"cfg-if",
]
@@ -37,9 +53,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
[[package]]
name = "indexmap"
version = "1.7.0"
version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a"
dependencies = [
"autocfg",
"hashbrown",
@@ -47,9 +63,15 @@ dependencies = [
[[package]]
name = "itoa"
version = "0.4.8"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
[[package]]
name = "libc"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
[[package]]
name = "linked-hash-map"
@@ -59,62 +81,73 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
[[package]]
name = "mail-parser"
version = "0.2.1"
version = "0.5.0"
dependencies = [
"bincode",
"chrono",
"encoding_rs",
"serde",
"serde_bytes",
"serde_json",
"serde_yaml",
]
[[package]]
name = "proc-macro2"
version = "1.0.30"
name = "num-integer"
version = "0.1.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70"
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
dependencies = [
"unicode-xid",
"autocfg",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
dependencies = [
"autocfg",
]
[[package]]
name = "proc-macro2"
version = "1.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.10"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
dependencies = [
"proc-macro2",
]
[[package]]
name = "ryu"
version = "1.0.5"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
[[package]]
name = "serde"
version = "1.0.130"
version = "1.0.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_bytes"
version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9"
dependencies = [
"serde",
]
[[package]]
name = "serde_derive"
version = "1.0.130"
version = "1.0.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be"
dependencies = [
"proc-macro2",
"quote",
@@ -123,9 +156,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.68"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8"
checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c"
dependencies = [
"itoa",
"ryu",
@@ -134,32 +167,71 @@ dependencies = [
[[package]]
name = "serde_yaml"
version = "0.8.21"
version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8c608a35705a5d3cdc9fbe403147647ff34b921f8e833e49306df898f9b20af"
checksum = "707d15895415db6628332b737c838b88c598522e4dc70647e59b72312924aebc"
dependencies = [
"dtoa",
"indexmap",
"ryu",
"serde",
"yaml-rust",
]
[[package]]
name = "syn"
version = "1.0.80"
version = "1.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194"
checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
"unicode-ident",
]
[[package]]
name = "unicode-xid"
version = "0.2.2"
name = "time"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
dependencies = [
"libc",
"wasi",
"winapi",
]
[[package]]
name = "unicode-ident"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee"
[[package]]
name = "wasi"
version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "yaml-rust"
+8 -7
View File
@@ -1,7 +1,7 @@
[package]
name = "mail-parser"
description = "Fast and robust e-mail parsing library for Rust"
version = "0.2.1"
version = "0.5.0"
edition = "2018"
authors = [ "Stalwart Labs <hello@stalw.art>"]
license = "Apache-2.0 OR MIT"
@@ -12,18 +12,19 @@ categories = ["email", "parser-implementations"]
readme = "README.md"
[dependencies]
encoding_rs = {version=">=0.8.28", optional=true}
serde = { version = ">=1.0.117", features = ["derive"], optional=true}
serde_bytes = { version = ">=0.11.5", optional=true}
encoding_rs = {version="0.8", optional=true}
serde = { version = "1.0", features = ["derive"], optional=true}
[dev-dependencies]
serde_yaml = ">=0.8.21"
serde_json = ">=1.0.59"
serde_yaml = "0.8"
serde_json = "1.0"
bincode = "1.3.3"
chrono = "0.4"
[features]
default = ["serde_support", "full_encoding"]
full_encoding = ["encoding_rs"]
serde_support = ["serde", "serde_bytes"]
serde_support = ["serde"]
[profile.bench]
debug = true
+80 -86
View File
@@ -4,10 +4,9 @@
[![build](https://github.com/stalwartlabs/mail-parser/actions/workflows/rust.yml/badge.svg)](https://github.com/stalwartlabs/mail-parser/actions/workflows/rust.yml)
[![docs.rs](https://img.shields.io/docsrs/mail-parser)](https://docs.rs/mail-parser)
[![crates.io](https://img.shields.io/crates/l/mail-parser)](http://www.apache.org/licenses/LICENSE-2.0)
[![Twitter Follow](https://img.shields.io/twitter/follow/stalwartlabs?style=social)](https://twitter.com/stalwartlabs)
_mail-parser_ is an **e-mail parsing library** written in Rust that fully conforms to the Internet Message Format standard (_RFC 5322_), the
Multipurpose Internet Mail Extensions (MIME; _RFC 2045 - 2049_) as well as other [internet messaging RFCs](#conformed-rfcs).
Multipurpose Internet Mail Extensions (MIME; _RFC 2045 - 2049_) as well as many other [internet messaging RFCs](#conformed-rfcs).
It also supports decoding messages in [41 different character sets](#supported-character-sets) including obsolete formats such as UTF-7.
All Unicode (UTF-*) and single-byte character sets are handled internally by the library while support for legacy multi-byte encodings of Chinese
@@ -29,82 +28,78 @@ Performance and memory safety were two important factors while designing _mail-p
- **Fast parsing** of message header fields, character set names and HTML entities using [perfect hashing](https://en.wikipedia.org/wiki/Perfect_hash_function).
- Written in **100% safe** Rust with no external dependencies.
- Every function in the library has been [fuzzed](#testing-fuzzing--benchmarking) and
meticulously [tested with MIRI](#testing-fuzzing--benchmarking).
- Thoroughly **battle-tested** with millions of real-world e-mail messages dating from 1995 until today.
thoroughly [tested with MIRI](#testing-fuzzing--benchmarking).
- **Battle-tested** with millions of real-world e-mail messages dating from 1995 until today.
## Usage Example
```rust
let input = concat!(
"From: Art Vandelay <art@vandelay.com> (Vandelay Industries)\n",
"To: \"Colleagues\": \"James Smythe\" <james@vandelay.com>; Friends:\n",
" jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;\n",
"Date: Sat, 20 Nov 2021 14:22:01 -0800\n",
"Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?=\n",
"Content-Type: multipart/mixed; boundary=\"festivus\";\n\n",
"--festivus\n",
"Content-Type: text/html; charset=\"us-ascii\"\n",
"Content-Transfer-Encoding: base64\n\n",
"PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle\n",
"HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm\n",
"cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8\n",
"gJiN4MjYzQTs8L3A+PC9odG1sPg==\n",
"--festivus\n",
"Content-Type: message/rfc822\n\n",
"From: \"Cosmo Kramer\" <kramer@kramerica.com>\n",
"Subject: Exporting my book about coffee tables\n",
"Content-Type: multipart/mixed; boundary=\"giddyup\";\n\n",
"--giddyup\n",
"Content-Type: text/plain; charset=\"utf-16\"\n",
"Content-Transfer-Encoding: quoted-printable\n\n",
"=FF=FE=0C!5=D8\"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8\"=DD =005=D8\"=\n",
"=DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD =\n",
"=005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8\"=\n",
"=DD5=D8=1E=DD5=D80=DD5=D8\"=DD!=00\n",
"--giddyup\n",
"Content-Type: image/gif; name*1=\"about \"; name*0=\"Book \";\n",
" name*2*=utf-8''%e2%98%95 tables.gif\n",
"Content-Transfer-Encoding: Base64\n",
"Content-Disposition: attachment\n\n",
"R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\n",
"--giddyup--\n",
"--festivus--\n",
)
.as_bytes();
let input = br#"From: Art Vandelay <art@vandelay.com> (Vandelay Industries)
To: "Colleagues": "James Smythe" <james@vandelay.com>; Friends:
jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;
Date: Sat, 20 Nov 2021 14:22:01 -0800
Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?=
Content-Type: multipart/mixed; boundary="festivus";
let message = Message::parse(input);
--festivus
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: base64
PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle
HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm
cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8
gJiN4MjYzQTs8L3A+PC9odG1sPg==
--festivus
Content-Type: message/rfc822
From: "Cosmo Kramer" <kramer@kramerica.com>
Subject: Exporting my book about coffee tables
Content-Type: multipart/mixed; boundary="giddyup";
--giddyup
Content-Type: text/plain; charset="utf-16"
Content-Transfer-Encoding: quoted-printable
=FF=FE=0C!5=D8"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8"=DD =005=D8"=
=DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD =
=005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8"=
=DD5=D8=1E=DD5=D80=DD5=D8"=DD!=00
--giddyup
Content-Type: image/gif; name*1="about "; name*0="Book ";
name*2*=utf-8''%e2%98%95 tables.gif
Content-Transfer-Encoding: Base64
Content-Disposition: attachment
R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
--giddyup--
--festivus--
"#;
let message = Message::parse(input).unwrap();
// Parses addresses (including comments), lists and groups
assert_eq!(
message.get_from(),
&Address::Address(Addr {
name: Some("Art Vandelay (Vandelay Industries)".into()),
address: Some("art@vandelay.com".into())
})
&HeaderValue::Address(Addr::new(
"Art Vandelay (Vandelay Industries)".into(),
"art@vandelay.com"
))
);
assert_eq!(
message.get_to(),
&Address::GroupList(vec![
Group {
name: Some("Colleagues".into()),
addresses: vec![Addr {
name: Some("James Smythe".into()),
address: Some("james@vandelay.com".into())
}]
},
Group {
name: Some("Friends".into()),
addresses: vec![
Addr {
name: None,
address: Some("jane@example.com".into())
},
Addr {
name: Some("John Smîth".into()),
address: Some("john@example.com".into())
}
&HeaderValue::GroupList(vec![
Group::new(
"Colleagues",
vec![Addr::new("James Smythe".into(), "james@vandelay.com")]
),
Group::new(
"Friends",
vec![
Addr::new(None, "jane@example.com"),
Addr::new("John Smîth".into(), "john@example.com"),
]
}
)
])
);
@@ -119,9 +114,9 @@ Performance and memory safety were two important factors while designing _mail-p
"Why not both importing AND exporting? ☺"
);
// HTML and text body parts are returned conforming to RFC8621, Section 4.1.4
// HTML and text body parts are returned conforming to RFC8621, Section 4.1.4
assert_eq!(
message.get_html_body(0).unwrap().to_string(),
message.get_html_body(0).unwrap(),
concat!(
"<html><p>I was thinking about quitting the &ldquo;exporting&rdquo; to ",
"focus just on the &ldquo;importing&rdquo;,</p><p>but then I thought,",
@@ -131,7 +126,7 @@ Performance and memory safety were two important factors while designing _mail-p
// HTML parts are converted to plain text (and viceversa) when missing
assert_eq!(
message.get_text_body(0).unwrap().to_string(),
message.get_text_body(0).unwrap(),
concat!(
"I was thinking about quitting the “exporting” to focus just on the",
" “importing”,\nbut then I thought, why not do both? ☺\n"
@@ -139,10 +134,11 @@ Performance and memory safety were two important factors while designing _mail-p
);
// Supports nested messages as well as multipart/digest
let nested_message = match message.get_attachment(0).unwrap() {
MessagePart::Message(v) => v,
_ => unreachable!(),
};
let nested_message = message
.get_attachment(0)
.unwrap()
.get_message();
.unwrap();
assert_eq!(
nested_message.get_subject().unwrap(),
@@ -151,30 +147,21 @@ Performance and memory safety were two important factors while designing _mail-p
// Handles UTF-* as well as many legacy encodings
assert_eq!(
nested_message.get_text_body(0).unwrap().to_string(),
nested_message.get_text_body(0).unwrap(),
"ℌ𝔢𝔩𝔭 𝔪𝔢 𝔢𝔵𝔭𝔬𝔯𝔱 𝔪𝔶 𝔟𝔬𝔬𝔨 𝔭𝔩𝔢𝔞𝔰𝔢!"
);
assert_eq!(
nested_message.get_html_body(0).unwrap().to_string(),
nested_message.get_html_body(0).unwrap(),
"<html><body>ℌ𝔢𝔩𝔭 𝔪𝔢 𝔢𝔵𝔭𝔬𝔯𝔱 𝔪𝔶 𝔟𝔬𝔬𝔨 𝔭𝔩𝔢𝔞𝔰𝔢!</body></html>"
);
let nested_attachment = match nested_message.get_attachment(0).unwrap() {
MessagePart::Binary(v) => v,
_ => unreachable!(),
};
let nested_attachment = nested_message.get_attachment(0).unwrap();
assert_eq!(nested_attachment.len(), 42);
// Full RFC2231 support for continuations and character sets
assert_eq!(
nested_attachment
.get_header()
.unwrap()
.get_content_type()
.unwrap()
.get_attribute("name")
.unwrap(),
nested_attachment.get_attachment_name().unwrap(),
"Book about ☕ tables.gif"
);
@@ -183,6 +170,8 @@ Performance and memory safety were two important factors while designing _mail-p
println!("{}", serde_yaml::to_string(&message).unwrap());
```
More examples available under the [examples](examples) directory. Please note that this library does not support building e-mail messages as this functionality is provided separately by the [`mail-builder`](https://crates.io/crates/mail-builder) crate.
## Testing, Fuzzing & Benchmarking
To run the testsuite:
@@ -219,12 +208,17 @@ and, to run the benchmarks:
- [RFC 2048 - Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures](https://datatracker.ietf.org/doc/html/rfc2048)
- [RFC 2049 - Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples](https://datatracker.ietf.org/doc/html/rfc2049)
- [RFC 2231 - MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations](https://datatracker.ietf.org/doc/html/rfc2231)
- [RFC 2557 - MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)](https://datatracker.ietf.org/doc/html/rfc2557)
- [RFC 2183 - Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field](https://datatracker.ietf.org/doc/html/rfc2183)
- [RFC 2392 - Content-ID and Message-ID Uniform Resource Locators](https://datatracker.ietf.org/doc/html/rfc2392)
- [RFC 3282 - Content Language Headers](https://datatracker.ietf.org/doc/html/rfc3282)
- [RFC 6532 - Internationalized Email Headers](https://datatracker.ietf.org/doc/html/rfc6532)
- [RFC 2152 - UTF-7 - A Mail-Safe Transformation Format of Unicode](https://datatracker.ietf.org/doc/html/rfc2152)
- [RFC 2369 - The Use of URLs as Meta-Syntax for Core Mail List Commands and their Transport through Message Header Fields](https://datatracker.ietf.org/doc/html/rfc2369)
- [RFC 2919 - List-Id: A Structured Field and Namespace for the Identification of Mailing Lists](https://datatracker.ietf.org/doc/html/rfc2919)
- [RFC 3339 - Date and Time on the Internet: Timestamps](https://datatracker.ietf.org/doc/html/rfc3339)
- [RFC 8621 - The JSON Meta Application Protocol (JMAP) for Mail (Section 4.1.4)](https://datatracker.ietf.org/doc/html/rfc8621#section-4.1.4)
- [RFC 5957 - Internet Message Access Protocol - SORT and THREAD Extensions (Section 2.1)](https://datatracker.ietf.org/doc/html/rfc5256#section-2.1)
## Supported Character Sets
@@ -284,7 +278,7 @@ at your option.
## Copyright
Copyright (C) 2020-2022, Stalwart Labs, Minter Ltd.
Copyright (C) 2020-2022, Stalwart Labs Ltd.
See [COPYING] for the license.
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-161
View File
@@ -1,161 +0,0 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
use mail_parser::{Addr, Address, BodyPart, Group, Message, MessagePart, MimeFieldGet};
fn main() {
let input = concat!(
"From: Art Vandelay <art@vandelay.com> (Vandelay Industries)\n",
"To: \"Colleagues\": \"James Smythe\" <james@vandelay.com>; Friends:\n",
" jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;\n",
"Date: Sat, 20 Nov 2021 14:22:01 -0800\n",
"Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?=\n",
"Content-Type: multipart/mixed; boundary=\"festivus\";\n\n",
"--festivus\n",
"Content-Type: text/html; charset=\"us-ascii\"\n",
"Content-Transfer-Encoding: base64\n\n",
"PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle\n",
"HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm\n",
"cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8\n",
"gJiN4MjYzQTs8L3A+PC9odG1sPg==\n",
"--festivus\n",
"Content-Type: message/rfc822\n\n",
"From: \"Cosmo Kramer\" <kramer@kramerica.com>\n",
"Subject: Exporting my book about coffee tables\n",
"Content-Type: multipart/mixed; boundary=\"giddyup\";\n\n",
"--giddyup\n",
"Content-Type: text/plain; charset=\"utf-16\"\n",
"Content-Transfer-Encoding: quoted-printable\n\n",
"=FF=FE=0C!5=D8\"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8\"=DD =005=D8\"=\n",
"=DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD =\n",
"=005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8\"=\n",
"=DD5=D8=1E=DD5=D80=DD5=D8\"=DD!=00\n",
"--giddyup\n",
"Content-Type: image/gif; name*1=\"about \"; name*0=\"Book \";\n",
" name*2*=utf-8''%e2%98%95 tables.gif\n",
"Content-Transfer-Encoding: Base64\n",
"Content-Disposition: attachment\n\n",
"R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\n",
"--giddyup--\n",
"--festivus--\n",
)
.as_bytes();
let message = Message::parse(input);
// Parses addresses (including comments), lists and groups
assert_eq!(
message.get_from(),
&Address::Address(Addr {
name: Some("Art Vandelay (Vandelay Industries)".into()),
address: Some("art@vandelay.com".into())
})
);
assert_eq!(
message.get_to(),
&Address::GroupList(vec![
Group {
name: Some("Colleagues".into()),
addresses: vec![Addr {
name: Some("James Smythe".into()),
address: Some("james@vandelay.com".into())
}]
},
Group {
name: Some("Friends".into()),
addresses: vec![
Addr {
name: None,
address: Some("jane@example.com".into())
},
Addr {
name: Some("John Smîth".into()),
address: Some("john@example.com".into())
}
]
}
])
);
assert_eq!(
message.get_date().unwrap().to_iso8601(),
"2021-11-20T14:22:01-08:00"
);
// RFC2047 support for encoded text in message readers
assert_eq!(
message.get_subject().unwrap(),
"Why not both importing AND exporting? ☺"
);
// HTML and text body parts are returned conforming to RFC8621, Section 4.1.4
assert_eq!(
message.get_html_body(0).unwrap().to_string(),
concat!(
"<html><p>I was thinking about quitting the &ldquo;exporting&rdquo; to ",
"focus just on the &ldquo;importing&rdquo;,</p><p>but then I thought,",
" why not do both? &#x263A;</p></html>"
)
);
// HTML parts are converted to plain text (and viceversa) when missing
assert_eq!(
message.get_text_body(0).unwrap().to_string(),
concat!(
"I was thinking about quitting the “exporting” to focus just on the",
" “importing”,\nbut then I thought, why not do both? ☺\n"
)
);
// Supports nested messages as well as multipart/digest
let nested_message = match message.get_attachment(0).unwrap() {
MessagePart::Message(v) => v,
_ => unreachable!(),
};
assert_eq!(
nested_message.get_subject().unwrap(),
"Exporting my book about coffee tables"
);
// Handles UTF-* as well as many legacy encodings
assert_eq!(
nested_message.get_text_body(0).unwrap().to_string(),
"ℌ𝔢𝔩𝔭 𝔪𝔢 𝔢𝔵𝔭𝔬𝔯𝔱 𝔪𝔶 𝔟𝔬𝔬𝔨 𝔭𝔩𝔢𝔞𝔰𝔢!"
);
assert_eq!(
nested_message.get_html_body(0).unwrap().to_string(),
"<html><body>ℌ𝔢𝔩𝔭 𝔪𝔢 𝔢𝔵𝔭𝔬𝔯𝔱 𝔪𝔶 𝔟𝔬𝔬𝔨 𝔭𝔩𝔢𝔞𝔰𝔢!</body></html>"
);
let nested_attachment = match nested_message.get_attachment(0).unwrap() {
MessagePart::Binary(v) => v,
_ => unreachable!(),
};
assert_eq!(nested_attachment.len(), 42);
// Full RFC2231 support for continuations and character sets
assert_eq!(
nested_attachment
.get_header()
.unwrap()
.get_content_type()
.unwrap()
.get_attribute("name")
.unwrap(),
"Book about ☕ tables.gif"
);
// Integrates with Serde
println!("{}", serde_json::to_string_pretty(&message).unwrap());
println!("{}", serde_yaml::to_string(&message).unwrap());
}
+145
View File
@@ -0,0 +1,145 @@
/*
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
use mail_parser::*;
fn main() {
let input = br#"From: Art Vandelay <art@vandelay.com> (Vandelay Industries)
To: "Colleagues": "James Smythe" <james@vandelay.com>; Friends:
jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;
Date: Sat, 20 Nov 2021 14:22:01 -0800
Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?=
Content-Type: multipart/mixed; boundary="festivus";
--festivus
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: base64
PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle
HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm
cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8
gJiN4MjYzQTs8L3A+PC9odG1sPg==
--festivus
Content-Type: message/rfc822
From: "Cosmo Kramer" <kramer@kramerica.com>
Subject: Exporting my book about coffee tables
Content-Type: multipart/mixed; boundary="giddyup";
--giddyup
Content-Type: text/plain; charset="utf-16"
Content-Transfer-Encoding: quoted-printable
=FF=FE=0C!5=D8"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8"=DD =005=D8"=
=DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD =
=005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8"=
=DD5=D8=1E=DD5=D80=DD5=D8"=DD!=00
--giddyup
Content-Type: image/gif; name*1="about "; name*0="Book ";
name*2*=utf-8''%e2%98%95 tables.gif
Content-Transfer-Encoding: Base64
Content-Disposition: attachment
R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
--giddyup--
--festivus--
"#;
let message = Message::parse(input).unwrap();
// Parses addresses (including comments), lists and groups
assert_eq!(
message.get_from(),
&HeaderValue::Address(Addr::new(
"Art Vandelay (Vandelay Industries)".into(),
"art@vandelay.com"
))
);
assert_eq!(
message.get_to(),
&HeaderValue::GroupList(vec![
Group::new(
"Colleagues",
vec![Addr::new("James Smythe".into(), "james@vandelay.com")]
),
Group::new(
"Friends",
vec![
Addr::new(None, "jane@example.com"),
Addr::new("John Smîth".into(), "john@example.com"),
]
)
])
);
assert_eq!(
message.get_date().unwrap().to_iso8601(),
"2021-11-20T14:22:01-08:00"
);
// RFC2047 support for encoded text in message readers
assert_eq!(
message.get_subject().unwrap(),
"Why not both importing AND exporting? ☺"
);
// HTML and text body parts are returned conforming to RFC8621, Section 4.1.4
assert_eq!(
message.get_html_body(0).unwrap(),
concat!(
"<html><p>I was thinking about quitting the &ldquo;exporting&rdquo; to ",
"focus just on the &ldquo;importing&rdquo;,</p><p>but then I thought,",
" why not do both? &#x263A;</p></html>"
)
);
// HTML parts are converted to plain text (and viceversa) when missing
assert_eq!(
message.get_text_body(0).unwrap(),
concat!(
"I was thinking about quitting the “exporting” to focus just on the",
" “importing”,\nbut then I thought, why not do both? ☺\n"
)
);
// Supports nested messages as well as multipart/digest
let nested_message = message.get_attachment(0).unwrap().get_message().unwrap();
assert_eq!(
nested_message.get_subject().unwrap(),
"Exporting my book about coffee tables"
);
// Handles UTF-* as well as many legacy encodings
assert_eq!(
nested_message.get_text_body(0).unwrap(),
"ℌ𝔢𝔩𝔭 𝔪𝔢 𝔢𝔵𝔭𝔬𝔯𝔱 𝔪𝔶 𝔟𝔬𝔬𝔨 𝔭𝔩𝔢𝔞𝔰𝔢!"
);
assert_eq!(
nested_message.get_html_body(0).unwrap(),
"<html><body>ℌ𝔢𝔩𝔭 𝔪𝔢 𝔢𝔵𝔭𝔬𝔯𝔱 𝔪𝔶 𝔟𝔬𝔬𝔨 𝔭𝔩𝔢𝔞𝔰𝔢!</body></html>"
);
let nested_attachment = nested_message.get_attachment(0).unwrap();
assert_eq!(nested_attachment.len(), 42);
// Full RFC2231 support for continuations and character sets
assert_eq!(
nested_attachment.get_attachment_name().unwrap(),
"Book about ☕ tables.gif"
);
// Integrates with Serde
println!("{}", serde_json::to_string_pretty(&message).unwrap());
println!("{}", serde_yaml::to_string(&message).unwrap());
}
+21
View File
@@ -0,0 +1,21 @@
/*
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
use mail_parser::{parsers::mbox::MBoxParser, Message};
fn main() {
// Read an MBox mailbox from stdin and prints each message as YAML.
for raw_message in MBoxParser::new(std::io::stdin()) {
let message = Message::parse(&raw_message).unwrap();
println!("{}", serde_yaml::to_string(&message).unwrap());
}
}
+73
View File
@@ -0,0 +1,73 @@
/*
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
use mail_parser::*;
fn main() {
let input = br#"From: Art Vandelay <art@vandelay.com> (Vandelay Industries)
To: "Colleagues": "James Smythe" <james@vandelay.com>; Friends:
jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;
Date: Sat, 20 Nov 2021 14:22:01 -0800
Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?=
Content-Type: multipart/mixed; boundary="festivus";
--festivus
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: base64
PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle
HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm
cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8
gJiN4MjYzQTs8L3A+PC9odG1sPg==
--festivus
Content-Type: message/rfc822; name="Exporting my book about coffee tables.eml"
Content-Disposition: inline; filename="Exporting my book about coffee tables.eml"
Content-Transfer-Encoding: 7bit
From: "Cosmo Kramer" <kramer@kramerica.com>
Subject: Exporting my book about coffee tables
Content-Type: multipart/mixed; boundary="giddyup";
--giddyup
Content-Type: text/plain; charset="utf-16"
Content-Transfer-Encoding: quoted-printable
=FF=FE=0C!5=D8"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8"=DD =005=D8"=
=DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD =
=005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8"=
=DD5=D8=1E=DD5=D80=DD5=D8"=DD!=00
--giddyup
Content-Type: image/gif; name*1="about "; name*0="Book ";
name*2*=utf-8''%e2%98%95 tables.gif
Content-Transfer-Encoding: Base64
Content-Disposition: attachment
R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
--giddyup--
--festivus--
"#;
write_attachments(&Message::parse(input).unwrap());
}
fn write_attachments(message: &Message) {
for attachment in message.get_attachments() {
if !attachment.is_message() {
std::fs::write(
attachment.get_attachment_name().unwrap_or("Untitled"),
attachment.get_contents(),
)
.unwrap();
} else {
write_attachments(&attachment.get_message().unwrap());
}
}
}
+1 -11
View File
@@ -42,11 +42,10 @@ dependencies = [
[[package]]
name = "mail-parser"
version = "0.2.1"
version = "0.5.0"
dependencies = [
"encoding_rs",
"serde",
"serde_bytes",
]
[[package]]
@@ -90,15 +89,6 @@ dependencies = [
"serde_derive",
]
[[package]]
name = "serde_bytes"
version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9"
dependencies = [
"serde",
]
[[package]]
name = "serde_derive"
version = "1.0.130"
+9 -7
View File
@@ -22,11 +22,12 @@ use mail_parser::{
id::parse_id,
list::parse_comma_separared,
raw::{parse_and_ignore, parse_raw},
thread::{thread_name, trim_trailing_fwd},
unstructured::parse_unstructured,
},
mime::*,
header::parse_header_name,
message::MessageStream,
mime::*,
},
Message,
};
@@ -62,7 +63,7 @@ fuzz_target!(|data: &[u8]| {
parse_content_type(&mut stream);
}
9 => {
parse_header_name(&mut stream);
parse_header_name(&data);
}
10 => {
decode_rfc2047(&mut stream, 0);
@@ -113,26 +114,27 @@ fuzz_target!(|data: &[u8]| {
}
}
// Fuzz HTML functions
// Fuzz text functions
let mut html_str = String::with_capacity(data.len());
let str_data = String::from_utf8_lossy(data);
add_html_token(&mut html_str, str_data.as_ref().as_bytes(), false);
html_to_text(&str_data);
text_to_html(&str_data);
thread_name(&str_data);
trim_trailing_fwd(&str_data);
// Fuzz decoding functions
decode_hex(data);
get_charset_decoder(data);
let decoders: &[for<'x> fn(&'x [u8]) -> String] = &[
for decoder in &[
decoder_utf7,
decoder_utf16_le,
decoder_utf16_be,
decoder_utf16,
decoder_iso_8859_1,
];
for decoder in decoders {
] as &[for<'x> fn(&'x [u8]) -> String]
{
decoder(data);
}
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+6 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -16,7 +16,7 @@ use super::{
DecoderFnc,
};
pub fn get_charset_decoder<'x>(charset: &[u8]) -> Option<DecoderFnc<'x>> {
pub fn get_charset_decoder(charset: &[u8]) -> Option<DecoderFnc> {
if (2..=45).contains(&charset.len()) {
let mut l_charset = [0u8; 45];
let mut hash: u32 = charset.len() as u32;
@@ -550,7 +550,7 @@ static CH_MAP: &[&[u8]; 758] = &[
b"",
b"",
b"",
b"",
b"ks_c_5601-1989",
b"",
b"",
b"",
@@ -660,7 +660,7 @@ static CH_MAP: &[&[u8]; 758] = &[
b"",
b"",
b"",
b"",
b"ks_c_5601-1987",
b"",
b"",
b"",
@@ -1312,7 +1312,7 @@ static FNC_MAP: &[for<'x> fn(&'x [u8]) -> String; 758] = &[
no_op,
no_op,
no_op,
no_op,
decoder_euc_kr,
no_op,
no_op,
no_op,
@@ -1422,7 +1422,7 @@ static FNC_MAP: &[for<'x> fn(&'x [u8]) -> String; 758] = &[
no_op,
no_op,
no_op,
no_op,
decoder_euc_kr,
no_op,
no_op,
no_op,
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -14,7 +14,7 @@ pub mod multi_byte;
pub mod single_byte;
pub mod utf;
pub type DecoderFnc<'x> = fn(&'x [u8]) -> String;
pub type DecoderFnc = fn(&[u8]) -> String;
#[cfg(test)]
mod tests {
+10 -13
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -12,9 +12,6 @@
#[cfg(feature = "full_encoding")]
use encoding_rs::*;
#[cfg(not(feature = "full_encoding"))]
use super::map::decoder_default;
#[cfg(feature = "full_encoding")]
fn multi_byte_decoder(mut decoder: Decoder, bytes: &[u8]) -> String {
let mut result = String::with_capacity(bytes.len() * 3);
@@ -35,7 +32,7 @@ pub fn decoder_shift_jis(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
@@ -47,7 +44,7 @@ pub fn decoder_big5(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
@@ -59,7 +56,7 @@ pub fn decoder_euc_jp(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
@@ -71,7 +68,7 @@ pub fn decoder_euc_kr(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
@@ -83,7 +80,7 @@ pub fn decoder_gb18030(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
@@ -95,7 +92,7 @@ pub fn decoder_gbk(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
@@ -107,7 +104,7 @@ pub fn decoder_iso2022_jp(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
@@ -119,7 +116,7 @@ pub fn decoder_windows874(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
@@ -131,6 +128,6 @@ pub fn decoder_ibm866(bytes: &[u8]) -> String {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+1116 -809
View File
File diff suppressed because it is too large Load Diff
+10 -22
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -12,21 +12,10 @@
use std::borrow::Cow;
use crate::{
decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, Addr, Address, Group,
decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, Addr, Group,
HeaderValue,
};
impl<'x> Default for Address<'x> {
fn default() -> Self {
Address::Empty
}
}
impl<'x> Address<'x> {
pub fn is_empty(&self) -> bool {
*self == Address::Empty
}
}
#[derive(PartialEq, Clone, Copy, Debug)]
enum AddressState {
Address,
@@ -224,7 +213,7 @@ pub fn add_group(parser: &mut AddressParser) {
});
}
pub fn parse_address<'x>(stream: &mut MessageStream<'x>) -> Address<'x> {
pub fn parse_address<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut parser = AddressParser {
token_start: 0,
token_end: 0,
@@ -394,18 +383,18 @@ pub fn parse_address<'x>(stream: &mut MessageStream<'x>) -> Address<'x> {
if parser.group_name.is_some() || !parser.result.is_empty() {
add_group(&mut parser);
if parser.result.len() > 1 {
Address::GroupList(parser.result)
HeaderValue::GroupList(parser.result)
} else {
Address::Group(parser.result.pop().unwrap())
HeaderValue::Group(parser.result.pop().unwrap())
}
} else if !parser.addresses.is_empty() {
if parser.addresses.len() > 1 {
Address::AddressList(parser.addresses)
HeaderValue::AddressList(parser.addresses)
} else {
Address::Address(parser.addresses.pop().unwrap())
HeaderValue::Address(parser.addresses.pop().unwrap())
}
} else {
Address::Empty
HeaderValue::Empty
}
}
@@ -933,10 +922,9 @@ mod tests {
];
for input in inputs {
println!("Testiong {}", input.0);
let str = input.0.to_string();
let result = parse_address(&mut MessageStream::new(str.as_bytes()));
let expected: Address = serde_yaml::from_str(input.1).unwrap_or(Address::Empty);
let expected: HeaderValue = serde_yaml::from_str(input.1).unwrap_or(HeaderValue::Empty);
/*if input.0.len() >= 70 {
println!(
File diff suppressed because it is too large Load Diff
+94 -11
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -11,7 +11,7 @@
use std::fmt;
use crate::{parsers::message::MessageStream, DateTime};
use crate::{parsers::message::MessageStream, DateTime, HeaderValue};
impl DateTime {
/// Returns an ISO-8601 representation of the parsed RFC5322 datetime field
@@ -24,11 +24,62 @@ impl DateTime {
self.hour,
self.minute,
self.second,
if self.tz_before_gmt { "-" } else { "+" },
if self.tz_before_gmt && (self.tz_hour > 0 || self.tz_minute > 0) {
"-"
} else {
"+"
},
self.tz_hour,
self.tz_minute
)
}
/// Returns true if the date is valid
pub fn is_valid(&self) -> bool {
(0..=23).contains(&self.tz_hour)
&& (1970..=3000).contains(&self.year)
&& (0..=59).contains(&self.tz_minute)
&& (1..=12).contains(&self.month)
&& (1..=31).contains(&self.day)
&& (0..=23).contains(&self.hour)
&& (0..=59).contains(&self.minute)
&& (0..=59).contains(&self.second)
}
/// Returns the numbers of seconds since 1970-01-01T00:00:00Z (Unix epoch)
/// or None if the date is invalid.
pub fn to_timestamp(&self) -> i64 {
// Ported from https://github.com/protocolbuffers/upb/blob/22182e6e/upb/json_decode.c#L982-L992
let year_base = 4800; /* Before min year, multiple of 400. */
let m_adj = self.month.wrapping_sub(3); /* March-based month. */
let carry = if m_adj > self.month { 1 } else { 0 };
let adjust = if carry > 0 { 12 } else { 0 };
let y_adj = self.year as i64 + year_base - carry;
let month_days = ((m_adj.wrapping_add(adjust)) * 62719 + 769) / 2048;
let leap_days = y_adj / 4 - y_adj / 100 + y_adj / 400;
(y_adj * 365 + leap_days + month_days as i64 + (self.day as i64 - 1) - 2472632) * 86400
+ self.hour as i64 * 3600
+ self.minute as i64 * 60
+ self.second as i64
+ ((self.tz_hour as i64 * 3600 + self.tz_minute as i64 * 60)
* if self.tz_before_gmt { 1 } else { -1 })
}
}
impl PartialOrd for DateTime {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.cmp(other).into()
}
}
impl Ord for DateTime {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
match self.to_timestamp() - other.to_timestamp() {
0 => std::cmp::Ordering::Equal,
x if x > 0 => std::cmp::Ordering::Greater,
_ => std::cmp::Ordering::Less,
}
}
}
impl fmt::Display for DateTime {
@@ -37,7 +88,7 @@ impl fmt::Display for DateTime {
}
}
pub fn parse_date(stream: &mut MessageStream) -> Option<DateTime> {
pub fn parse_date<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut pos = 0;
let mut parts = [0u32; 7];
let mut parts_sizes = [
@@ -151,7 +202,7 @@ pub fn parse_date(stream: &mut MessageStream) -> Option<DateTime> {
}
if pos >= 6 {
Some(DateTime {
HeaderValue::DateTime(DateTime {
year: if (1..=99).contains(&parts[2]) {
parts[2] + 1900
} else {
@@ -171,7 +222,7 @@ pub fn parse_date(stream: &mut MessageStream) -> Option<DateTime> {
tz_before_gmt: !is_plus,
})
} else {
None
HeaderValue::Empty
}
}
@@ -195,7 +246,12 @@ pub static MONTH_MAP: &[u8; 31] = &[
#[cfg(test)]
mod tests {
use crate::parsers::{fields::date::parse_date, message::MessageStream};
use chrono::{FixedOffset, LocalResult, SecondsFormat, TimeZone, Utc};
use crate::{
parsers::{fields::date::parse_date, message::MessageStream},
HeaderValue,
};
#[test]
fn parse_dates() {
@@ -262,14 +318,41 @@ mod tests {
for input in inputs {
let str = input.0.to_string();
match parse_date(&mut MessageStream::new(str.as_bytes())) {
Some(date) => {
//println!("{} -> {}", input.0.escape_debug(), date.to_iso8601());
assert_eq!(input.1, date.to_iso8601());
HeaderValue::DateTime(datetime) => {
assert_eq!(input.1, datetime.to_iso8601());
if datetime.is_valid() {
if let LocalResult::Single(chrono_datetime)
| LocalResult::Ambiguous(chrono_datetime, _) = FixedOffset::west_opt(
((datetime.tz_hour as i32 * 3600i32) + datetime.tz_minute as i32 * 60)
* if datetime.tz_before_gmt { 1i32 } else { -1i32 },
)
.unwrap_or_else(|| FixedOffset::east(0))
.ymd_opt(datetime.year as i32, datetime.month, datetime.day)
.and_hms_opt(datetime.hour, datetime.minute, datetime.second)
{
assert_eq!(
chrono_datetime.timestamp(),
datetime.to_timestamp(),
"{} -> {} ({}) -> {} ({})",
input.0.escape_debug(),
datetime.to_timestamp(),
Utc.timestamp_opt(datetime.to_timestamp(), 0)
.unwrap()
.to_rfc3339_opts(SecondsFormat::Secs, true),
chrono_datetime.timestamp(),
Utc.timestamp_opt(chrono_datetime.timestamp(), 0)
.unwrap()
.to_rfc3339_opts(SecondsFormat::Secs, true)
);
}
}
}
None => {
HeaderValue::Empty => {
//println!("{} -> None", input.0.escape_debug());
assert!(input.1.is_empty());
}
_ => panic!("Unexpected result"),
}
}
}
+48 -14
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -9,13 +9,13 @@
* except according to those terms.
*/
use std::borrow::Cow;
use crate::{parsers::message::MessageStream, HeaderValue};
use crate::parsers::message::MessageStream;
pub fn parse_id<'x>(stream: &mut MessageStream<'x>) -> Option<Vec<Cow<'x, str>>> {
pub fn parse_id<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
let mut token_invalid_start: usize = 0; // Handle broken clients
let mut token_invalid_end: usize = 0; // Handle broken clients
let mut is_id_part = false;
let mut ids = Vec::new();
@@ -31,7 +31,19 @@ pub fn parse_id<'x>(stream: &mut MessageStream<'x>) -> Option<Vec<Cow<'x, str>>>
continue;
}
_ => {
return if !ids.is_empty() { Some(ids) } else { None };
return match ids.len() {
1 => HeaderValue::Text(ids.pop().unwrap()),
0 => {
if token_invalid_start > 0 {
HeaderValue::Text(String::from_utf8_lossy(
&stream.data[token_invalid_start - 1..token_invalid_end],
))
} else {
HeaderValue::Empty
}
}
_ => HeaderValue::TextList(ids),
};
}
},
b'<' => {
@@ -50,23 +62,29 @@ pub fn parse_id<'x>(stream: &mut MessageStream<'x>) -> Option<Vec<Cow<'x, str>>>
}
}
b' ' | b'\t' | b'\r' => continue,
_ => (),
_ => {}
}
if is_id_part {
if token_start == 0 {
token_start = stream.pos;
}
token_end = stream.pos;
} else {
if token_invalid_start == 0 {
token_invalid_start = stream.pos;
}
token_invalid_end = stream.pos;
}
}
None
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
use crate::parsers::fields::id::parse_id;
use crate::parsers::message::MessageStream;
use crate::HeaderValue;
#[test]
fn parse_message_ids() {
@@ -99,16 +117,32 @@ mod tests {
"<1234 @ local(blah) .machine .example>\n",
vec!["1234 @ local(blah) .machine .example"],
),
("<>\n", vec![""]),
// Malformed Ids should be parsed anyway
(
"malformed@id.machine.example\n",
vec!["malformed@id.machine.example"],
),
(
" malformed2@id.machine.example \t \n",
vec!["malformed2@id.machine.example"],
),
(" m \n", vec!["m"]),
];
for input in inputs {
let str = input.0.to_string();
assert_eq!(
input.1,
parse_id(&mut MessageStream::new(str.as_bytes())).unwrap(),
"Failed to parse '{:?}'",
input.0
);
match parse_id(&mut MessageStream::new(str.as_bytes())) {
HeaderValue::TextList(ids) => {
assert_eq!(ids, input.1, "Failed to parse '{:?}'", input.0);
}
HeaderValue::Text(id) => {
assert!(input.1.len() == 1, "Failed to parse '{:?}'", input.0);
assert_eq!(id, input.1[0], "Failed to parse '{:?}'", input.0);
}
HeaderValue::Empty if input.1[0].is_empty() => {}
result => panic!("Unexpected result: {:?}", result),
}
}
}
}
+20 -12
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -11,7 +11,7 @@
use std::borrow::Cow;
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream};
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, HeaderValue};
struct ListParser<'x> {
token_start: usize,
@@ -51,7 +51,7 @@ fn add_tokens_to_list(parser: &mut ListParser) {
}
}
pub fn parse_comma_separared<'x>(stream: &mut MessageStream<'x>) -> Option<Vec<Cow<'x, str>>> {
pub fn parse_comma_separared<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut parser = ListParser {
token_start: 0,
token_end: 0,
@@ -80,10 +80,10 @@ pub fn parse_comma_separared<'x>(stream: &mut MessageStream<'x>) -> Option<Vec<C
_ => {
add_tokens_to_list(&mut parser);
return if !parser.list.is_empty() {
parser.list.into()
} else {
None
return match parser.list.len() {
1 => HeaderValue::Text(parser.list.pop().unwrap()),
0 => HeaderValue::Empty,
_ => HeaderValue::TextList(parser.list),
};
}
}
@@ -123,13 +123,14 @@ pub fn parse_comma_separared<'x>(stream: &mut MessageStream<'x>) -> Option<Vec<C
parser.token_end = stream.pos;
}
None
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
use crate::parsers::fields::list::parse_comma_separared;
use crate::parsers::message::MessageStream;
use crate::HeaderValue;
#[test]
fn parse_comma_separated_text() {
@@ -172,10 +173,17 @@ mod tests {
for input in inputs {
let str = input.0.to_string();
assert_eq!(
parse_comma_separared(&mut MessageStream::new(str.as_bytes()),).unwrap(),
input.1
);
match parse_comma_separared(&mut MessageStream::new(str.as_bytes())) {
HeaderValue::TextList(ids) => {
assert_eq!(ids, input.1, "Failed to parse '{:?}'", input.0);
}
HeaderValue::Text(id) => {
assert!(input.1.len() == 1, "Failed to parse '{:?}'", input.0);
assert_eq!(id, input.1[0], "Failed to parse '{:?}'", input.0);
}
_ => panic!("Unexpected result"),
}
}
}
}
+2 -570
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -9,579 +9,11 @@
* except according to those terms.
*/
use std::borrow::Cow;
use crate::{Address, DateTime, MessageHeader, MimeFieldGet, MimeHeader};
use self::{
address::parse_address,
id::parse_id,
list::parse_comma_separared,
raw::{parse_and_ignore, parse_raw},
unstructured::parse_unstructured,
};
use super::message::MessageStream;
pub mod address;
pub mod content_type;
pub mod date;
pub mod id;
pub mod list;
pub mod raw;
pub mod thread;
pub mod unstructured;
pub trait MessageField<'x>: FieldSet<'x> + MimeFieldGet<'x> {}
impl<'x, T: FieldSet<'x> + MimeFieldGet<'x>> MessageField<'x> for T {}
pub trait FieldSet<'x> {
fn set_date(&mut self, stream: &mut MessageStream<'x>);
fn set_sender(&mut self, stream: &mut MessageStream<'x>);
fn set_received(&mut self, stream: &mut MessageStream<'x>);
fn set_references(&mut self, stream: &mut MessageStream<'x>);
fn set_cc(&mut self, stream: &mut MessageStream<'x>);
fn set_comments(&mut self, stream: &mut MessageStream<'x>);
fn set_resent_cc(&mut self, stream: &mut MessageStream<'x>);
fn set_content_id(&mut self, stream: &mut MessageStream<'x>);
fn set_resent_message_id(&mut self, stream: &mut MessageStream<'x>);
fn set_reply_to(&mut self, stream: &mut MessageStream<'x>);
fn set_resent_to(&mut self, stream: &mut MessageStream<'x>);
fn set_resent_bcc(&mut self, stream: &mut MessageStream<'x>);
fn set_subject(&mut self, stream: &mut MessageStream<'x>);
fn set_keywords(&mut self, stream: &mut MessageStream<'x>);
fn set_list_help(&mut self, stream: &mut MessageStream<'x>);
fn set_list_id(&mut self, stream: &mut MessageStream<'x>);
fn set_list_owner(&mut self, stream: &mut MessageStream<'x>);
fn set_resent_date(&mut self, stream: &mut MessageStream<'x>);
fn set_to(&mut self, stream: &mut MessageStream<'x>);
fn set_bcc(&mut self, stream: &mut MessageStream<'x>);
fn set_from(&mut self, stream: &mut MessageStream<'x>);
fn set_content_transfer_encoding(&mut self, stream: &mut MessageStream<'x>);
fn set_return_path(&mut self, stream: &mut MessageStream<'x>);
fn set_list_archive(&mut self, stream: &mut MessageStream<'x>);
fn set_resent_sender(&mut self, stream: &mut MessageStream<'x>);
fn set_list_subscribe(&mut self, stream: &mut MessageStream<'x>);
fn set_message_id(&mut self, stream: &mut MessageStream<'x>);
fn set_content_type(&mut self, stream: &mut MessageStream<'x>);
fn set_list_post(&mut self, stream: &mut MessageStream<'x>);
fn set_in_reply_to(&mut self, stream: &mut MessageStream<'x>);
fn set_content_description(&mut self, stream: &mut MessageStream<'x>);
fn set_resent_from(&mut self, stream: &mut MessageStream<'x>);
fn set_content_disposition(&mut self, stream: &mut MessageStream<'x>);
fn set_list_unsubscribe(&mut self, stream: &mut MessageStream<'x>);
fn set_mime_version(&mut self, stream: &mut MessageStream<'x>);
fn set_unsupported(&mut self, stream: &mut MessageStream<'x>, name: &'x [u8]);
}
impl<'x> FieldSet<'x> for MessageHeader<'x> {
fn set_date(&mut self, stream: &mut MessageStream<'x>) {
self.date = self::date::parse_date(stream);
}
fn set_sender(&mut self, stream: &mut MessageStream<'x>) {
self.sender = parse_address(stream);
}
fn set_received(&mut self, stream: &mut MessageStream<'x>) {
append_line(&mut self.received, parse_raw(stream));
}
fn set_references(&mut self, stream: &mut MessageStream<'x>) {
self.references = parse_id(stream);
}
fn set_cc(&mut self, stream: &mut MessageStream<'x>) {
self.cc = parse_address(stream);
}
fn set_comments(&mut self, stream: &mut MessageStream<'x>) {
append_line(&mut self.comments, parse_unstructured(stream));
}
fn set_resent_cc(&mut self, stream: &mut MessageStream<'x>) {
append_address_line(&mut self.resent_cc, parse_address(stream));
}
fn set_resent_message_id(&mut self, stream: &mut MessageStream<'x>) {
append_line_many(&mut self.resent_message_id, parse_id(stream));
}
fn set_reply_to(&mut self, stream: &mut MessageStream<'x>) {
self.reply_to = parse_address(stream);
}
fn set_resent_to(&mut self, stream: &mut MessageStream<'x>) {
append_address_line(&mut self.resent_to, parse_address(stream));
}
fn set_resent_bcc(&mut self, stream: &mut MessageStream<'x>) {
append_address_line(&mut self.resent_bcc, parse_address(stream));
}
fn set_subject(&mut self, stream: &mut MessageStream<'x>) {
self.subject = parse_unstructured(stream);
}
fn set_keywords(&mut self, stream: &mut MessageStream<'x>) {
append_line_many(&mut self.keywords, parse_comma_separared(stream));
}
fn set_list_help(&mut self, stream: &mut MessageStream<'x>) {
self.list_help = parse_address(stream);
}
fn set_list_id(&mut self, stream: &mut MessageStream<'x>) {
self.list_id = parse_address(stream);
}
fn set_list_owner(&mut self, stream: &mut MessageStream<'x>) {
self.list_owner = parse_address(stream);
}
fn set_resent_date(&mut self, stream: &mut MessageStream<'x>) {
append_date_line(&mut self.resent_date, self::date::parse_date(stream));
}
fn set_to(&mut self, stream: &mut MessageStream<'x>) {
self.to = parse_address(stream);
}
fn set_bcc(&mut self, stream: &mut MessageStream<'x>) {
self.bcc = parse_address(stream);
}
fn set_from(&mut self, stream: &mut MessageStream<'x>) {
self.from = parse_address(stream);
}
fn set_return_path(&mut self, stream: &mut MessageStream<'x>) {
append_line_many(&mut self.return_path, parse_id(stream));
}
fn set_list_archive(&mut self, stream: &mut MessageStream<'x>) {
self.list_archive = parse_address(stream);
}
fn set_resent_sender(&mut self, stream: &mut MessageStream<'x>) {
append_address_line(&mut self.resent_sender, parse_address(stream));
}
fn set_list_subscribe(&mut self, stream: &mut MessageStream<'x>) {
self.list_subscribe = parse_address(stream);
}
fn set_message_id(&mut self, stream: &mut MessageStream<'x>) {
self.message_id = parse_id(stream).map(|mut v| v.pop().unwrap());
}
fn set_list_post(&mut self, stream: &mut MessageStream<'x>) {
self.list_post = parse_address(stream);
}
fn set_in_reply_to(&mut self, stream: &mut MessageStream<'x>) {
self.reply_to = parse_address(stream);
}
fn set_resent_from(&mut self, stream: &mut MessageStream<'x>) {
append_address_line(&mut self.resent_from, parse_address(stream));
}
fn set_list_unsubscribe(&mut self, stream: &mut MessageStream<'x>) {
self.list_unsubscribe = parse_address(stream);
}
fn set_mime_version(&mut self, stream: &mut MessageStream<'x>) {
self.mime_version = parse_raw(stream);
}
fn set_unsupported(&mut self, stream: &mut MessageStream<'x>, name: &'x [u8]) {
if let Ok(name) = std::str::from_utf8(name) {
if let Some(value) = parse_unstructured(stream) {
if let Some(arr) = self.others.get_mut(name) {
arr.push(value);
} else {
self.others.insert(name, vec![value]);
}
}
}
}
fn set_content_id(&mut self, stream: &mut MessageStream<'x>) {
self.content_id = parse_id(stream).map(|mut v| v.pop().unwrap());
}
fn set_content_transfer_encoding(&mut self, stream: &mut MessageStream<'x>) {
self.content_transfer_encoding = parse_unstructured(stream);
}
fn set_content_type(&mut self, stream: &mut MessageStream<'x>) {
self.content_type = self::content_type::parse_content_type(stream);
}
fn set_content_description(&mut self, stream: &mut MessageStream<'x>) {
self.content_description = parse_unstructured(stream);
}
fn set_content_disposition(&mut self, stream: &mut MessageStream<'x>) {
self.content_disposition = self::content_type::parse_content_type(stream);
}
}
impl<'x> FieldSet<'x> for MimeHeader<'x> {
fn set_date(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_sender(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_received(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_references(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_cc(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_comments(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_cc(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_message_id(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_reply_to(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_to(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_bcc(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_subject(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_keywords(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_help(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_id(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_owner(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_date(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_to(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_bcc(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_from(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_return_path(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_archive(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_sender(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_subscribe(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_message_id(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_post(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_in_reply_to(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_from(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_unsubscribe(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_mime_version(&mut self, stream: &mut MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_unsupported(&mut self, stream: &mut MessageStream<'x>, _name: &'x [u8]) {
parse_and_ignore(stream);
}
fn set_content_id(&mut self, stream: &mut MessageStream<'x>) {
self.content_id = parse_id(stream).map(|mut v| v.pop().unwrap());
}
fn set_content_transfer_encoding(&mut self, stream: &mut MessageStream<'x>) {
self.content_transfer_encoding = parse_unstructured(stream);
}
fn set_content_type(&mut self, stream: &mut MessageStream<'x>) {
self.content_type = self::content_type::parse_content_type(stream);
}
fn set_content_description(&mut self, stream: &mut MessageStream<'x>) {
self.content_description = parse_unstructured(stream);
}
fn set_content_disposition(&mut self, stream: &mut MessageStream<'x>) {
self.content_disposition = self::content_type::parse_content_type(stream);
}
}
pub fn parse_date<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_date(stream);
}
pub fn parse_sender<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_sender(stream);
}
pub fn parse_received<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_received(stream);
}
pub fn parse_references<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_references(stream);
}
pub fn parse_cc<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_cc(stream);
}
pub fn parse_comments<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_comments(stream);
}
pub fn parse_resent_cc<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_resent_cc(stream);
}
pub fn parse_content_id<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_content_id(stream);
}
pub fn parse_resent_message_id<'x>(
header: &mut dyn MessageField<'x>,
stream: &mut MessageStream<'x>,
) {
header.set_resent_message_id(stream);
}
pub fn parse_reply_to<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_reply_to(stream);
}
pub fn parse_resent_to<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_resent_to(stream);
}
pub fn parse_resent_bcc<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_resent_bcc(stream);
}
pub fn parse_subject<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_subject(stream);
}
pub fn parse_keywords<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_keywords(stream);
}
pub fn parse_list_help<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_list_help(stream);
}
pub fn parse_list_id<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_list_id(stream);
}
pub fn parse_list_owner<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_list_owner(stream);
}
pub fn parse_resent_date<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_resent_date(stream);
}
pub fn parse_to<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_to(stream);
}
pub fn parse_bcc<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_bcc(stream);
}
pub fn parse_from<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_from(stream);
}
pub fn parse_content_transfer_encoding<'x>(
header: &mut dyn MessageField<'x>,
stream: &mut MessageStream<'x>,
) {
header.set_content_transfer_encoding(stream);
}
pub fn parse_return_path<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_return_path(stream);
}
pub fn parse_list_archive<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_list_archive(stream);
}
pub fn parse_resent_sender<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_resent_sender(stream);
}
pub fn parse_list_subscribe<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_list_subscribe(stream);
}
pub fn parse_message_id<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_message_id(stream);
}
pub fn parse_content_type<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_content_type(stream);
}
pub fn parse_list_post<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_list_post(stream);
}
pub fn parse_in_reply_to<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_in_reply_to(stream);
}
pub fn parse_content_description<'x>(
header: &mut dyn MessageField<'x>,
stream: &mut MessageStream<'x>,
) {
header.set_content_description(stream);
}
pub fn parse_resent_from<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_resent_from(stream);
}
pub fn parse_content_disposition<'x>(
header: &mut dyn MessageField<'x>,
stream: &mut MessageStream<'x>,
) {
header.set_content_disposition(stream);
}
pub fn parse_list_unsubscribe<'x>(
header: &mut dyn MessageField<'x>,
stream: &mut MessageStream<'x>,
) {
header.set_list_unsubscribe(stream);
}
pub fn parse_mime_version<'x>(header: &mut dyn MessageField<'x>, stream: &mut MessageStream<'x>) {
header.set_mime_version(stream);
}
fn append_address_line<'x>(value: &mut Address<'x>, new_value: Address<'x>) {
if new_value != Address::Empty {
match value {
Address::Collection(ref mut arr) => {
arr.push(new_value);
}
Address::Empty => *value = new_value,
_ => {
*value = Address::Collection(vec![std::mem::take(value), new_value]);
}
}
}
}
fn append_date_line(value: &mut Option<Vec<DateTime>>, new_value: Option<DateTime>) {
if let Some(new_value) = new_value {
if let Some(value) = value {
value.push(new_value);
} else {
*value = Some(vec![new_value]);
}
}
}
fn append_line<'x>(value: &mut Option<Vec<Cow<'x, str>>>, new_value: Option<Cow<'x, str>>) {
if let Some(new_value) = new_value {
if let Some(value) = value {
value.push(new_value);
} else {
*value = Some(vec![new_value]);
}
}
}
fn append_line_many<'x>(
value: &mut Option<Vec<Cow<'x, str>>>,
new_value: Option<Vec<Cow<'x, str>>>,
) {
if let Some(mut new_value) = new_value {
if let Some(value) = value {
value.append(&mut new_value);
} else {
*value = Some(new_value);
}
}
}
pub fn parse_no_op<'x>(_header: &mut dyn MessageField<'x>, _stream: &mut MessageStream<'x>) {}
pub fn parse_unsupported<'x>(
header: &mut dyn MessageField<'x>,
stream: &mut MessageStream<'x>,
name: &'x [u8],
) {
header.set_unsupported(stream, name);
}
+59 -9
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -9,11 +9,9 @@
* except according to those terms.
*/
use std::borrow::Cow;
use crate::{parsers::message::MessageStream, HeaderValue};
use crate::parsers::message::MessageStream;
pub fn parse_raw<'x>(stream: &mut MessageStream<'x>) -> Option<Cow<'x, str>> {
pub fn parse_raw<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
@@ -30,9 +28,11 @@ pub fn parse_raw<'x>(stream: &mut MessageStream<'x>) -> Option<Cow<'x, str>> {
}
_ => {
return if token_start > 0 {
String::from_utf8_lossy(&stream.data[token_start - 1..token_end]).into()
HeaderValue::Text(String::from_utf8_lossy(
&stream.data[token_start - 1..token_end],
))
} else {
None
HeaderValue::Empty
};
}
},
@@ -47,7 +47,7 @@ pub fn parse_raw<'x>(stream: &mut MessageStream<'x>) -> Option<Cow<'x, str>> {
token_end = stream.pos;
}
None
HeaderValue::Empty
}
pub fn parse_and_ignore(stream: &mut MessageStream) {
@@ -73,6 +73,7 @@ pub fn parse_and_ignore(stream: &mut MessageStream) {
mod tests {
use crate::parsers::fields::raw::parse_raw;
use crate::parsers::message::MessageStream;
use crate::{HeaderName, Message, RfcHeader};
#[test]
fn parse_raw_text() {
@@ -96,11 +97,60 @@ mod tests {
for input in inputs {
let str = input.0.to_string();
assert_eq!(
parse_raw(&mut MessageStream::new(str.as_bytes())).unwrap(),
parse_raw(&mut MessageStream::new(str.as_bytes())).unwrap_text(),
input.1,
"Failed for '{:?}'",
input.0
);
}
}
#[test]
fn ordered_raw_headers() {
let input = br#"From: Art Vandelay <art@vandelay.com>
To: jane@example.com
Date: Sat, 20 Nov 2021 14:22:01 -0800
Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?=
Content-Type: multipart/mixed; boundary="festivus";
Here's a message body.
"#;
let message = Message::parse(input).unwrap();
let mut iter = message.get_raw_headers();
assert_eq!(
iter.next().unwrap(),
(
&HeaderName::Rfc(RfcHeader::From),
" Art Vandelay <art@vandelay.com>\n".into()
)
);
assert_eq!(
iter.next().unwrap(),
(
&HeaderName::Rfc(RfcHeader::To),
" jane@example.com\n".into()
)
);
assert_eq!(
iter.next().unwrap(),
(
&HeaderName::Rfc(RfcHeader::Date),
" Sat, 20 Nov 2021 14:22:01 -0800\n".into()
)
);
assert_eq!(
iter.next().unwrap(),
(
&HeaderName::Rfc(RfcHeader::Subject),
" Why not both importing AND exporting? =?utf-8?b?4pi6?=\n".into()
)
);
assert_eq!(
iter.next().unwrap(),
(
&HeaderName::Rfc(RfcHeader::ContentType),
" multipart/mixed; boundary=\"festivus\";\n".into()
)
);
}
}
+308
View File
@@ -0,0 +1,308 @@
/*
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
static RE_PREFIXES: &[&str] = &[
"re", "res", "sv", "antw", "ref", "aw", "απ", "השב", "vá", "r", "rif", "bls", "odp", "ynt",
"atb", "رد", "回复", "转发",
];
static FWD_PREFIXES: &[&str] = &[
"fwd",
"fw",
"rv",
"enc",
"vs",
"doorst",
"vl",
"tr",
"wg",
"πρθ",
"הועבר",
"továbbítás",
"i",
"fs",
"trs",
"vb",
"pd",
"i̇lt",
"yml",
"إعادة توجيه",
"回覆",
"轉寄",
];
pub fn thread_name(text: &str) -> &str {
let mut token_start = 0;
let mut token_end = 0;
let mut thread_name_start = 0;
let mut fwd_start = 0;
let mut fwd_end = 0;
let mut last_blob_end = 0;
let mut in_blob = false;
let mut in_blob_ignore = false;
let mut seen_header = false;
let mut seen_blob_header = false;
let mut token_found = false;
for (pos, ch) in text.char_indices() {
match ch {
'[' => {
if !in_blob {
if token_found {
if token_end == 0 {
token_end = pos;
}
let prefix = text[token_start..token_end].to_lowercase();
if RE_PREFIXES.contains(&prefix.as_ref())
|| FWD_PREFIXES.contains(&prefix.as_ref())
{
seen_header = true;
} else {
break;
}
}
token_found = false;
in_blob = true;
} else {
break;
}
}
']' if in_blob => {
if seen_blob_header && token_found {
fwd_start = token_start;
fwd_end = pos;
}
if !seen_header {
last_blob_end = pos + 1;
}
in_blob = false;
token_found = false;
seen_blob_header = false;
in_blob_ignore = false;
}
':' if !in_blob => {
if (seen_header && token_found) || (!seen_header && !token_found) {
break;
} else if !seen_header {
if token_end == 0 {
token_end = pos;
}
let prefix = text[token_start..token_end].to_lowercase();
if !RE_PREFIXES.contains(&prefix.as_ref())
&& !FWD_PREFIXES.contains(&prefix.as_ref())
{
break;
}
} else {
seen_header = false;
}
thread_name_start = pos + 1;
token_found = false;
}
':' if in_blob && !in_blob_ignore => {
if token_end == 0 {
token_end = pos;
}
let prefix = text[token_start..token_end].to_lowercase();
if FWD_PREFIXES.contains(&prefix.as_ref()) {
token_found = false;
seen_blob_header = true;
} else if seen_blob_header && RE_PREFIXES.contains(&prefix.as_ref()) {
token_found = false;
} else {
in_blob_ignore = true;
}
}
_ if ch.is_whitespace() => {
if token_end == 0 {
token_end = pos;
}
}
_ => {
if !token_found {
token_start = pos;
token_end = 0;
token_found = true;
} else if !in_blob && pos - token_start > 21 {
break;
}
}
}
}
if last_blob_end > thread_name_start
|| (fwd_start > 0 && last_blob_end > fwd_start && fwd_start > thread_name_start)
{
let result = trim_trailing_fwd(&text[last_blob_end..]);
if !result.is_empty() {
return result;
}
}
if fwd_start > 0 && thread_name_start < fwd_start {
let result = trim_trailing_fwd(&text[fwd_start..fwd_end]);
if !result.is_empty() {
return result;
}
}
trim_trailing_fwd(&text[thread_name_start..])
}
pub fn trim_trailing_fwd(text: &str) -> &str {
let mut in_parentheses = false;
let mut trim_end = true;
let mut end_found = false;
let mut text_start = 0;
let mut text_end = text.len();
let mut fwd_end = 0;
for (pos, ch) in text.char_indices().rev() {
match ch {
'(' if !end_found => {
if in_parentheses {
in_parentheses = false;
if fwd_end - pos > 2
&& FWD_PREFIXES.contains(&text[pos + 1..fwd_end].to_lowercase().as_ref())
{
text_end = pos;
trim_end = true;
continue;
}
}
end_found = true;
}
')' if !end_found => {
if !in_parentheses {
in_parentheses = true;
fwd_end = pos;
} else {
end_found = true;
}
}
_ if ch.is_whitespace() => {
if trim_end {
text_end = pos;
}
continue;
}
_ => {
if !in_parentheses && !end_found {
end_found = true;
}
}
}
if trim_end {
trim_end = false;
}
text_start = pos;
}
if text_end >= text_start {
&text[text_start..text_end]
} else {
""
}
}
#[cfg(test)]
mod tests {
use crate::parsers::fields::thread::{thread_name, trim_trailing_fwd};
#[test]
fn parse_thread_name() {
let tests = [
("re: hello", "hello"),
("re:re: hello", "hello"),
("re:fwd: hello", "hello"),
("fwd[5]:re[5]: hello", "hello"),
("fwd[99]: re[40]: hello", "hello"),
(": hello", ": hello"),
("z: hello", "z: hello"),
("re:: hello", ": hello"),
("[10] hello", "hello"),
("fwd[a]: hello", "hello"),
("re:", ""),
("re::", ":"),
("", ""),
(" ", ""),
("回复: 轉寄: 轉寄", "轉寄"),
("aw[50]: wg: aw[1]: hallo", "hallo"),
("res: rv: enc: továbbítás: ", ""),
("[fwd: hello world]", "hello world"),
("re: enc: re[5]: [fwd: hello world]", "hello world"),
("[fwd: re: fw: hello world]", "hello world"),
("[fwd: hello world]: another text", ": another text"),
("[fwd: re: fwd:] another text", "another text"),
("[hello world]", "[hello world]"),
("re: fwd[9]: [hello world]", "[hello world]"),
("[mailing-list] hello world", "hello world"),
("[mailing-list] re: hello world", "hello world"),
("[mailing-list] wg[8]:re: hello world", "hello world"),
("hello [world]", "hello [world]"),
(" [hello] [world] ", "[hello] [world]"),
("[mailing-list] hello [world]", "hello [world]"),
("[hello [world]", "[hello [world]"),
("[]hello [world]", "hello [world]"),
("[fwd: re: re:] fwd[6]:re: fw:", ""),
("[fwd hello] world hello", "world hello"),
("[fwd: مرحبا بالعالم]", "مرحبا بالعالم"),
("[fwd: hello world] مرحبا بالعالم", "مرحبا بالعالم"),
(" hello world ", "hello world"),
(
"[mailing-list] wg[8]:re: hello world (fwd)(fwd)",
"hello world",
),
("[fwd: re: fw: hello world (fwd)]", "hello world"),
(
"res: rv: enc: továbbítás: hello world (doorst)",
"hello world",
),
("[fwd: re: re: (fwd)] fwd[6]:re: fw: (fwd)", ""),
];
for (input, expected) in tests {
assert_eq!(thread_name(input), expected, "{:?}", input);
}
}
#[test]
fn parse_trail_fwd() {
let tests = [
("hello (fwd)", "hello"),
(" hello (fwd)(fwd)", "hello"),
("hello (wg) (fwd) (fwd)", "hello"),
("(fwd)(fwd)", ""),
("(fwd)hello(fwd)", "(fwd)hello"),
(" hello ", "hello"),
(" hello world ", "hello world"),
("", ""),
(" ", ""),
("hello ()(fwd)", "hello ()"),
("(hello)", "(hello)"),
("hello () (fwd) ()(fwd)", "hello () (fwd) ()"),
(")(", ")("),
(" 你好世界(fwd) ", "你好世界"),
("你好世界 (回覆)", "你好世界"),
("hello(fwd", "hello(fwd"),
("hello(fwd))", "hello(fwd))"),
];
for (input, expected) in tests {
assert_eq!(trim_trailing_fwd(input), expected, "{:?}", input);
}
}
}
+8 -9
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -11,7 +11,7 @@
use std::borrow::Cow;
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream};
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, HeaderValue};
struct UnstructuredParser<'x> {
token_start: usize,
token_end: usize,
@@ -37,7 +37,7 @@ fn add_token<'x>(parser: &mut UnstructuredParser<'x>, stream: &MessageStream<'x>
}
}
pub fn parse_unstructured<'x>(stream: &mut MessageStream<'x>) -> Option<Cow<'x, str>> {
pub fn parse_unstructured<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut parser = UnstructuredParser {
token_start: 0,
token_end: 0,
@@ -64,9 +64,9 @@ pub fn parse_unstructured<'x>(stream: &mut MessageStream<'x>) -> Option<Cow<'x,
}
_ => {
return match parser.tokens.len() {
1 => parser.tokens.pop().unwrap().into(),
0 => None,
_ => Some(parser.tokens.concat().into()),
1 => HeaderValue::Text(parser.tokens.pop().unwrap()),
0 => HeaderValue::Empty,
_ => HeaderValue::Text(parser.tokens.concat().into()),
};
}
}
@@ -101,12 +101,11 @@ pub fn parse_unstructured<'x>(stream: &mut MessageStream<'x>) -> Option<Cow<'x,
parser.token_end = stream.pos;
}
None
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
#[test]
fn parse_unstructured_text() {
use crate::parsers::fields::unstructured::parse_unstructured;
@@ -184,7 +183,7 @@ mod tests {
for input in inputs {
let str = input.0.to_string();
assert_eq!(
parse_unstructured(&mut MessageStream::new(str.as_bytes()),).unwrap(),
parse_unstructured(&mut MessageStream::new(str.as_bytes()),).unwrap_text(),
input.1,
"Failed to parse '{:?}'",
input.0
+270 -192
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -9,107 +9,115 @@
* except according to those terms.
*/
use crate::{MessageHeader, MimeHeader};
use std::{borrow::Cow, collections::hash_map::Entry};
use crate::{HeaderName, HeaderOffset, HeaderValue, RawHeaders, RfcHeader, RfcHeaders};
use super::{
fields::{parse_unsupported, MessageField},
fields::{
address::parse_address,
content_type::parse_content_type,
date::parse_date,
id::parse_id,
list::parse_comma_separared,
raw::{parse_and_ignore, parse_raw},
unstructured::parse_unstructured,
},
message::MessageStream,
};
impl<'x> MessageHeader<'x> {
pub fn new() -> MessageHeader<'x> {
MessageHeader {
..Default::default()
}
}
}
impl<'x> MimeHeader<'x> {
pub fn new() -> MimeHeader<'x> {
MimeHeader {
..Default::default()
}
}
pub fn clear(&mut self) {
self.content_description = None;
self.content_disposition = None;
self.content_id = None;
self.content_transfer_encoding = None;
self.content_type = None;
}
pub fn is_empty(&self) -> bool {
self.content_description.is_none()
&& self.content_disposition.is_none()
&& self.content_id.is_none()
&& self.content_transfer_encoding.is_none()
&& self.content_type.is_none()
}
}
#[derive(Debug, PartialEq)]
pub enum HeaderParserResult<'x> {
Supported(fn(&mut dyn MessageField<'x>, &mut MessageStream<'x>)),
Unsupported(&'x [u8]),
Rfc(RfcHeader),
Other(Cow<'x, str>),
Lf,
Eof,
}
pub fn parse_headers<'x>(
header: &mut dyn MessageField<'x>,
headers_rfc: &mut RfcHeaders<'x>,
headers_raw: &mut RawHeaders<'x>,
stream: &mut MessageStream<'x>,
) -> bool {
loop {
match parse_header_name(stream) {
HeaderParserResult::Supported(fnc) => fnc(header, stream),
HeaderParserResult::Unsupported(name) => parse_unsupported(header, stream, name),
let (bytes_read, result) = parse_header_name(&stream.data[stream.pos..]);
stream.pos += bytes_read;
match result {
HeaderParserResult::Rfc(name) => {
let (_, parser) = HDR_PARSER[name as usize];
let from_offset = stream.pos;
let value = parser(stream);
headers_raw.push((
HeaderName::Rfc(name),
HeaderOffset {
start: from_offset,
end: stream.pos,
},
));
if !value.is_empty() {
match headers_rfc.entry(name) {
Entry::Occupied(mut e) => {
if let HeaderValue::Collection(col) = e.get_mut() {
col.push(value);
} else {
let old_value = e.remove();
headers_rfc
.insert(name, HeaderValue::Collection(vec![old_value, value]));
}
}
Entry::Vacant(e) => {
e.insert(value);
}
}
}
}
HeaderParserResult::Other(name) => {
let from_offset = stream.pos;
parse_and_ignore(stream);
headers_raw.push((
HeaderName::Other(name),
HeaderOffset {
start: from_offset,
end: stream.pos,
},
));
}
HeaderParserResult::Lf => return true,
HeaderParserResult::Eof => return false,
}
}
}
pub fn parse_header_name<'x>(stream: &mut MessageStream<'x>) -> HeaderParserResult<'x> {
pub fn parse_header_name(data: &[u8]) -> (usize, HeaderParserResult) {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
let mut token_len: usize = 0;
let mut token_hash: usize = 0;
let mut last_ch: u8 = 0;
let mut bytes_read: usize = 0;
for ch in stream.data[stream.pos..].iter() {
stream.pos += 1;
for ch in data.iter() {
bytes_read += 1;
match ch {
b':' => {
if token_start != 0 {
let field = &stream.data[token_start - 1..token_end];
if (2..=25).contains(&token_len) {
token_hash +=
token_len + HDR_HASH[last_ch.to_ascii_lowercase() as usize] as usize;
if (4..=61).contains(&token_hash) {
let token_hash = token_hash - 4;
if field.eq_ignore_ascii_case(HDR_NAMES[token_hash]) {
return HeaderParserResult::Supported(HDR_FNCS[token_hash]);
}
}
}
return HeaderParserResult::Unsupported(field);
break;
}
}
b'\n' => {
stream.pos -= 1;
return HeaderParserResult::Lf;
return (bytes_read - 1, HeaderParserResult::Lf);
}
_ => {
if !(*ch).is_ascii_whitespace() {
if token_start == 0 {
token_start = stream.pos;
token_start = bytes_read;
token_end = token_start;
} else {
token_end = stream.pos;
token_end = bytes_read;
last_ch = *ch;
}
@@ -122,199 +130,269 @@ pub fn parse_header_name<'x>(stream: &mut MessageStream<'x>) -> HeaderParserResu
}
}
HeaderParserResult::Eof
if token_start != 0 {
let field = &data[token_start - 1..token_end];
if (2..=25).contains(&token_len) {
token_hash += token_len + HDR_HASH[last_ch.to_ascii_lowercase() as usize] as usize;
if (4..=72).contains(&token_hash) {
let token_hash = token_hash - 4;
if field.eq_ignore_ascii_case(HDR_NAMES[token_hash]) {
return (bytes_read, HeaderParserResult::Rfc(HDR_MAP[token_hash]));
}
}
}
return (
bytes_read,
HeaderParserResult::Other(String::from_utf8_lossy(field)),
);
} else {
(bytes_read, HeaderParserResult::Eof)
}
}
impl From<RfcHeader> for u8 {
fn from(name: RfcHeader) -> Self {
name as u8
}
}
#[cfg(test)]
mod tests {
use crate::parsers::{
fields::{parse_from, parse_mime_version, parse_received, parse_subject},
header::parse_header_name,
message::MessageStream,
};
use crate::{parsers::header::parse_header_name, RfcHeader};
use super::HeaderParserResult;
#[test]
fn header_name_parse() {
let inputs = [
("From: ", HeaderParserResult::Supported(parse_from)),
("receiVED: ", HeaderParserResult::Supported(parse_received)),
(
" subject : ",
HeaderParserResult::Supported(parse_subject),
),
("From: ", HeaderParserResult::Rfc(RfcHeader::From)),
("receiVED: ", HeaderParserResult::Rfc(RfcHeader::Received)),
(" subject : ", HeaderParserResult::Rfc(RfcHeader::Subject)),
(
"X-Custom-Field : ",
HeaderParserResult::Unsupported(b"X-Custom-Field"),
HeaderParserResult::Other("X-Custom-Field".into()),
),
(" T : ", HeaderParserResult::Unsupported(b"T")),
(" T : ", HeaderParserResult::Other("T".into())),
(
"mal formed: ",
HeaderParserResult::Unsupported(b"mal formed"),
HeaderParserResult::Other("mal formed".into()),
),
(
"MIME-version : ",
HeaderParserResult::Supported(parse_mime_version),
HeaderParserResult::Rfc(RfcHeader::MimeVersion),
),
];
for input in inputs {
let str = input.0.to_string();
match parse_header_name(&mut MessageStream::new(str.as_bytes())) {
HeaderParserResult::Supported(f) => {
if let HeaderParserResult::Supported(val) = input.1 {
if f as usize == val as usize {
continue;
}
}
}
HeaderParserResult::Unsupported(name) => {
if let HeaderParserResult::Unsupported(val) = input.1 {
if name == val {
continue;
}
}
}
_ => panic!("Eof/Lf for '{:?}'", input.0),
}
panic!("Failed to parse '{:?}'", input.0)
let (_, result) = parse_header_name(str.as_bytes());
assert_eq!(input.1, result, "Failed to parse '{:?}'", input.0);
}
}
}
#[allow(clippy::type_complexity)]
static HDR_PARSER: &[(
bool,
for<'x, 'y> fn(&mut MessageStream<'x>) -> HeaderValue<'x>,
)] = &[
(false, parse_unstructured), // Subject = 0,
(false, parse_address), // From = 1,
(false, parse_address), // To = 2,
(false, parse_address), // Cc = 3,
(false, parse_date), // Date = 4,
(false, parse_address), // Bcc = 5,
(false, parse_address), // ReplyTo = 6,
(false, parse_address), // Sender = 7,
(true, parse_unstructured), // Comments = 8,
(false, parse_id), // InReplyTo = 9,
(true, parse_comma_separared), // Keywords = 10,
(true, parse_raw), // Received = 11,
(false, parse_id), // MessageId = 12,
(true, parse_id), // References = 13, (RFC 5322 recommends One)
(false, parse_id), // ReturnPath = 14,
(false, parse_raw), // MimeVersion = 15,
(false, parse_unstructured), // ContentDescription = 16,
(false, parse_id), // ContentId = 17,
(false, parse_comma_separared), // ContentLanguage = 18
(false, parse_unstructured), // ContentLocation = 19
(false, parse_unstructured), // ContentTransferEncoding = 20,
(false, parse_content_type), // ContentType = 21,
(false, parse_content_type), // ContentDisposition = 22,
(true, parse_address), // ResentTo = 23,
(true, parse_address), // ResentFrom = 24,
(true, parse_address), // ResentBcc = 25,
(true, parse_address), // ResentCc = 26,
(true, parse_address), // ResentSender = 27,
(true, parse_date), // ResentDate = 28,
(true, parse_id), // ResentMessageId = 29,
(false, parse_address), // ListArchive = 30,
(false, parse_address), // ListHelp = 31,
(false, parse_address), // ListId = 32,
(false, parse_address), // ListOwner = 33,
(false, parse_address), // ListPost = 34,
(false, parse_address), // ListSubscribe = 35,
(false, parse_address), // ListUnsubscribe = 36,
(true, parse_raw), // Other = 37,
];
static HDR_HASH: &[u8] = &[
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 15, 5, 0, 0, 30, 5, 5, 15, 62, 20, 15, 20, 5, 30, 25, 62, 0, 0, 0, 62, 62, 62, 62, 10,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 0, 20, 5, 0, 0, 25, 0, 5, 20, 73, 25, 25, 30, 10, 10, 5, 73, 0, 0, 15, 73, 73, 73, 73, 20,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
];
static HDR_FNCS: &[for<'x, 'y> fn(&mut dyn MessageField<'x>, &mut MessageStream<'x>); 58] = &[
super::fields::parse_date,
super::fields::parse_no_op,
super::fields::parse_sender,
super::fields::parse_subject,
super::fields::parse_received,
super::fields::parse_no_op,
super::fields::parse_references,
super::fields::parse_resent_date,
super::fields::parse_cc,
super::fields::parse_comments,
super::fields::parse_resent_cc,
super::fields::parse_content_id,
super::fields::parse_return_path,
super::fields::parse_resent_message_id,
super::fields::parse_resent_sender,
super::fields::parse_no_op,
super::fields::parse_resent_bcc,
super::fields::parse_no_op,
super::fields::parse_list_id,
super::fields::parse_bcc,
super::fields::parse_list_post,
super::fields::parse_list_owner,
super::fields::parse_no_op,
super::fields::parse_content_type,
super::fields::parse_keywords,
super::fields::parse_content_description,
super::fields::parse_message_id,
super::fields::parse_no_op,
super::fields::parse_to,
super::fields::parse_no_op,
super::fields::parse_list_subscribe,
super::fields::parse_content_transfer_encoding,
super::fields::parse_no_op,
super::fields::parse_no_op,
super::fields::parse_reply_to,
super::fields::parse_resent_to,
super::fields::parse_no_op,
super::fields::parse_no_op,
super::fields::parse_list_archive,
super::fields::parse_no_op,
super::fields::parse_content_disposition,
super::fields::parse_no_op,
super::fields::parse_list_unsubscribe,
super::fields::parse_no_op,
super::fields::parse_no_op,
super::fields::parse_list_help,
super::fields::parse_no_op,
super::fields::parse_no_op,
super::fields::parse_mime_version,
super::fields::parse_no_op,
super::fields::parse_from,
super::fields::parse_no_op,
super::fields::parse_in_reply_to,
super::fields::parse_no_op,
super::fields::parse_no_op,
super::fields::parse_no_op,
super::fields::parse_no_op,
super::fields::parse_resent_from,
static HDR_MAP: &[RfcHeader] = &[
RfcHeader::Date,
RfcHeader::MimeVersion, // Invalid
RfcHeader::Sender,
RfcHeader::MimeVersion, // Invalid
RfcHeader::Received,
RfcHeader::MimeVersion, // Invalid
RfcHeader::References,
RfcHeader::MimeVersion, // Invalid
RfcHeader::Cc,
RfcHeader::Comments,
RfcHeader::ResentCc,
RfcHeader::ContentId,
RfcHeader::MimeVersion, // Invalid
RfcHeader::ResentMessageId,
RfcHeader::ReplyTo,
RfcHeader::ResentTo,
RfcHeader::ResentBcc,
RfcHeader::ContentLanguage,
RfcHeader::Subject,
RfcHeader::ResentSender,
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::ResentDate,
RfcHeader::To,
RfcHeader::Bcc,
RfcHeader::MimeVersion, // Invalid
RfcHeader::ContentTransferEncoding,
RfcHeader::ReturnPath,
RfcHeader::ListId,
RfcHeader::Keywords,
RfcHeader::ContentDescription,
RfcHeader::ListOwner,
RfcHeader::MimeVersion, // Invalid
RfcHeader::ContentType,
RfcHeader::MimeVersion, // Invalid
RfcHeader::ListHelp,
RfcHeader::MessageId,
RfcHeader::ContentLocation,
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::ListSubscribe,
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::ListPost,
RfcHeader::MimeVersion, // Invalid
RfcHeader::ResentFrom,
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::ContentDisposition,
RfcHeader::MimeVersion, // Invalid
RfcHeader::InReplyTo,
RfcHeader::ListArchive,
RfcHeader::MimeVersion, // Invalid
RfcHeader::From,
RfcHeader::MimeVersion, // Invalid
RfcHeader::ListUnsubscribe,
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion, // Invalid
RfcHeader::MimeVersion,
];
static HDR_NAMES: &[&[u8]; 58] = &[
static HDR_NAMES: &[&[u8]] = &[
b"date",
b"",
b"sender",
b"subject",
b"",
b"received",
b"",
b"references",
b"resent-date",
b"",
b"cc",
b"comments",
b"resent-cc",
b"content-id",
b"return-path",
b"",
b"resent-message-id",
b"reply-to",
b"resent-to",
b"resent-bcc",
b"content-language",
b"subject",
b"resent-sender",
b"",
b"resent-bcc",
b"",
b"list-id",
b"resent-date",
b"to",
b"bcc",
b"list-post",
b"",
b"content-transfer-encoding",
b"return-path",
b"list-id",
b"keywords",
b"content-description",
b"list-owner",
b"",
b"content-type",
b"keywords",
b"content-description",
b"message-id",
b"",
b"to",
b"list-help",
b"message-id",
b"content-location",
b"",
b"",
b"list-subscribe",
b"content-transfer-encoding",
b"",
b"",
b"reply-to",
b"resent-to",
b"",
b"",
b"list-archive",
b"list-post",
b"",
b"resent-from",
b"",
b"",
b"content-disposition",
b"",
b"in-reply-to",
b"list-archive",
b"",
b"from",
b"",
b"list-unsubscribe",
b"",
b"",
b"list-help",
b"",
b"",
b"",
b"",
b"",
b"",
b"",
b"",
b"mime-version",
b"",
b"from",
b"",
b"in-reply-to",
b"",
b"",
b"",
b"",
b"resent-from",
];
+126
View File
@@ -0,0 +1,126 @@
/*
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
use std::io::{BufRead, BufReader, Read};
/// Parses an MBox mailbox from a `Read` stream, returning each message as a
/// `Vec<u8>`.
/// supports >From quoting as defined in the [QMail mbox specification](http://qmail.org/qmail-manual-html/man5/mbox.html).
pub struct MBoxParser<T: Read> {
reader: BufReader<T>,
found_from: bool,
}
impl<T> MBoxParser<T>
where
T: Read,
{
pub fn new(reader: T) -> MBoxParser<T> {
MBoxParser {
reader: BufReader::new(reader),
found_from: false,
}
}
}
impl<T> Iterator for MBoxParser<T>
where
T: Read,
{
type Item = Vec<u8>;
fn next(&mut self) -> Option<Vec<u8>> {
let mut message = Vec::with_capacity(1024);
let mut message_line = Vec::with_capacity(80);
while self
.reader
.read_until(b'\n', &mut message_line)
.expect("Error while reading Mbox")
> 0
{
let is_from = message_line
.get(..5)
.map(|line| line == b"From ")
.unwrap_or(false);
if self.found_from {
if !is_from {
if message_line[0] != b'>' {
message.append(&mut message_line);
} else if message_line
.iter()
.skip_while(|&&ch| ch == b'>')
.take(5)
.copied()
.collect::<Vec<u8>>()
== b"From "
{
message.extend_from_slice(&message_line[1..]);
message_line.clear();
} else {
message.append(&mut message_line);
}
} else {
break;
}
} else {
if is_from {
self.found_from = true;
}
message_line.clear();
}
}
if !message.is_empty() {
Some(message)
} else {
None
}
}
}
#[cfg(test)]
mod tests {
use super::MBoxParser;
#[test]
fn parse_mbox() {
let message = br#"From Mon, 15 Jan 2018 15:30:00 +0100
Message 1
From Mon, 15 Jan 2018 15:30:00 +0100
Message 2
From Mon, 15 Jan 2018 15:30:00 +0100
Message 3
>From hello
>>From world
>>>From test
From Mon, 15 Jan 2018 15:30:00 +0100
Message 4
> From
>F
"#;
let mut parser = MBoxParser::new(&message[..]);
assert_eq!(parser.next().unwrap(), b"Message 1\n\n");
assert_eq!(parser.next().unwrap(), b"Message 2\n\n");
assert_eq!(
parser.next().unwrap(),
b"Message 3\nFrom hello\n>From world\n>>From test\n\n"
);
assert_eq!(parser.next().unwrap(), b"Message 4\n> From\n>F\n");
assert!(parser.next().is_none());
}
}
+421 -229
View File
@@ -1,6 +1,6 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* file at the top-level directory of this distribution.
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level dir&ectory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
@@ -13,19 +13,16 @@ use std::borrow::Cow;
use crate::{
decoders::{
base64::decode_base64,
charsets::map::get_charset_decoder,
html::{html_to_text, text_to_html},
quoted_printable::decode_quoted_printable,
DecodeFnc, DecodeResult,
base64::decode_base64, charsets::map::get_charset_decoder,
quoted_printable::decode_quoted_printable, DecodeFnc, DecodeResult,
},
BinaryPart, ContentType, InlinePart, Message, MessageHeader, MessagePart, MimeHeader, TextPart,
ContentType, HeaderValue, Message, MessageAttachment, MessagePart, MessagePartId, PartType,
RawHeaders, RfcHeader, RfcHeaders,
};
use super::{
fields::MessageField,
header::parse_headers,
mime::{get_bytes_to_boundary, seek_next_part, skip_crlf, skip_multipart_end},
mime::{get_bytes_to_boundary, seek_crlf, seek_next_part, skip_crlf, skip_multipart_end},
};
#[derive(Debug, PartialEq)]
@@ -42,6 +39,12 @@ enum MimeType {
Other,
}
impl Default for MimeType {
fn default() -> Self {
MimeType::Message
}
}
fn result_to_string<'x>(
result: DecodeResult,
data: &'x [u8],
@@ -99,7 +102,7 @@ fn get_mime_type(
_ => (false, false, true, MimeType::TextOther),
},
"image" | "audio" | "video" => (false, true, false, MimeType::Inline),
"message" if content_type.get_subtype() == Some("rfc822") => {
"message" if [Some("rfc822"), Some("global")].contains(&content_type.get_subtype()) => {
(false, false, false, MimeType::Message)
}
_ => (false, false, false, MimeType::Other),
@@ -111,6 +114,25 @@ fn get_mime_type(
}
}
#[inline(always)]
fn add_missing_type<'x>(
headers: &mut RfcHeaders<'x>,
c_type: Cow<'x, str>,
c_subtype: Cow<'x, str>,
) {
if headers.is_empty() {
headers.insert(
RfcHeader::ContentType,
HeaderValue::ContentType(ContentType {
c_type,
c_subtype: Some(c_subtype),
attributes: None,
}),
);
}
}
#[derive(Default, Debug)]
struct MessageParserState {
mime_type: MimeType,
mime_boundary: Option<Vec<u8>>,
@@ -120,6 +142,11 @@ struct MessageParserState {
text_parts: usize,
need_html_body: bool,
need_text_body: bool,
part_id: MessagePartId,
sub_part_ids: Vec<MessagePartId>,
offset_header: usize,
offset_body: usize,
offset_end: usize,
}
impl MessageParserState {
@@ -133,6 +160,7 @@ impl MessageParserState {
text_parts: 0,
need_text_body: true,
need_html_body: true,
..Default::default()
}
}
}
@@ -151,73 +179,81 @@ impl<'x> MessageStream<'x> {
impl<'x> Message<'x> {
fn new() -> Message<'x> {
Message {
header: Box::new(MessageHeader::new()),
..Default::default()
}
}
/// Returns `false` if at least one header field was successfully parsed.
pub fn is_empty(&self) -> bool {
self.header.is_empty()
self.parts.is_empty()
}
/// Parses a byte slice containing the RFC5322 raw message and returns a
/// `Message` struct.
///
/// This function never panics, a best-effort is made to parse the message and
/// if no headers are found and empty `Message` struct is returned.
/// To make sure parsing was successfull use `is_empty()`.
/// if no headers are found None is returned.
///
pub fn parse(bytes: &'x [u8]) -> Message<'x> {
let mut stream = MessageStream::new(bytes);
pub fn parse(raw_message: &'x [u8]) -> Option<Message<'x>> {
let mut stream = MessageStream::new(raw_message);
let mut message = Message::new();
let mut message_stack = Vec::new();
let mut state = MessageParserState::new();
let mut state_stack = Vec::new();
let mut state_stack = Vec::with_capacity(4);
let mut mime_part_header = MimeHeader::new();
let mut part_header = RfcHeaders::new();
let mut part_header_raw = RawHeaders::new();
'outer: loop {
// Obtain reference to either the message or the MIME part's header
let header: &mut dyn MessageField = if let MimeType::Message = state.mime_type {
message.header.as_mut()
} else {
&mut mime_part_header
};
// Parse headers
if !parse_headers(header, &mut stream) {
state.offset_header = stream.pos;
if !parse_headers(&mut part_header, &mut part_header_raw, &mut stream) {
break;
}
state.parts += 1;
state.sub_part_ids.push(message.parts.len());
let content_type = part_header
.get(&RfcHeader::ContentType)
.and_then(|c| c.as_content_type_ref());
let (is_multipart, mut is_inline, mut is_text, mut mime_type) =
get_mime_type(header.get_content_type(), &state.mime_type);
get_mime_type(content_type, &state.mime_type);
if is_multipart {
if let Some(mime_boundary) = header
.get_content_type()
.map_or_else(|| None, |f| f.get_attribute("boundary"))
if let Some(mime_boundary) =
content_type.map_or_else(|| None, |f| f.get_attribute("boundary"))
{
let mime_boundary = ("\n--".to_string() + mime_boundary).into_bytes();
let mime_boundary = format!("\n--{}", mime_boundary).into_bytes();
state.offset_body = seek_crlf(&stream, stream.pos);
if seek_next_part(&mut stream, mime_boundary.as_ref()) {
let part_id = message.parts.len();
let new_state = MessageParserState {
in_alternative: state.in_alternative
|| mime_type == MimeType::MultipartAlernative,
mime_type,
mime_boundary: mime_boundary.into(),
parts: 0,
html_parts: message.html_body.len(),
text_parts: message.text_body.len(),
need_html_body: state.need_html_body,
need_text_body: state.need_text_body,
part_id,
..Default::default()
};
mime_part_header.clear();
state_stack.push(state);
add_missing_type(&mut part_header, "text".into(), "plain".into());
message.parts.push(MessagePart {
headers_rfc: std::mem::take(&mut part_header),
headers_raw: std::mem::take(&mut part_header_raw),
offset_header: state.offset_header,
offset_body: state.offset_body,
offset_end: 0,
is_encoding_problem: false,
body: PartType::default(),
});
state_stack.push((state, None));
state = new_state;
skip_crlf(&mut stream);
continue;
@@ -226,38 +262,51 @@ impl<'x> Message<'x> {
is_text = true;
}
}
} else if mime_type == MimeType::Message {
let new_state = MessageParserState {
mime_type: MimeType::Message,
mime_boundary: state.mime_boundary.take(),
in_alternative: false,
parts: 0,
html_parts: 0,
text_parts: 0,
need_html_body: true,
need_text_body: true,
};
mime_part_header.clear();
message_stack.push(message);
state_stack.push(state);
message = Message::new();
state = new_state;
skip_crlf(&mut stream);
continue;
}
skip_crlf(&mut stream);
state.offset_body = stream.pos;
let (is_binary, decode_fnc): (bool, DecodeFnc) = match header
.get_content_transfer_encoding()
let (is_binary, decode_fnc): (bool, DecodeFnc) = match part_header
.get(&RfcHeader::ContentTransferEncoding)
{
Some(encoding) if encoding.eq_ignore_ascii_case("base64") => (false, decode_base64),
Some(encoding) if encoding.eq_ignore_ascii_case("quoted-printable") => {
Some(HeaderValue::Text(encoding)) if encoding.eq_ignore_ascii_case("base64") => {
(false, decode_base64)
}
Some(HeaderValue::Text(encoding))
if encoding.eq_ignore_ascii_case("quoted-printable") =>
{
(false, decode_quoted_printable)
}
_ => (true, get_bytes_to_boundary),
};
if is_binary && mime_type == MimeType::Message {
let new_state = MessageParserState {
mime_type: MimeType::Message,
mime_boundary: state.mime_boundary.take(),
need_html_body: true,
need_text_body: true,
part_id: message.parts.len(),
..Default::default()
};
add_missing_type(&mut part_header, "message".into(), "rfc822".into());
message.attachments.push(message.parts.len());
message.parts.push(MessagePart {
headers_rfc: std::mem::take(&mut part_header),
headers_raw: std::mem::take(&mut part_header_raw),
is_encoding_problem: false,
offset_header: state.offset_header,
offset_body: state.offset_body,
offset_end: 0,
body: PartType::default(), // Temp value, will be replaced later.
});
state_stack.push((state, message.into()));
message = Message::new();
state = new_state;
continue;
}
let (bytes_read, mut bytes) = decode_fnc(
&stream,
stream.pos,
@@ -269,155 +318,192 @@ impl<'x> Message<'x> {
);
// Attempt to recover contents of an invalid message
if bytes_read == 0 {
if stream.pos >= stream.data.len() || (is_binary && state.mime_boundary.is_none()) {
break;
}
let is_encoding_problem = bytes_read == 0;
if is_encoding_problem {
let did_recover = if !(stream.pos >= stream.data.len()
|| (is_binary && state.mime_boundary.is_none()))
{
// Get raw MIME part
let (bytes_read, r_bytes) = if !is_binary {
get_bytes_to_boundary(
&stream,
stream.pos,
state
.mime_boundary
.as_ref()
.map_or_else(|| &[][..], |b| &b[..]),
false,
)
} else {
(0, DecodeResult::Empty)
};
// Get raw MIME part
let (bytes_read, r_bytes) = if !is_binary {
get_bytes_to_boundary(
&stream,
stream.pos,
state
.mime_boundary
.as_ref()
.map_or_else(|| &[][..], |b| &b[..]),
false,
)
} else {
(0, DecodeResult::Empty)
};
if bytes_read == 0 {
// If there is MIME boundary, ignore it and get raw message
if state.mime_boundary.is_some() {
let (bytes_read, r_bytes) =
get_bytes_to_boundary(&stream, stream.pos, &[][..], false);
if bytes_read > 0 {
bytes = r_bytes;
stream.pos += bytes_read;
if bytes_read == 0 {
// If there is a MIME boundary, ignore it and get raw message
if state.mime_boundary.is_some() {
let (bytes_read, r_bytes) =
get_bytes_to_boundary(&stream, stream.pos, &[][..], false);
if bytes_read > 0 {
bytes = r_bytes;
stream.pos += bytes_read;
true
} else {
false
}
} else {
break;
false
}
} else {
break;
bytes = r_bytes;
stream.pos += bytes_read;
true
}
} else {
bytes = r_bytes;
stream.pos += bytes_read;
false
};
if did_recover {
mime_type = MimeType::TextOther;
is_inline = false;
is_text = true;
} else {
// Could not recover error, add part and abort
message.parts.push(MessagePart {
headers_rfc: std::mem::take(&mut part_header),
headers_raw: std::mem::take(&mut part_header_raw),
is_encoding_problem: true,
body: PartType::Binary((&[][..]).into()),
offset_header: state.offset_header,
offset_body: state.offset_body,
offset_end: stream.pos,
});
break;
}
mime_type = MimeType::TextOther;
is_inline = false;
is_text = true;
} else {
stream.pos += bytes_read;
}
state.offset_end = state
.mime_boundary
.as_ref()
.map(|b| stream.pos.saturating_sub(b.len() - 1))
.unwrap_or(stream.pos);
let is_inline = is_inline
&& header
.get_content_disposition()
.map_or_else(|| true, |d| !d.is_attachment())
&& (state.parts == 1
|| (state.mime_type != MimeType::MultipartRelated
&& (mime_type == MimeType::Inline
|| header
.get_content_type()
.map_or_else(|| true, |c| !c.has_attribute("name")))));
let body_part = if mime_type != MimeType::Message {
let is_inline = is_inline
&& part_header
.get(&RfcHeader::ContentDisposition)
.map_or_else(|| true, |d| !d.get_content_type().is_attachment())
&& (state.parts == 1
|| (state.mime_type != MimeType::MultipartRelated
&& (mime_type == MimeType::Inline
|| content_type
.map_or_else(|| true, |c| !c.has_attribute("name")))));
let (add_to_html, add_to_text) = if let MimeType::MultipartAlernative = state.mime_type
{
match mime_type {
MimeType::TextHtml => (true, false),
MimeType::TextPlain => (false, true),
_ => (false, false),
}
} else if is_inline {
if state.in_alternative && (state.need_text_body || state.need_html_body) {
match mime_type {
MimeType::TextHtml => {
state.need_text_body = false;
let (add_to_html, add_to_text) =
if let MimeType::MultipartAlernative = state.mime_type {
match mime_type {
MimeType::TextHtml => (true, false),
MimeType::TextPlain => (false, true),
_ => (false, false),
}
MimeType::TextPlain => {
state.need_html_body = false;
} else if is_inline {
if state.in_alternative && (state.need_text_body || state.need_html_body) {
match mime_type {
MimeType::TextHtml => {
state.need_text_body = false;
}
MimeType::TextPlain => {
state.need_html_body = false;
}
_ => (),
}
}
_ => (),
(state.need_html_body, state.need_text_body)
} else {
(false, false)
};
if is_text {
let text = result_to_string(bytes, stream.data, content_type);
let is_html = mime_type == MimeType::TextHtml;
add_missing_type(&mut part_header, "text".into(), "plain".into());
if add_to_html && !is_html {
message.html_body.push(message.parts.len());
} else if add_to_text && is_html {
message.text_body.push(message.parts.len());
}
if add_to_html && is_html {
message.html_body.push(message.parts.len());
} else if add_to_text && !is_html {
message.text_body.push(message.parts.len());
} else {
message.attachments.push(message.parts.len());
}
if is_html {
PartType::Html(text)
} else {
PartType::Text(text)
}
} else {
if add_to_html {
message.html_body.push(message.parts.len());
}
if add_to_text {
message.text_body.push(message.parts.len());
}
message.attachments.push(message.parts.len());
let bytes = result_to_bytes(bytes, stream.data);
if !is_inline {
PartType::Binary(bytes)
} else {
PartType::InlineBinary(bytes)
}
}
(state.need_html_body, state.need_text_body)
} else {
(false, false)
add_missing_type(&mut part_header, "message".into(), "rfc822".into());
message.attachments.push(message.parts.len());
PartType::Message(MessageAttachment::Raw(result_to_bytes(bytes, stream.data)))
};
if is_text {
let text_part = TextPart {
contents: result_to_string(bytes, stream.data, header.get_content_type()),
header: if !mime_part_header.is_empty() {
Some(std::mem::take(&mut mime_part_header))
} else {
None
},
};
let is_html = mime_type == MimeType::TextHtml;
if add_to_html && !is_html {
message.html_body.push(InlinePart::Text(TextPart {
header: None,
contents: text_to_html(&text_part.contents).into(),
}));
} else if add_to_text && is_html {
message.text_body.push(InlinePart::Text(TextPart {
header: None,
contents: html_to_text(&text_part.contents).into(),
}));
}
if add_to_html && is_html {
message.html_body.push(InlinePart::Text(text_part));
} else if add_to_text && !is_html {
message.text_body.push(InlinePart::Text(text_part));
} else {
message.attachments.push(MessagePart::Text(text_part));
}
} else {
let binary_part = BinaryPart {
header: if !mime_part_header.is_empty() {
Some(std::mem::take(&mut mime_part_header))
} else {
None
},
contents: result_to_bytes(bytes, stream.data),
};
if add_to_html {
message
.html_body
.push(InlinePart::InlineBinary(message.attachments.len() as u32));
}
if add_to_text {
message
.text_body
.push(InlinePart::InlineBinary(message.attachments.len() as u32));
}
message.attachments.push(if !is_inline {
MessagePart::Binary(binary_part)
} else {
MessagePart::InlineBinary(binary_part)
});
};
// Add part
message.parts.push(MessagePart {
headers_rfc: std::mem::take(&mut part_header),
headers_raw: std::mem::take(&mut part_header_raw),
is_encoding_problem,
body: body_part,
offset_header: state.offset_header,
offset_body: state.offset_body,
offset_end: state.offset_end,
});
if state.mime_boundary.is_some() {
// Currently processing a MIME part
'inner: loop {
if let MimeType::Message = state.mime_type {
// Finished processing nested message, restore parent message from stack
if let (Some(mut prev_message), Some(mut prev_state)) =
(message_stack.pop(), state_stack.pop())
{
prev_message.attachments.push(MessagePart::Message(message));
// Finished processing a nested message, restore parent message from stack
if let Some((mut prev_state, Some(mut prev_message))) = state_stack.pop() {
let offset_end = state
.mime_boundary
.as_ref()
.map(|b| stream.pos.saturating_sub(b.len() - 1))
.unwrap_or(stream.pos);
message.raw_message =
raw_message[state.offset_header..offset_end].as_ref().into();
if let Some(part) = prev_message.parts.get_mut(state.part_id) {
part.body =
PartType::Message(MessageAttachment::Parsed(Box::new(message)));
part.offset_end = offset_end;
} else {
debug_assert!(false, "Invalid part ID, could not find message.");
}
message = prev_message;
prev_state.mime_boundary = state.mime_boundary;
state = prev_state;
@@ -438,16 +524,8 @@ impl<'x> Message<'x> {
if state.text_parts == message.text_body.len()
&& state.html_parts != message.html_body.len()
{
for part in message.html_body[state.html_parts..].iter() {
message.text_body.push(match part {
InlinePart::Text(part) => InlinePart::Text(TextPart {
header: None,
contents: html_to_text(&part.contents).into(),
}),
InlinePart::InlineBinary(index) => {
InlinePart::InlineBinary(*index)
}
});
for &part_id in &message.html_body[state.html_parts..] {
message.text_body.push(part_id);
}
}
@@ -455,21 +533,23 @@ impl<'x> Message<'x> {
if state.html_parts == message.html_body.len()
&& state.text_parts != message.text_body.len()
{
for part in message.text_body[state.text_parts..].iter() {
message.html_body.push(match part {
InlinePart::Text(part) => InlinePart::Text(TextPart {
header: None,
contents: text_to_html(&part.contents).into(),
}),
InlinePart::InlineBinary(index) => {
InlinePart::InlineBinary(*index)
}
});
for &part_id in &message.text_body[state.html_parts..] {
message.html_body.push(part_id);
}
}
}
if let Some(prev_state) = state_stack.pop() {
if let Some(part) = message.parts.get_mut(state.part_id) {
// Update end offset
part.offset_end = seek_crlf(&stream, stream.pos);
// Add headers and substructure to parent part
part.body =
PartType::Multipart(std::mem::take(&mut state.sub_part_ids));
} else {
debug_assert!(false, "Invalid part ID, could not find multipart.");
}
if let Some((prev_state, _)) = state_stack.pop() {
// Restore ancestor's state
state = prev_state;
@@ -480,6 +560,7 @@ impl<'x> Message<'x> {
}
}
}
break 'outer;
} else {
skip_crlf(&mut stream);
@@ -492,25 +573,99 @@ impl<'x> Message<'x> {
}
}
while let Some(mut prev_message) = message_stack.pop() {
prev_message.attachments.push(MessagePart::Message(message));
message = prev_message;
// Corrupted MIME message, try to recover whatever is possible.
while let Some((prev_state, prev_message)) = state_stack.pop() {
if let Some(mut prev_message) = prev_message {
message.raw_message = raw_message[state.offset_header..stream.pos].as_ref().into();
if let Some(part) = prev_message.parts.get_mut(state.part_id) {
part.body = PartType::Message(MessageAttachment::Parsed(Box::new(message)));
part.offset_end = stream.pos;
} else {
debug_assert!(false, "Invalid part ID, could not find message.");
}
message = prev_message;
} else if let Some(part) = message.parts.get_mut(state.part_id) {
part.offset_end = stream.pos;
part.body = PartType::Multipart(state.sub_part_ids);
} else {
debug_assert!(false, "This should not have happened.");
}
state = prev_state;
}
message
message.raw_message = raw_message.into();
if !message.is_empty() {
Some(message)
} else {
None
}
}
}
#[cfg(test)]
mod tests {
use std::{fs, path::PathBuf};
use std::{collections::BTreeMap, fs, path::PathBuf};
use crate::parsers::message::Message;
use serde::Serialize;
use serde_json::Value;
use crate::{
parsers::message::Message, HeaderValue, MessagePart, MessagePartId, PartType, RawHeaders,
RfcHeader,
};
const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----".as_bytes();
#[derive(Serialize)]
pub struct SortedMessage<'x> {
pub html_body: Vec<MessagePartId>,
pub text_body: Vec<MessagePartId>,
pub attachments: Vec<MessagePartId>,
pub parts: Vec<SortedMessagePart<'x>>,
}
#[derive(Serialize)]
pub struct SortedMessagePart<'x> {
pub headers_rfc: BTreeMap<RfcHeader, HeaderValue<'x>>,
pub headers_raw: RawHeaders<'x>,
pub is_encoding_problem: bool,
pub body: PartType<'x>,
pub offset_header: usize,
pub offset_body: usize,
pub offset_end: usize,
}
impl<'x> From<Message<'x>> for SortedMessage<'x> {
fn from(message: Message<'x>) -> Self {
SortedMessage {
html_body: message.html_body,
text_body: message.text_body,
attachments: message.attachments,
parts: message.parts.into_iter().map(|p| p.into()).collect(),
}
}
}
impl<'x> From<MessagePart<'x>> for SortedMessagePart<'x> {
fn from(part: MessagePart<'x>) -> Self {
SortedMessagePart {
headers_rfc: part.headers_rfc.into_iter().collect(),
headers_raw: part.headers_raw,
is_encoding_problem: part.is_encoding_problem,
body: part.body,
offset_header: part.offset_header,
offset_body: part.offset_body,
offset_end: part.offset_end,
}
}
}
#[test]
fn parse_full_messages() {
const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----\n".as_bytes();
for test_suite in ["rfc", "legacy", "thirdparty", "malformed"] {
for test_suite in ["malformed", "rfc", "legacy", "thirdparty", "malformed"] {
let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
test_dir.push("tests");
test_dir.push(test_suite);
@@ -538,17 +693,19 @@ mod tests {
tests_run += 1;
let input = input.split_at_mut(pos);
let message = Message::parse(input.0);
assert!(!message.is_empty());
let (raw_message, expected_result) = input.split_at_mut(pos);
let message = SortedMessage::from(Message::parse(raw_message).unwrap());
let json_message = serde_json::to_string_pretty(&message).unwrap();
assert_eq!(
message,
serde_json::from_slice::<Message>(&input.1[SEPARATOR.len()..]).unwrap(),
serde_json::from_str::<Value>(&json_message).unwrap(),
serde_json::from_str::<Value>(
std::str::from_utf8(&expected_result[SEPARATOR.len()..]).unwrap()
)
.unwrap(),
"Test failed for '{}', result was:\n{}",
file_name.display(),
serde_json::to_string_pretty(&message).unwrap()
json_message
);
}
}
@@ -562,26 +719,59 @@ mod tests {
}
/*#[test]
fn generate_test_samples() {
const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----\n".as_bytes();
fn message_to_yaml() {
let mut file_name = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
file_name.push("tests");
file_name.push("rfc");
file_name.push("003.txt");
for test_suite in ["malformed" /*"legacy","malformed"*/] {
let mut input = fs::read(&file_name).unwrap();
let mut pos = 0;
for sep_pos in 0..input.len() {
if input[sep_pos..sep_pos + SEPARATOR.len()].eq(SEPARATOR) {
pos = sep_pos;
break;
}
}
assert!(
pos > 0,
"Failed to find separator in test file '{}'.",
file_name.display()
);
let input = input.split_at_mut(pos).0;
let message = Message::parse(input).unwrap();
let result = serde_yaml::to_string(&message).unwrap();
fs::write("test.yaml", &result).unwrap();
println!("{:}", result);
}
#[test]
fn generate_test_samples() {
const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----".as_bytes();
for test_suite in ["legacy", "malformed", "rfc", "thirdparty"] {
let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
test_dir.push("tests");
test_dir.push(test_suite);
for file_name in fs::read_dir(test_dir).unwrap() {
/*if !file_name
if file_name
.as_ref()
.unwrap()
.path()
.to_str()
.unwrap()
.contains("001")
.contains("COPYING")
{
continue;
}*/
}
println!("{:}", file_name.as_ref().unwrap().path().display());
let mut input = fs::read(file_name.as_ref().unwrap().path()).unwrap();
let mut pos = 0;
for sep_pos in 0..input.len() {
@@ -602,9 +792,11 @@ mod tests {
output.extend_from_slice(input.0);
output.extend_from_slice(SEPARATOR);
output.extend_from_slice(
serde_json::to_string_pretty(&Message::parse(input.0))
.unwrap_or_else(|_| "".to_string())
.as_bytes(),
serde_json::to_string_pretty(&SortedMessage::from(
Message::parse(input.0).unwrap(),
))
.unwrap()
.as_bytes(),
);
fs::write(file_name.as_ref().unwrap().path(), &output).unwrap();
}
+39 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -19,7 +19,7 @@ pub fn seek_next_part(stream: &mut MessageStream, boundary: &[u8]) -> bool {
let mut match_count = 0;
for ch in stream.data[pos..].iter() {
for ch in &stream.data[pos..] {
pos += 1;
if ch == &boundary[match_count] {
@@ -52,17 +52,21 @@ pub fn get_bytes_to_boundary<'x>(
) -> (usize, DecodeResult) {
let mut read_pos = start_pos;
return if !boundary.is_empty() {
if !boundary.is_empty() {
let mut match_count = 0;
for ch in stream.data[read_pos..].iter() {
for ch in &stream.data[read_pos..] {
read_pos += 1;
if ch == &boundary[match_count] {
match_count += 1;
if match_count == boundary.len() {
if is_boundary_end(stream, read_pos) {
let match_pos = read_pos - match_count;
let mut match_pos = read_pos - match_count;
if let Some(b'\r') = stream.data.get(match_pos.saturating_sub(1)) {
match_pos -= 1;
}
return (
read_pos - start_pos,
@@ -95,7 +99,7 @@ pub fn get_bytes_to_boundary<'x>(
)
} else {
(0, DecodeResult::Empty)
};
}
}
#[inline(always)]
@@ -123,7 +127,7 @@ pub fn skip_multipart_end(stream: &mut MessageStream) -> bool {
#[inline(always)]
pub fn skip_crlf(stream: &mut MessageStream) {
for ch in stream.data[stream.pos..].iter() {
for ch in &stream.data[stream.pos..] {
match ch {
b'\r' | b' ' | b'\t' => stream.pos += 1,
b'\n' => {
@@ -134,3 +138,31 @@ pub fn skip_crlf(stream: &mut MessageStream) {
}
}
}
#[inline(always)]
pub fn seek_crlf_end(stream: &MessageStream, mut start_pos: usize) -> usize {
for ch in &stream.data[start_pos..] {
if ch.is_ascii_whitespace() {
start_pos += 1;
} else {
break;
}
}
start_pos
}
#[inline(always)]
pub fn seek_crlf(stream: &MessageStream, mut start_pos: usize) -> usize {
for ch in &stream.data[start_pos..] {
match ch {
b'\r' | b' ' | b'\t' => start_pos += 1,
b'\n' => {
start_pos += 1;
break;
}
_ => break,
}
}
start_pos
}
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -11,5 +11,7 @@
pub mod fields;
pub mod header;
pub mod mbox;
pub mod message;
pub mod mime;
pub mod preview;
+173
View File
@@ -0,0 +1,173 @@
/*
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
use std::borrow::Cow;
use crate::decoders::html::html_to_text;
pub fn preview_html<'x, 'y>(html: Cow<'y, str>, max_len: usize) -> Cow<'x, str> {
preview_text(html_to_text(html.as_ref()).into(), max_len)
}
pub fn preview_text<'x, 'y>(text: Cow<'y, str>, max_len: usize) -> Cow<'x, str> {
if text.len() > max_len {
let mut result = String::with_capacity(max_len);
for ch in text.chars() {
if ch.len_utf8() + result.len() + 3 > max_len {
break;
}
result.push(ch);
}
result.push_str("...");
result.into()
} else {
text.into_owned().into()
}
}
pub fn truncate_text<'x, 'y>(text: Cow<'y, str>, max_len: usize) -> Cow<'x, str> {
preview_text(text, max_len)
}
pub fn truncate_html<'x, 'y>(html: Cow<'y, str>, max_len: usize) -> Cow<'x, str> {
if html.len() > max_len {
let mut result = String::with_capacity(max_len);
let mut in_tag = false;
let mut in_comment = false;
let mut last_tag_end_pos = 0;
for (pos, ch) in html.char_indices() {
let mut set_last_tag = 0;
match ch {
'<' if !in_tag => {
in_tag = true;
if let Some("!--") = html.get(pos + 1..pos + 4) {
in_comment = true;
}
set_last_tag = pos;
}
'>' if in_tag => {
if in_comment {
if let Some("--") = html.get(pos - 2..pos) {
in_comment = false;
in_tag = false;
set_last_tag = pos + 1;
}
} else {
in_tag = false;
set_last_tag = pos + 1;
}
}
_ => (),
}
if ch.len_utf8() + pos + 3 > max_len {
result.push_str(
&html[0..if (in_tag || set_last_tag > 0) && last_tag_end_pos > 0 {
last_tag_end_pos
} else {
pos
}],
);
result.push_str("...");
break;
} else if set_last_tag > 0 {
last_tag_end_pos = set_last_tag;
}
}
result.into()
} else {
html.into_owned().into()
}
}
#[cfg(test)]
mod tests {
#[test]
fn text_preview() {
let text_1 = concat!(
"J'interdis aux marchands de vanter trop leurs marchandises. ",
"Car ils se fontvite pédagogues et t'enseignent comme but ce qui ",
"n'est par essence qu'un moyen, et te trompant ainsi sur la route ",
"à suivre les voilà bientôt qui te dégradent, car si leur musique ",
"est vulgaire ils te fabriquent pour te la vendre une âme vulgaire.\n",
"— Antoine de Saint-Exupéry, Citadelle (1948)"
);
let text_2 = concat!(
"長沮、桀溺耦而耕,孔子過之,使子路問津焉。長沮曰:「夫執輿者為誰?」",
"子路曰:「為孔丘。」曰:「是魯孔丘與?」曰:「是也。」曰:「是知津矣。」問於桀溺,",
"桀溺曰:「子為誰?」曰:「為仲由。」曰:「是魯孔丘之徒與?」對曰:「然。",
"」曰:「滔滔者天下皆是也,而誰以易之?且而與其從辟人之士也,豈若從",
"辟世之士哉?」耰而不輟。子路行以告。夫子憮然曰:「鳥獸不可與同群,吾非斯人之徒",
"與而誰與?天下有道,丘不與易也。」",
"子路從而後,遇丈人,以杖荷蓧。子路問曰:「子見夫子乎?」丈人曰:「四體不勤,",
"五穀不分。孰為夫子?」植其杖而芸。子路拱而立。止子路宿,殺雞為黍而食之,見其二",
"子焉。明日,子路行以告。子曰:「隱者也。」使子路反見之。至則行矣。子路曰:「",
"不仕無義。長幼之節,不可廢也;君臣之義,如之何其廢之?欲潔其身,而亂大倫。君",
"子之仕也,行其義也。道之不行,已知之矣。」"
);
assert_eq!(
super::truncate_text(text_1.into(), 110),
"J'interdis aux marchands de vanter trop leurs marchandises. Car ils se fontvite pédagogues et t'enseignent..."
);
assert_eq!(
super::truncate_text(text_2.into(), 110),
"長沮、桀溺耦而耕,孔子過之,使子路問津焉。長沮曰:「夫執輿者為誰?」子..."
);
}
#[test]
fn html_truncate() {
for (html, expected_result) in [
(
"<html>hello<br/>world<br/></html>",
"<html>hello<br/>world...",
),
("<html>using &lt;><br/></html>", "<html>using &lt;><br/>..."),
(
"test <not br/>tag<br />test <not br/>tag<br />",
"test <not br/>tag...",
),
(
"<>< ><tag\n/>>hello world< br \n />",
"<>< ><tag\n/>>hello ...",
),
(
concat!(
"<head><title>ignore head</title><not head>xyz</not head></head>",
"<h1>&lt;body&gt;</h1>"
),
"<head><title>ignore he...",
),
(
concat!(
"<p>what is &heartsuit;?</p><p>&#x000DF;&Abreve;&#914;&gamma; ",
"don&apos;t hurt me.</p>"
),
"<p>what is &heartsuit;...",
),
(
"<!-- <> < < < -->the actual<!--> text",
"<!-- <> < < < -->the a...",
),
(
" < p > hello < / p > < p > world < / p > !!! < br > ",
" < p > hello ...",
),
(
" <p>please unsubscribe <a href=#>here</a>.</p> ",
" <p>please unsubscribe...",
),
] {
assert_eq!(super::truncate_html(html.into(), 25), expected_result);
}
}
}
+83 -84
View File
@@ -1,5 +1,5 @@
/*
* Copyright Stalwart Labs, Minter Ltd. See the COPYING
* Copyright Stalwart Labs Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -13,75 +13,79 @@ use mail_parser::*;
#[test]
fn test_api() {
let input = concat!(
"From: Art Vandelay <art@vandelay.com> (Vandelay Industries)\n",
"To: \"Colleagues\": \"James Smythe\" <james@vandelay.com>; Friends:\n",
" jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;\n",
"Date: Sat, 20 Nov 2021 14:22:01 -0800\n",
"Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?=\n",
"Content-Type: multipart/mixed; boundary=\"festivus\";\n\n",
"--festivus\n",
"Content-Type: text/html; charset=\"us-ascii\"\n",
"Content-Transfer-Encoding: base64\n\n",
"PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle\n",
"HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm\n",
"cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8\n",
"gJiN4MjYzQTs8L3A+PC9odG1sPg==\n",
"--festivus\n",
"Content-Type: message/rfc822\n\n",
"From: \"Cosmo Kramer\" <kramer@kramerica.com>\n",
"Subject: Exporting my book about coffee tables\n",
"Content-Type: multipart/mixed; boundary=\"giddyup\";\n\n",
"--giddyup\n",
"Content-Type: text/plain; charset=\"utf-16\"\n",
"Content-Transfer-Encoding: quoted-printable\n\n",
"=FF=FE=0C!5=D8\"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8\"=DD =005=D8\"=\n",
"=DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD =\n",
"=005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8\"=\n",
"=DD5=D8=1E=DD5=D80=DD5=D8\"=DD!=00\n",
"--giddyup\n",
"Content-Type: image/gif; name*1=\"about \"; name*0=\"Book \";\n",
" name*2*=utf-8''%e2%98%95 tables.gif\n",
"Content-Transfer-Encoding: Base64\n",
"Content-Disposition: attachment\n\n",
"R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\n",
"--giddyup--\n",
"--festivus--\n",
)
.as_bytes();
let input = br#"From: Art Vandelay <art@vandelay.com> (Vandelay Industries)
To: "Colleagues": "James Smythe" <james@vandelay.com>; Friends:
jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>;
Date: Sat, 20 Nov 2021 14:22:01 -0800
Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?=
Content-Type: multipart/mixed; boundary="festivus";
let message = Message::parse(input);
--festivus
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: base64
PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle
HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm
cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8
gJiN4MjYzQTs8L3A+PC9odG1sPg==
--festivus
Content-Type: message/rfc822
From: "Cosmo Kramer" <kramer@kramerica.com>
Subject: Exporting my book about coffee tables
Content-Type: multipart/mixed; boundary="giddyup";
--giddyup
Content-Type: text/plain; charset="utf-16"
Content-Transfer-Encoding: quoted-printable
=FF=FE=0C!5=D8"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8"=DD =005=D8"=
=DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD =
=005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8"=
=DD5=D8=1E=DD5=D80=DD5=D8"=DD!=00
--giddyup
Content-Type: image/gif; name*1="about "; name*0="Book ";
name*2*=utf-8''%e2%98%95 tables.gif
Content-Transfer-Encoding: Base64
Content-Disposition: attachment
R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
--giddyup--
--festivus--
"#;
let message = Message::parse(input).unwrap();
assert_eq!(
bincode::deserialize::<RfcHeaders>(
&bincode::serialize(&message.parts[0].headers_rfc).unwrap()
)
.unwrap(),
message.parts[0].headers_rfc
);
assert_eq!(
message.get_from(),
&Address::Address(Addr {
name: Some("Art Vandelay (Vandelay Industries)".into()),
address: Some("art@vandelay.com".into())
})
&HeaderValue::Address(Addr::new(
"Art Vandelay (Vandelay Industries)".into(),
"art@vandelay.com"
))
);
assert_eq!(
message.get_to(),
&Address::GroupList(vec![
Group {
name: Some("Colleagues".into()),
addresses: vec![Addr {
name: Some("James Smythe".into()),
address: Some("james@vandelay.com".into())
}]
},
Group {
name: Some("Friends".into()),
addresses: vec![
Addr {
name: None,
address: Some("jane@example.com".into())
},
Addr {
name: Some("John Smîth".into()),
address: Some("john@example.com".into())
}
&HeaderValue::GroupList(vec![
Group::new(
"Colleagues",
vec![Addr::new("James Smythe".into(), "james@vandelay.com")]
),
Group::new(
"Friends",
vec![
Addr::new(None, "jane@example.com"),
Addr::new("John Smîth".into(), "john@example.com"),
]
}
)
])
);
@@ -89,57 +93,52 @@ fn test_api() {
message.get_date().unwrap().to_iso8601(),
"2021-11-20T14:22:01-08:00"
);
assert_eq!(
message.get_subject().unwrap(),
"Why not both importing AND exporting? ☺"
);
assert_eq!(
message.get_html_body(0).unwrap().to_string(),
message.get_html_body(0).unwrap(),
concat!(
"<html><p>I was thinking about quitting the &ldquo;exporting&rdquo; to ",
"focus just on the &ldquo;importing&rdquo;,</p><p>but then I thought,",
" why not do both? &#x263A;</p></html>"
)
);
assert_eq!(
message.get_text_body(0).unwrap().to_string(),
message.get_text_body(0).unwrap(),
concat!(
"I was thinking about quitting the “exporting” to focus just on the",
" “importing”,\nbut then I thought, why not do both? ☺\n"
)
);
let nested_message = match message.get_attachment(0).unwrap() {
MessagePart::Message(v) => v,
_ => unreachable!(),
};
let nested_message = message.get_attachment(0).unwrap().get_message().unwrap();
assert_eq!(
nested_message.get_subject().unwrap(),
"Exporting my book about coffee tables"
);
assert_eq!(
nested_message.get_text_body(0).unwrap().to_string(),
nested_message.get_text_body(0).unwrap(),
"ℌ𝔢𝔩𝔭 𝔪𝔢 𝔢𝔵𝔭𝔬𝔯𝔱 𝔪𝔶 𝔟𝔬𝔬𝔨 𝔭𝔩𝔢𝔞𝔰𝔢!"
);
assert_eq!(
nested_message.get_html_body(0).unwrap().to_string(),
nested_message.get_html_body(0).unwrap(),
"<html><body>ℌ𝔢𝔩𝔭 𝔪𝔢 𝔢𝔵𝔭𝔬𝔯𝔱 𝔪𝔶 𝔟𝔬𝔬𝔨 𝔭𝔩𝔢𝔞𝔰𝔢!</body></html>"
);
let nested_attachment = match nested_message.get_attachment(0).unwrap() {
MessagePart::Binary(v) => v,
_ => unreachable!(),
};
let nested_attachment = nested_message.get_attachment(0).unwrap();
assert_eq!(nested_attachment.len(), 42);
assert_eq!(
nested_attachment
.get_header()
.unwrap()
.get_content_type()
.unwrap()
.get_attribute("name")
.unwrap(),
nested_attachment.get_attachment_name().unwrap(),
"Book about ☕ tables.gif"
);
//println!("{}", serde_json::to_string_pretty(&message).unwrap());
//println!("{}", serde_yaml::to_string(&message).unwrap());
}
+198 -64
View File
@@ -42,71 +42,202 @@ QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 35,
"second": 5,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGKEKECHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Test message from Microsoft Outlook 00",
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "redball.png"
}
},
"others": {
"X-MSMail-Priority": [
"Normal"
],
"Importance": [
"Normal"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-Priority": [
"3 (Normal)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [],
"text_body": [],
"attachments": [
0
],
"parts": [
{
"Binary": {
"contents": [
"headers_rfc": {
"subject": {
"Text": "Test message from Microsoft Outlook 00"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 35,
"second": 5,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGKEKECHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "redball.png"
}
}
},
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 76
}
],
[
{
"Rfc": "subject"
},
{
"start": 84,
"end": 125
}
],
[
{
"Rfc": "date"
},
{
"start": 130,
"end": 164
}
],
[
{
"Rfc": "message_id"
},
{
"start": 175,
"end": 225
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 238,
"end": 244
}
],
[
{
"Rfc": "content_type"
},
{
"start": 257,
"end": 291
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 317,
"end": 326
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 346,
"end": 385
}
],
[
{
"Other": "X-Priority"
},
{
"start": 396,
"end": 409
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 427,
"end": 436
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 445,
"end": 498
}
],
[
{
"Other": "Importance"
},
{
"start": 509,
"end": 518
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 528,
"end": 576
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1561,7 +1692,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 0,
"offset_body": 578,
"offset_end": 2570
}
]
}
+220 -99
View File
@@ -1,107 +1,228 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>,
=?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= <schmuergen@example.com>
Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:18:39 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="utf-7"
Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Die Hasen und die Fr+APY-sche
Die Hasen klagten einst +APw-ber ihre mi+AN8-liche Lage+ADs- +ACI-wir =
leben+ACI-, sprach ein Redner, +ACI-in steter Furcht vor Menschen und =
Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere+ACE- =
Unsere stete Angst ist +AOQ-rger als der Tod selbst. Auf, la+AN8-t uns =
ein f+APw-r allemal sterben.+ACI-=20
In einem nahen Teich wollten sie sich nun ers+AOQ-ufen+ADs- sie eilten =
ihm zu+ADs- allein das au+AN8-erordentliche Get+APY-se und ihre =
wunderbare Gestalt erschreckte eine Menge Fr+APY-sche, die am Ufer =
sa+AN8-en, so sehr, da+AN8- sie aufs schnellste untertauchten.=20
+ACI-Halt+ACI-, rief nun eben dieser Sprecher, +ACI-wir wollen das =
Ers+AOQ-ufen noch ein wenig aufschieben, denn auch uns f+APw-rchten, wie =
ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein =
m+APw-ssen als wir.+ACI-=20
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>,
=?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= <schmuergen@example.com>
Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:18:39 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="utf-7"
Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 18,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Microsoft Outlook 00)",
"to": {
"AddressList": [
{
"name": "Joe Blow",
"address": "jblow@example.com"
},
{
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
]
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "utf-7"
}
},
"others": {
"X-Priority": [
"3 (Normal)"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-MSMail-Priority": [
"Normal"
],
"Importance": [
"Normal"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
]
}
},
Die Hasen und die Fr+APY-sche
Die Hasen klagten einst +APw-ber ihre mi+AN8-liche Lage+ADs- +ACI-wir =
leben+ACI-, sprach ein Redner, +ACI-in steter Furcht vor Menschen und =
Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere+ACE- =
Unsere stete Angst ist +AOQ-rger als der Tod selbst. Auf, la+AN8-t uns =
ein f+APw-r allemal sterben.+ACI-=20
In einem nahen Teich wollten sie sich nun ers+AOQ-ufen+ADs- sie eilten =
ihm zu+ADs- allein das au+AN8-erordentliche Get+APY-se und ihre =
wunderbare Gestalt erschreckte eine Menge Fr+APY-sche, die am Ufer =
sa+AN8-en, so sehr, da+AN8- sie aufs schnellste untertauchten.=20
+ACI-Halt+ACI-, rief nun eben dieser Sprecher, +ACI-wir wollen das =
Ers+AOQ-ufen noch ein wenig aufschieben, denn auch uns f+APw-rchten, wie =
ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein =
m+APw-ssen als wir.+ACI-=20
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"AddressList": [
{
"name": "Joe Blow",
"address": "jblow@example.com"
},
{
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
]
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 18,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "utf-7"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 39
}
],
[
{
"Rfc": "to"
},
{
"start": 42,
"end": 146
}
],
[
{
"Rfc": "subject"
},
{
"start": 154,
"end": 224
}
],
[
{
"Rfc": "date"
},
{
"start": 229,
"end": 262
}
],
[
{
"Rfc": "message_id"
},
{
"start": 273,
"end": 322
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 335,
"end": 340
}
],
[
{
"Rfc": "content_type"
},
{
"start": 353,
"end": 383
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 409,
"end": 427
}
],
[
{
"Other": "X-Priority"
},
{
"start": 438,
"end": 450
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 468,
"end": 476
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 485,
"end": 537
}
],
[
{
"Other": "Importance"
},
{
"start": 548,
"end": 556
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 566,
"end": 613
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 0,
"offset_body": 614,
"offset_end": 1491
}
]
}
+162 -53
View File
@@ -35,63 +35,172 @@ wir.&quot; <br>
</font></html>
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 31,
"second": 0,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519003052.00a89c40@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Priority": [
"2 (High)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font></html>\n\n"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"\n\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 31,
"second": 0,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519003052.00a89c40@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 192
}
],
[
{
"Rfc": "date"
},
{
"start": 197,
"end": 231
}
],
[
{
"Rfc": "to"
},
{
"start": 234,
"end": 290
}
],
[
{
"Rfc": "from"
},
{
"start": 295,
"end": 332
}
],
[
{
"Rfc": "subject"
},
{
"start": 340,
"end": 387
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 400,
"end": 406
}
],
[
{
"Rfc": "content_type"
},
{
"start": 419,
"end": 453
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 479,
"end": 498
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font></html>\n\n"
},
"offset_header": 0,
"offset_body": 500,
"offset_end": 1499
}
]
}
+235 -68
View File
@@ -62,82 +62,249 @@ wir.&quot; <br>
--=====================_714967308==_.ALT--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 29,
"second": 55,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519002557.00a88870@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "=====================_714967308==_.ALT"
}
},
"others": {
"X-Priority": [
"2 (High)"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"contents": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font></html>\n"
}
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 29,
"second": 55,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519002557.00a88870@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "=====================_714967308==_.ALT"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 192
}
],
[
{
"Rfc": "date"
},
{
"start": 197,
"end": 231
}
],
[
{
"Rfc": "to"
},
{
"start": 234,
"end": 290
}
],
[
{
"Rfc": "from"
},
{
"start": 295,
"end": 332
}
],
[
{
"Rfc": "subject"
},
{
"start": 340,
"end": 387
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 400,
"end": 406
}
],
[
{
"Rfc": "content_type"
},
{
"start": 419,
"end": 496
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 498,
"offset_end": 2625
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 553,
"end": 588
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 614,
"end": 633
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 540,
"offset_body": 635,
"offset_end": 1446
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1501,
"end": 1535
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1561,
"end": 1580
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font></html>\n"
},
"offset_header": 1488,
"offset_body": 1582,
"offset_end": 2581
}
]
}
+150 -52
View File
@@ -17,62 +17,160 @@ A HARE one day ridiculed the short feet and slow pace of the Tortoise, who repli
Slow but steady wins the race.
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 13,
"second": 19,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519011207.00a8cd70@pop.example.com",
"mime_version": "1.0",
"subject": "The Hare and the Tortoise",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
},
"others": {
"X-Priority": [
"5 (Lowest)"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race. <br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n\r\n"
"headers_rfc": {
"subject": {
"Text": "The Hare and the Tortoise"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 13,
"second": 19,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519011207.00a8cd70@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 194
}
],
[
{
"Rfc": "date"
},
{
"start": 199,
"end": 233
}
],
[
{
"Rfc": "to"
},
{
"start": 236,
"end": 266
}
],
[
{
"Rfc": "from"
},
{
"start": 271,
"end": 308
}
],
[
{
"Rfc": "subject"
},
{
"start": 316,
"end": 344
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 357,
"end": 363
}
],
[
{
"Rfc": "content_type"
},
{
"start": 376,
"end": 409
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n\r\n"
},
"offset_header": 0,
"offset_body": 411,
"offset_end": 1177
}
]
}
+180 -59
View File
@@ -31,69 +31,190 @@ Ers+AOQ-ufen noch ein wenig aufschieben, denn auch uns f+APw-rchten, wie =
ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein =
m+APw-ssen als wir.+ACI-=20
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 20,
"second": 24,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGCEKDCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "utf-7"
}
},
"others": {
"Importance": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"X-Priority": [
"3 (Normal)"
],
"X-MSMail-Priority": [
"Normal"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 20,
"second": 24,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKDCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "utf-7"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 96
}
],
[
{
"Rfc": "subject"
},
{
"start": 104,
"end": 175
}
],
[
{
"Rfc": "date"
},
{
"start": 180,
"end": 214
}
],
[
{
"Rfc": "message_id"
},
{
"start": 225,
"end": 275
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 288,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 339
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 365,
"end": 384
}
],
[
{
"Other": "X-Priority"
},
{
"start": 395,
"end": 408
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 426,
"end": 435
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 444,
"end": 497
}
],
[
{
"Other": "Importance"
},
{
"start": 508,
"end": 517
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 527,
"end": 575
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
},
"offset_header": 0,
"offset_body": 577,
"offset_end": 1470
}
]
}
+275 -75
View File
@@ -82,72 +82,188 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_0004_01BFC037.28F2FA90--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 36,
"second": 13,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGOEKECHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Test message from Microsoft Outlook 00",
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "----=_NextPart_000_0004_01BFC037.28F2FA90"
}
},
"others": {
"Importance": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-MSMail-Priority": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [],
"text_body": [],
"attachments": [
1,
2
],
"parts": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"headers_rfc": {
"subject": {
"Text": "Test message from Microsoft Outlook 00"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 36,
"second": 13,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGOEKECHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"filename": "blueball.png"
"boundary": "----=_NextPart_000_0004_01BFC037.28F2FA90"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 76
}
],
[
{
"Rfc": "subject"
},
{
"start": 84,
"end": 125
}
],
[
{
"Rfc": "date"
},
{
"start": 130,
"end": 164
}
],
[
{
"Rfc": "message_id"
},
{
"start": 175,
"end": 225
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 238,
"end": 244
}
],
[
{
"Rfc": "content_type"
},
{
"start": 257,
"end": 331
}
],
[
{
"Other": "X-Priority"
},
{
"start": 342,
"end": 355
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 373,
"end": 382
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 391,
"end": 444
}
],
[
{
"Other": "Importance"
},
{
"start": 455,
"end": 464
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 474,
"end": 522
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 524,
"offset_end": 4809
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -155,7 +271,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 630,
"end": 665
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 691,
"end": 700
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 720,
"end": 760
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1482,19 +1639,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 617,
"offset_body": 762,
"offset_end": 2580
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1502,7 +1658,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 2638,
"end": 2672
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 2698,
"end": 2707
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 2727,
"end": 2766
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -2957,7 +3154,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 2625,
"offset_body": 2768,
"offset_end": 4762
}
]
}
+180 -59
View File
@@ -30,69 +30,190 @@ ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige =
Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 15,
"second": 35,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGIEKCCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Priority": [
"3 (Normal)"
],
"Importance": [
"Normal"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"X-MSMail-Priority": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 15,
"second": 35,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGIEKCCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 112
}
],
[
{
"Rfc": "subject"
},
{
"start": 120,
"end": 194
}
],
[
{
"Rfc": "date"
},
{
"start": 199,
"end": 233
}
],
[
{
"Rfc": "message_id"
},
{
"start": 244,
"end": 294
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 307,
"end": 313
}
],
[
{
"Rfc": "content_type"
},
{
"start": 326,
"end": 363
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 389,
"end": 408
}
],
[
{
"Other": "X-Priority"
},
{
"start": 419,
"end": 432
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 450,
"end": 459
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 468,
"end": 521
}
],
[
{
"Other": "Importance"
},
{
"start": 532,
"end": 541
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 551,
"end": 599
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 0,
"offset_body": 601,
"offset_end": 1410
}
]
}
+373 -103
View File
@@ -134,92 +134,238 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_0002_01BFC036.AE309650--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 32,
"second": 47,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGGEKECHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Test message from Microsoft Outlook 00",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "----=_NextPart_000_0002_01BFC036.AE309650"
}
},
"others": {
"X-Priority": [
"3 (Normal)"
],
"X-MSMail-Priority": [
"Normal"
],
"Importance": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race. <br/></body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2,
3,
4
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Test message from Microsoft Outlook 00"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 32,
"second": 47,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGGEKECHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "----=_NextPart_000_0002_01BFC036.AE309650"
}
}
}
},
"contents": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
}
"headers_raw": [
[
{
"Rfc": "from"
},
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 99
}
],
[
{
"Rfc": "subject"
},
{
"start": 107,
"end": 148
}
],
[
{
"Rfc": "date"
},
{
"start": 153,
"end": 187
}
],
[
{
"Rfc": "message_id"
},
{
"start": 198,
"end": 248
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 261,
"end": 267
}
],
[
{
"Rfc": "content_type"
},
{
"start": 280,
"end": 354
}
],
[
{
"Other": "X-Priority"
},
{
"start": 365,
"end": 378
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 396,
"end": 405
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 414,
"end": 467
}
],
[
{
"Other": "Importance"
},
{
"start": 478,
"end": 487
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 497,
"end": 545
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3,
4
]
},
"offset_header": 0,
"offset_body": 547,
"offset_end": 7747
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 653,
"end": 690
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 716,
"end": 735
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n"
},
"offset_header": 640,
"offset_body": 737,
"offset_end": 1538
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -227,7 +373,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1596,
"end": 1631
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1657,
"end": 1666
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1686,
"end": 1726
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1554,19 +1741,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 1583,
"offset_body": 1728,
"offset_end": 3546
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1574,7 +1760,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3604,
"end": 3640
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3666,
"end": 3675
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3695,
"end": 3736
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -2874,19 +3101,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 3591,
"offset_body": 3738,
"offset_end": 5518
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -2894,7 +3120,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5576,
"end": 5610
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5636,
"end": 5645
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5665,
"end": 5704
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -4349,7 +4616,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 5563,
"offset_body": 5706,
"offset_end": 7700
}
]
}
+172 -57
View File
@@ -35,67 +35,182 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 6,
"second": 18,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519010441.00a8d140@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1",
"format": "flowed"
}
},
"others": {
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
],
"X-Priority": [
"1 (Highest)"
],
"Disposition-Notification-To": [
"<dwsauder@example.com>"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein <br/>Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, <br/>der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der <br/>Tod selbst. Auf, laßt uns ein für allemal sterben.\"<br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; <br/>allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte <br/>eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste <br/>untertauchten.<br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein <br/>wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, <br/>welche also wohl noch unglücklicher sein müssen als wir.\"<br/><br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein \nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, \nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der \nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; \nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte \neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste \nuntertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein \nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, \nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 6,
"second": 18,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519010441.00a8d140@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1",
"format": "flowed"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "Disposition-Notification-To"
},
{
"start": 141,
"end": 166
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 175,
"end": 223
}
],
[
{
"Other": "X-Priority"
},
{
"start": 234,
"end": 248
}
],
[
{
"Rfc": "date"
},
{
"start": 253,
"end": 287
}
],
[
{
"Rfc": "to"
},
{
"start": 290,
"end": 373
}
],
[
{
"Rfc": "from"
},
{
"start": 378,
"end": 415
}
],
[
{
"Rfc": "subject"
},
{
"start": 423,
"end": 468
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 481,
"end": 487
}
],
[
{
"Rfc": "content_type"
},
{
"start": 500,
"end": 550
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 576,
"end": 595
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein \nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, \nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der \nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; \nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte \neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste \nuntertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein \nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, \nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
"offset_header": 0,
"offset_body": 597,
"offset_end": 1422
}
]
}
+162 -53
View File
@@ -20,63 +20,172 @@ In einem nahen Teich wollten sie sich nun ers
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 10,
"second": 27,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519010842.00a8c7f0@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Fr�sche",
"to": {
"Address": {
"name": "Heinz M�ller",
"address": "mueller@example.com"
}
},
"content_transfer_encoding": "8bit",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
],
"X-Priority": [
"1 (Highest)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\n\r\n\r\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Fr�sche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz M�ller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 10,
"second": 27,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519010842.00a8c7f0@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "8bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 195
}
],
[
{
"Rfc": "date"
},
{
"start": 200,
"end": 234
}
],
[
{
"Rfc": "to"
},
{
"start": 237,
"end": 274
}
],
[
{
"Rfc": "from"
},
{
"start": 279,
"end": 316
}
],
[
{
"Rfc": "subject"
},
{
"start": 324,
"end": 352
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 365,
"end": 371
}
],
[
{
"Rfc": "content_type"
},
{
"start": 384,
"end": 419
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 445,
"end": 452
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\n\r\n\r\n"
},
"offset_header": 0,
"offset_body": 454,
"offset_end": 1203
}
]
}
+153 -50
View File
@@ -28,60 +28,163 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 17,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519001217.00a85b60@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 17,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519001217.00a85b60@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Rfc": "date"
},
{
"start": 175,
"end": 209
}
],
[
{
"Rfc": "to"
},
{
"start": 212,
"end": 299
}
],
[
{
"Rfc": "from"
},
{
"start": 304,
"end": 341
}
],
[
{
"Rfc": "subject"
},
{
"start": 349,
"end": 396
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 409,
"end": 415
}
],
[
{
"Rfc": "content_type"
},
{
"start": 428,
"end": 463
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 489,
"end": 508
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n\n"
},
"offset_header": 0,
"offset_body": 510,
"offset_end": 1321
}
]
}
+180 -59
View File
@@ -29,69 +29,190 @@ sie aufs schnellste untertauchten.=20
ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige =
Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 30,
"second": 20,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGCEKECHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "Windows-1252"
}
},
"others": {
"X-MSMail-Priority": [
"Normal"
],
"Importance": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"X-Priority": [
"3 (Normal)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 30,
"second": 20,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKECHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "Windows-1252"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 101
}
],
[
{
"Rfc": "subject"
},
{
"start": 109,
"end": 185
}
],
[
{
"Rfc": "date"
},
{
"start": 190,
"end": 224
}
],
[
{
"Rfc": "message_id"
},
{
"start": 235,
"end": 285
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 298,
"end": 304
}
],
[
{
"Rfc": "content_type"
},
{
"start": 317,
"end": 356
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 382,
"end": 401
}
],
[
{
"Other": "X-Priority"
},
{
"start": 412,
"end": 425
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 443,
"end": 452
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 461,
"end": 514
}
],
[
{
"Other": "Importance"
},
{
"start": 525,
"end": 534
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 544,
"end": 592
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
},
"offset_header": 0,
"offset_body": 594,
"offset_end": 1401
}
]
}
+180 -59
View File
@@ -30,69 +30,190 @@ wenig aufschieben, denn auch uns f
welche also wohl noch unglücklicher sein müssen als wir."
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 13,
"second": 51,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGEEKCCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"content_transfer_encoding": "8bit",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"Importance": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
],
"X-MSMail-Priority": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein<br/>Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der<br/>Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod<br/>selbst. Auf, laßt uns ein für allemal sterben.\"<br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;<br/>allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte<br/>eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste<br/>untertauchten.<br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein<br/>wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,<br/>welche also wohl noch unglücklicher sein müssen als wir.\"<br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod\r\nselbst. Auf, laßt uns ein für allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\r\nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte\r\neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\r\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch unglücklicher sein müssen als wir.\"\r\n\r\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 13,
"second": 51,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGEEKCCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "8bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 112
}
],
[
{
"Rfc": "subject"
},
{
"start": 120,
"end": 194
}
],
[
{
"Rfc": "date"
},
{
"start": 199,
"end": 233
}
],
[
{
"Rfc": "message_id"
},
{
"start": 244,
"end": 294
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 307,
"end": 313
}
],
[
{
"Rfc": "content_type"
},
{
"start": 326,
"end": 363
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 389,
"end": 396
}
],
[
{
"Other": "X-Priority"
},
{
"start": 407,
"end": 420
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 438,
"end": 447
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 456,
"end": 509
}
],
[
{
"Other": "Importance"
},
{
"start": 520,
"end": 529
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 539,
"end": 587
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod\r\nselbst. Auf, laßt uns ein für allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\r\nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte\r\neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\r\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch unglücklicher sein müssen als wir.\"\r\n\r\n"
},
"offset_header": 0,
"offset_body": 589,
"offset_end": 1341
}
]
}
+253 -74
View File
@@ -71,88 +71,267 @@ race.&nbsp;=20
------=_NextPart_000_0005_01BFC037.799BEF60--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 38,
"second": 28,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGCEKFCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Test message from Microsoft Outlook 00",
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "----=_NextPart_000_0005_01BFC037.799BEF60"
}
},
"others": {
"X-MSMail-Priority": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"Importance": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"contents": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><FONT face=Arial size=2><BR>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the race.&nbsp; \n<BR></FONT></DIV></BODY></HTML>\n"
}
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Test message from Microsoft Outlook 00"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 38,
"second": 28,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKFCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "----=_NextPart_000_0005_01BFC037.799BEF60"
}
}
}
},
"contents": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n"
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 76
}
],
[
{
"Rfc": "subject"
},
{
"start": 84,
"end": 125
}
],
[
{
"Rfc": "date"
},
{
"start": 130,
"end": 164
}
],
[
{
"Rfc": "message_id"
},
{
"start": 175,
"end": 225
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 238,
"end": 244
}
],
[
{
"Rfc": "content_type"
},
{
"start": 257,
"end": 337
}
],
[
{
"Other": "X-Priority"
},
{
"start": 348,
"end": 361
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 379,
"end": 388
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 397,
"end": 450
}
],
[
{
"Other": "Importance"
},
{
"start": 461,
"end": 470
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 480,
"end": 528
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 530,
"offset_end": 2903
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 636,
"end": 673
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 699,
"end": 718
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n"
},
"offset_header": 623,
"offset_body": 720,
"offset_end": 1523
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1581,
"end": 1617
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1643,
"end": 1662
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><FONT face=Arial size=2><BR>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the race.&nbsp; \n<BR></FONT></DIV></BODY></HTML>\n"
},
"offset_header": 1568,
"offset_body": 1664,
"offset_end": 2856
}
]
}
+544 -121
View File
@@ -197,97 +197,336 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
--=====================_715392540==_--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 36,
"second": 58,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519003556.00a918e0@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_715392540==_"
}
},
"others": {
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
],
"X-Priority": [
"2 (High)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"contents": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font><img src=\"cid:4.2.0.58.20000519003556.00a918e0@pop.example.com.2\" width=27 height=27 alt=\"2aa3ed95.png\"><img src=\"cid:4.2.0.58.20000519003556.00a918e0@pop.example.com.3\" width=27 height=27 alt=\"2aa3edd1.png\"></html>\n"
}
4
],
"text_body": [
3
],
"attachments": [
5,
6,
7,
8
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 36,
"second": 58,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_715392540==_"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n2aa3ed95.png2aa3edd1.png"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa3ed95.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_id": "4.2.0.58.20000519003556.00a918e0@pop.example.com.2",
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 192
}
],
[
{
"Rfc": "date"
},
{
"start": 197,
"end": 231
}
],
[
{
"Rfc": "to"
},
{
"start": 234,
"end": 288
}
],
[
{
"Rfc": "from"
},
{
"start": 293,
"end": 330
}
],
[
{
"Rfc": "subject"
},
{
"start": 338,
"end": 383
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 396,
"end": 402
}
],
[
{
"Rfc": "content_type"
},
{
"start": 415,
"end": 482
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
7,
8
]
},
"offset_header": 0,
"offset_body": 484,
"offset_end": 11500
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"type": "multipart/alternative",
"boundary": "=====================_715392540==_.REL"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 535,
"end": 640
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
5,
6
]
},
"offset_header": 522,
"offset_body": 642,
"offset_end": 7504
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "=====================_715392550==_.ALT"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 697,
"end": 774
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
3,
4
]
},
"offset_header": 684,
"offset_body": 776,
"offset_end": 3160
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 831,
"end": 866
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 892,
"end": 911
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n2aa3ed95.png2aa3edd1.png"
},
"offset_header": 818,
"offset_body": 913,
"offset_end": 1748
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1803,
"end": 1837
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1863,
"end": 1882
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font><img src=\"cid:4.2.0.58.20000519003556.00a918e0@pop.example.com.2\" width=27 height=27 alt=\"2aa3ed95.png\"><img src=\"cid:4.2.0.58.20000519003556.00a918e0@pop.example.com.3\" width=27 height=27 alt=\"2aa3edd1.png\"></html>\n"
},
"offset_header": 1790,
"offset_body": 1884,
"offset_end": 3116
},
{
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com.2"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -295,7 +534,57 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa3ed95.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3217,
"end": 3250
}
],
[
{
"Rfc": "content_id"
},
{
"start": 3261,
"end": 3316
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3342,
"end": 3351
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3371,
"end": 3405
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1622,20 +1911,21 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 3204,
"offset_body": 3407,
"offset_end": 5223
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa3edd1.png"
}
},
"content_id": "4.2.0.58.20000519003556.00a918e0@pop.example.com.3",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com.3"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1643,7 +1933,57 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa3edd1.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5278,
"end": 5311
}
],
[
{
"Rfc": "content_id"
},
{
"start": 5322,
"end": 5377
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5403,
"end": 5412
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5432,
"end": 5466
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3098,19 +3438,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 5265,
"offset_body": 5468,
"offset_end": 7460
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -3118,7 +3457,48 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 7557,
"end": 7590
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 7616,
"end": 7625
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 7645,
"end": 7683
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -4445,19 +4825,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 7544,
"offset_body": 7685,
"offset_end": 9501
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -4465,7 +4844,48 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 9552,
"end": 9586
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 9612,
"end": 9621
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 9641,
"end": 9680
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -5765,7 +6185,10 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 9539,
"offset_body": 9682,
"offset_end": 11460
}
]
}
+270 -84
View File
@@ -94,82 +94,206 @@ JB@ac)(GTFLiL)!d09'8!!!:
--=====================_716373961==_--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 53,
"second": 25,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519005150.00a85230@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_716373961==_"
}
},
"others": {
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/></body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2,
3
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 53,
"second": 25,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519005150.00a85230@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_716373961==_"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Rfc": "date"
},
{
"start": 175,
"end": 209
}
],
[
{
"Rfc": "to"
},
{
"start": 212,
"end": 295
}
],
[
{
"Rfc": "from"
},
{
"start": 300,
"end": 337
}
],
[
{
"Rfc": "subject"
},
{
"start": 345,
"end": 390
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 403,
"end": 409
}
],
[
{
"Rfc": "content_type"
},
{
"start": 422,
"end": 489
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 491,
"offset_end": 4871
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 542,
"end": 577
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 603,
"end": 622
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 529,
"offset_body": 624,
"offset_end": 1435
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "application",
"c_subtype": "mac-binhex40",
"attributes": {
@@ -177,7 +301,39 @@ JB@ac)(GTFLiL)!d09'8!!!:
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1486,
"end": 1534
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1554,
"end": 1592
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
13,
10,
40,
@@ -2106,21 +2262,17 @@ JB@ac)(GTFLiL)!d09'8!!!:
33,
58,
13,
10,
13
10
]
}
},
"offset_header": 1473,
"offset_body": 1594,
"offset_end": 3525
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "HasenundFr�sche.txt"
}
},
"content_type": {
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "application",
"c_subtype": "mac-binhex40",
"attributes": {
@@ -2128,7 +2280,39 @@ JB@ac)(GTFLiL)!d09'8!!!:
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "HasenundFr�sche.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3576,
"end": 3631
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3651,
"end": 3696
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
13,
10,
40,
@@ -3259,10 +3443,12 @@ JB@ac)(GTFLiL)!d09'8!!!:
33,
58,
13,
10,
13
10
]
}
},
"offset_header": 3563,
"offset_body": 3698,
"offset_end": 4831
}
]
}
+282 -85
View File
@@ -101,82 +101,197 @@ end
--=====================_716177458==_--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 50,
"second": 8,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519004755.00a86100@pop.example.com",
"mime_version": "1.0",
"subject": "The Hare and the Tortoise",
"to": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "jschmuergen@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_716177458==_"
}
},
"others": {
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race. <br/></body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2,
3
],
"parts": [
{
"header": {
"headers_rfc": {
"subject": {
"Text": "The Hare and the Tortoise"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "jschmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 50,
"second": 8,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519004755.00a86100@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_716177458==_"
}
}
}
},
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n\r"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "x-uuencode",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Rfc": "date"
},
{
"start": 175,
"end": 209
}
],
[
{
"Rfc": "to"
},
{
"start": 212,
"end": 257
}
],
[
{
"Rfc": "from"
},
{
"start": 262,
"end": 299
}
],
[
{
"Rfc": "subject"
},
{
"start": 307,
"end": 335
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 348,
"end": 354
}
],
[
{
"Rfc": "content_type"
},
{
"start": 367,
"end": 434
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 436,
"offset_end": 5446
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 487,
"end": 520
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n"
},
"offset_header": 474,
"offset_body": 522,
"offset_end": 1288
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "x-uuencode"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -184,7 +299,48 @@ end
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1339,
"end": 1373
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1399,
"end": 1412
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1432,
"end": 1471
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
13,
10,
98,
@@ -2038,22 +2194,20 @@ end
110,
100,
13,
10,
13
10
]
}
},
"offset_header": 1326,
"offset_body": 1473,
"offset_end": 3329
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
}
},
"content_transfer_encoding": "x-uuencode",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "x-uuencode"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -2061,7 +2215,48 @@ end
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3380,
"end": 3413
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3439,
"end": 3452
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3472,
"end": 3510
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
13,
10,
98,
@@ -3953,10 +4148,12 @@ end
110,
100,
13,
10,
13
10
]
}
},
"offset_header": 3367,
"offset_body": 3512,
"offset_end": 5406
}
]
}
+403 -98
View File
@@ -137,98 +137,299 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
--=====================_715157131==_.REL--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 33,
"second": 1,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519003143.00a8d550@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"boundary": "=====================_715157131==_.REL",
"type": "multipart/alternative"
}
},
"others": {
"X-Priority": [
"2 (High)"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"contents": "<html>\n<img src=\"cid:4.2.0.58.20000519003143.00a8d550@pop.example.com.0\" width=27 height=27 alt=\"blueball.png\"><br>\n<br>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n<img src=\"cid:4.2.0.58.20000519003143.00a8d550@pop.example.com.1\" width=27 height=27 alt=\"redball.png\"></font></html>\n"
}
3
],
"text_body": [
2
],
"attachments": [
4,
5
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 33,
"second": 1,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519003143.00a8d550@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"type": "multipart/alternative",
"boundary": "=====================_715157131==_.REL"
}
}
}
},
"contents": "blueball.png\n\nDie Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\nredball.png"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "blueball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_id": "4.2.0.58.20000519003143.00a8d550@pop.example.com.0",
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 192
}
],
[
{
"Rfc": "date"
},
{
"start": 197,
"end": 231
}
],
[
{
"Rfc": "to"
},
{
"start": 234,
"end": 288
}
],
[
{
"Rfc": "from"
},
{
"start": 293,
"end": 330
}
],
[
{
"Rfc": "subject"
},
{
"start": 338,
"end": 383
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 396,
"end": 402
}
],
[
{
"Rfc": "content_type"
},
{
"start": 415,
"end": 520
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
4,
5
]
},
"offset_header": 0,
"offset_body": 522,
"offset_end": 7393
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "=====================_715157141==_.ALT"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 577,
"end": 654
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 564,
"offset_body": 656,
"offset_end": 3051
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 711,
"end": 746
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 772,
"end": 791
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "blueball.png\n\nDie Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\nredball.png"
},
"offset_header": 698,
"offset_body": 793,
"offset_end": 1631
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1686,
"end": 1720
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1746,
"end": 1765
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<img src=\"cid:4.2.0.58.20000519003143.00a8d550@pop.example.com.0\" width=27 height=27 alt=\"blueball.png\"><br>\n<br>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n<img src=\"cid:4.2.0.58.20000519003143.00a8d550@pop.example.com.1\" width=27 height=27 alt=\"redball.png\"></font></html>\n"
},
"offset_header": 1673,
"offset_body": 1767,
"offset_end": 3007
},
{
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003143.00a8d550@pop.example.com.0"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -236,7 +437,57 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3108,
"end": 3141
}
],
[
{
"Rfc": "content_id"
},
{
"start": 3152,
"end": 3207
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3233,
"end": 3242
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3262,
"end": 3296
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1563,20 +1814,21 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 3095,
"offset_body": 3298,
"offset_end": 5114
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "redball.png"
}
},
"content_id": "4.2.0.58.20000519003143.00a8d550@pop.example.com.1",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003143.00a8d550@pop.example.com.1"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1584,7 +1836,57 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5169,
"end": 5201
}
],
[
{
"Rfc": "content_id"
},
{
"start": 5212,
"end": 5267
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5293,
"end": 5302
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5322,
"end": 5355
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3039,7 +3341,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 5156,
"offset_body": 5357,
"offset_end": 7349
}
]
}
+396 -101
View File
@@ -143,102 +143,313 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_0008_01BFC037.FDD8EE90--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 42,
"second": 10,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGGEKFCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Test message from Microsoft Outlook 00",
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "----=_NextPart_000_0008_01BFC037.FDD8EE90"
}
},
"others": {
"X-MSMail-Priority": [
"Normal"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"Importance": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-Priority": [
"3 (Normal)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"contents": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><BR><FONT face=Arial size=2>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the race.&nbsp; \n<BR></FONT></DIV></BODY></HTML>\n"
}
3
],
"text_body": [
2
],
"attachments": [
4,
5
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Test message from Microsoft Outlook 00"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 42,
"second": 10,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGGEKFCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "----=_NextPart_000_0008_01BFC037.FDD8EE90"
}
}
}
},
"contents": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
}
"headers_raw": [
[
{
"Rfc": "from"
},
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 76
}
],
[
{
"Rfc": "subject"
},
{
"start": 84,
"end": 125
}
],
[
{
"Rfc": "date"
},
{
"start": 130,
"end": 164
}
],
[
{
"Rfc": "message_id"
},
{
"start": 175,
"end": 225
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 238,
"end": 244
}
],
[
{
"Rfc": "content_type"
},
{
"start": 257,
"end": 331
}
],
[
{
"Other": "X-Priority"
},
{
"start": 342,
"end": 355
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 373,
"end": 382
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 391,
"end": 444
}
],
[
{
"Other": "Importance"
},
{
"start": 455,
"end": 464
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 474,
"end": 522
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
4,
5
]
},
"offset_header": 0,
"offset_body": 524,
"offset_end": 7242
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "----=_NextPart_001_0009_01BFC037.FDD8EE90"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 630,
"end": 710
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 617,
"offset_body": 712,
"offset_end": 3039
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 772,
"end": 809
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 835,
"end": 854
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n"
},
"offset_header": 759,
"offset_body": 856,
"offset_end": 1659
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1717,
"end": 1753
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1779,
"end": 1798
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><BR><FONT face=Arial size=2>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the race.&nbsp; \n<BR></FONT></DIV></BODY></HTML>\n"
},
"offset_header": 1704,
"offset_body": 1800,
"offset_end": 2992
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -246,7 +457,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3099,
"end": 3135
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3161,
"end": 3170
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3190,
"end": 3231
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1546,19 +1798,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 3086,
"offset_body": 3233,
"offset_end": 5013
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1566,7 +1817,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5071,
"end": 5105
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5131,
"end": 5140
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5160,
"end": 5199
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3021,7 +3313,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 5058,
"offset_body": 5201,
"offset_end": 7195
}
]
}
+180 -59
View File
@@ -30,69 +30,190 @@ wenig aufschieben, denn auch uns f
welche also wohl noch unglücklicher sein müssen als wir."
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 8,
"second": 29,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGIEKBCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Fr�sche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"content_transfer_encoding": "8bit",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"Importance": [
"Normal"
],
"X-MSMail-Priority": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein<br/>Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der<br/>Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod<br/>selbst. Auf, laßt uns ein für allemal sterben.\"<br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;<br/>allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte<br/>eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste<br/>untertauchten.<br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein<br/>wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,<br/>welche also wohl noch unglücklicher sein müssen als wir.\"<br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod\r\nselbst. Auf, laßt uns ein für allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\r\nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte\r\neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\r\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch unglücklicher sein müssen als wir.\"\r\n\r\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 8,
"second": 29,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGIEKBCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "8bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 89
}
],
[
{
"Rfc": "subject"
},
{
"start": 97,
"end": 148
}
],
[
{
"Rfc": "date"
},
{
"start": 153,
"end": 187
}
],
[
{
"Rfc": "message_id"
},
{
"start": 198,
"end": 248
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 261,
"end": 267
}
],
[
{
"Rfc": "content_type"
},
{
"start": 280,
"end": 317
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 343,
"end": 350
}
],
[
{
"Other": "X-Priority"
},
{
"start": 361,
"end": 374
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 392,
"end": 401
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 410,
"end": 463
}
],
[
{
"Other": "Importance"
},
{
"start": 474,
"end": 483
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 493,
"end": 541
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod\r\nselbst. Auf, laßt uns ein für allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\r\nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte\r\neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\r\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch unglücklicher sein müssen als wir.\"\r\n\r\n"
},
"offset_header": 0,
"offset_body": 543,
"offset_end": 1295
}
]
}
+478 -109
View File
@@ -187,105 +187,391 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_0010_01BFC038.B91BC650--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 47,
"second": 24,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGOEKFCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Test message from Microsoft Outlook 00",
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "----=_NextPart_000_0010_01BFC038.B91BC650"
}
},
"others": {
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"X-MSMail-Priority": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
],
"Importance": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"contents": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><FONT face=Arial size=2><IMG align=baseline alt=\"blue ball\" border=0 \nhspace=0 src=\"cid:938014623@17052000-0f9b\"></FONT></DIV>\n<DIV><FONT face=Arial size=2><BR>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the race.&nbsp; \n</FONT></DIV>\n<DIV><FONT face=Arial size=2><BR>&nbsp;</DIV></FONT></BODY></HTML>\n"
}
4
],
"text_body": [
3
],
"attachments": [
5,
6,
7
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Test message from Microsoft Outlook 00"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 47,
"second": 24,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGOEKFCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "----=_NextPart_000_0010_01BFC038.B91BC650"
}
}
}
},
"contents": "\n\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n\n"
}
],
"attachments": [
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 76
}
],
[
{
"Rfc": "subject"
},
{
"start": 84,
"end": 125
}
],
[
{
"Rfc": "date"
},
{
"start": 130,
"end": 164
}
],
[
{
"Rfc": "message_id"
},
{
"start": 175,
"end": 225
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 238,
"end": 244
}
],
[
{
"Rfc": "content_type"
},
{
"start": 257,
"end": 331
}
],
[
{
"Other": "X-Priority"
},
{
"start": 342,
"end": 355
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 373,
"end": 382
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 391,
"end": 444
}
],
[
{
"Other": "Importance"
},
{
"start": 455,
"end": 464
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 474,
"end": 522
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
6,
7
]
},
"offset_header": 0,
"offset_body": 524,
"offset_end": 9627
},
{
"Binary": {
"header": {
"content_id": "938014623@17052000-0f9b",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"boundary": "----=_NextPart_001_0011_01BFC038.B91BC650"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 630,
"end": 706
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
5
]
},
"offset_header": 617,
"offset_body": 708,
"offset_end": 5424
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "----=_NextPart_002_0012_01BFC038.B91BC650"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 768,
"end": 848
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
3,
4
]
},
"offset_header": 755,
"offset_body": 850,
"offset_end": 3388
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 910,
"end": 947
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 973,
"end": 992
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\n\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n\n"
},
"offset_header": 897,
"offset_body": 994,
"offset_end": 1801
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1859,
"end": 1895
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1921,
"end": 1940
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><FONT face=Arial size=2><IMG align=baseline alt=\"blue ball\" border=0 \nhspace=0 src=\"cid:938014623@17052000-0f9b\"></FONT></DIV>\n<DIV><FONT face=Arial size=2><BR>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the race.&nbsp; \n</FONT></DIV>\n<DIV><FONT face=Arial size=2><BR>&nbsp;</DIV></FONT></BODY></HTML>\n"
},
"offset_header": 1846,
"offset_body": 1942,
"offset_end": 3341
},
{
"headers_rfc": {
"content_id": {
"Text": "938014623@17052000-0f9b"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "blueball.png"
}
}
},
"contents": [
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3448,
"end": 3483
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3509,
"end": 3518
}
],
[
{
"Rfc": "content_id"
},
{
"start": 3529,
"end": 3557
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1612,19 +1898,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 3435,
"offset_body": 3559,
"offset_end": 5377
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1632,7 +1917,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5484,
"end": 5520
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5546,
"end": 5555
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5575,
"end": 5616
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -2932,19 +3258,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 5471,
"offset_body": 5618,
"offset_end": 7398
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -2952,7 +3277,48 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 7456,
"end": 7490
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 7516,
"end": 7525
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 7545,
"end": 7584
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -4407,7 +4773,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 7443,
"offset_body": 7586,
"offset_end": 9580
}
]
}
+180 -59
View File
@@ -29,69 +29,190 @@ IHdlbGNoZSBhbHNvIHdvaGwgbm9jaCB1bmds/GNrbGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIu
IiANCg==
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 11,
"second": 50,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGAEKCCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Fr�sche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"X-MSMail-Priority": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"Importance": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 11,
"second": 50,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGAEKCCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 89
}
],
[
{
"Rfc": "subject"
},
{
"start": 97,
"end": 148
}
],
[
{
"Rfc": "date"
},
{
"start": 153,
"end": 187
}
],
[
{
"Rfc": "message_id"
},
{
"start": 198,
"end": 248
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 261,
"end": 267
}
],
[
{
"Rfc": "content_type"
},
{
"start": 280,
"end": 317
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 343,
"end": 352
}
],
[
{
"Other": "X-Priority"
},
{
"start": 363,
"end": 376
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 394,
"end": 403
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 412,
"end": 465
}
],
[
{
"Other": "Importance"
},
{
"start": 476,
"end": 485
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 495,
"end": 543
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\n"
},
"offset_header": 0,
"offset_body": 545,
"offset_end": 1571
}
]
}
+334 -93
View File
@@ -107,83 +107,211 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
--=====================_716541962==_--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 56,
"second": 13,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519005505.00a853a0@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_716541962==_"
}
},
"others": {
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/></body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2,
3,
4
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 56,
"second": 13,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519005505.00a853a0@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_716541962==_"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Rfc": "date"
},
{
"start": 175,
"end": 209
}
],
[
{
"Rfc": "to"
},
{
"start": 212,
"end": 295
}
],
[
{
"Rfc": "from"
},
{
"start": 300,
"end": 337
}
],
[
{
"Rfc": "subject"
},
{
"start": 345,
"end": 390
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 403,
"end": 409
}
],
[
{
"Rfc": "content_type"
},
{
"start": 422,
"end": 489
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3,
4
]
},
"offset_header": 0,
"offset_body": 491,
"offset_end": 5435
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 542,
"end": 577
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 603,
"end": 622
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 529,
"offset_body": 624,
"offset_end": 1435
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -191,7 +319,48 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1486,
"end": 1519
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1545,
"end": 1554
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1574,
"end": 1612
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1518,18 +1687,15 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
96,
130
]
}
},
"offset_header": 1473,
"offset_body": 1614,
"offset_end": 3430
},
{
"Text": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "farmerandstork.txt"
}
},
"content_type": {
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
@@ -1537,20 +1703,51 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
}
}
},
"contents": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n\r"
}
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "farmerandstork.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3481,
"end": 3514
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3534,
"end": 3578
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n"
},
"offset_header": 3468,
"offset_body": 3580,
"offset_end": 4386
},
{
"Text": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "HasenundFr�sche.txt"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
@@ -1558,8 +1755,52 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
}
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "HasenundFr�sche.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 4437,
"end": 4472
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 4498,
"end": 4517
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 4537,
"end": 4582
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 4424,
"offset_body": 4584,
"offset_end": 5395
}
]
}
+328 -90
View File
@@ -108,88 +108,222 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
--=====================_715429112==_.REL--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 37,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"type": "text/html",
"boundary": "=====================_715429112==_.REL"
}
},
"others": {
"X-Priority": [
"2 (High)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2,
3
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 37,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"type": "text/html",
"boundary": "=====================_715429112==_.REL"
}
}
}
},
"contents": "<html>\n<img src=\"cid:4.2.0.58.20000519003735.00a8d7e0@pop.example.com.2\" width=27 height=27 alt=\"2aa48eb6.png\"><br>\n<br>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n<img src=\"cid:4.2.0.58.20000519003735.00a8d7e0@pop.example.com.3\" width=27 height=27 alt=\"2aa48ec0.png\"></font></html>\n"
}
],
"text_body": [
{
"contents": "\n\nDie Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"\n\n"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa48eb6.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_id": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com.2",
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 192
}
],
[
{
"Rfc": "date"
},
{
"start": 197,
"end": 231
}
],
[
{
"Rfc": "to"
},
{
"start": 234,
"end": 288
}
],
[
{
"Rfc": "from"
},
{
"start": 293,
"end": 330
}
],
[
{
"Rfc": "subject"
},
{
"start": 338,
"end": 383
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 396,
"end": 402
}
],
[
{
"Rfc": "content_type"
},
{
"start": 415,
"end": 508
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 510,
"offset_end": 6229
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 565,
"end": 599
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 625,
"end": 644
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<img src=\"cid:4.2.0.58.20000519003735.00a8d7e0@pop.example.com.2\" width=27 height=27 alt=\"2aa48eb6.png\"><br>\n<br>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n<img src=\"cid:4.2.0.58.20000519003735.00a8d7e0@pop.example.com.3\" width=27 height=27 alt=\"2aa48ec0.png\"></font></html>\n"
},
"offset_header": 552,
"offset_body": 646,
"offset_end": 1887
},
{
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com.2"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -197,7 +331,57 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa48eb6.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1942,
"end": 1975
}
],
[
{
"Rfc": "content_id"
},
{
"start": 1986,
"end": 2041
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 2067,
"end": 2076
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 2096,
"end": 2130
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1524,20 +1708,21 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 1929,
"offset_body": 2132,
"offset_end": 3948
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa48ec0.png"
}
},
"content_id": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com.3",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com.3"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1545,7 +1730,57 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa48ec0.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 4003,
"end": 4036
}
],
[
{
"Rfc": "content_id"
},
{
"start": 4047,
"end": 4102
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 4128,
"end": 4137
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 4157,
"end": 4191
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3000,7 +3235,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 3990,
"offset_body": 4193,
"offset_end": 6185
}
]
}
+469 -113
View File
@@ -170,87 +170,259 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
--=====================_715462801==_--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 38,
"second": 13,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519003809.00a85140@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_715462801==_"
}
},
"others": {
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Priority": [
"2 (High)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
2
],
"text_body": [
2
],
"attachments": [
3,
4,
5,
6
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 38,
"second": 13,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519003809.00a85140@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_715462801==_"
}
}
}
},
"contents": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font><img src=\"cid:4.2.0.58.20000519003809.00a85140@pop.example.com.2\" width=27 height=27 alt=\"2aa51367.png\"><img src=\"cid:4.2.0.58.20000519003809.00a85140@pop.example.com.3\" width=27 height=27 alt=\"2aa51371.png\"></html>\n"
}
],
"text_body": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"\n\n"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa51367.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_id": "4.2.0.58.20000519003809.00a85140@pop.example.com.2",
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 192
}
],
[
{
"Rfc": "date"
},
{
"start": 197,
"end": 231
}
],
[
{
"Rfc": "to"
},
{
"start": 234,
"end": 288
}
],
[
{
"Rfc": "from"
},
{
"start": 293,
"end": 330
}
],
[
{
"Rfc": "subject"
},
{
"start": 338,
"end": 383
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 396,
"end": 402
}
],
[
{
"Rfc": "content_type"
},
{
"start": 415,
"end": 482
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
5,
6
]
},
"offset_header": 0,
"offset_body": 484,
"offset_end": 10336
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"type": "text/html",
"boundary": "=====================_715462801==_.REL"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 535,
"end": 628
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3,
4
]
},
"offset_header": 522,
"offset_body": 630,
"offset_end": 6340
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 685,
"end": 719
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 745,
"end": 764
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font><img src=\"cid:4.2.0.58.20000519003809.00a85140@pop.example.com.2\" width=27 height=27 alt=\"2aa51367.png\"><img src=\"cid:4.2.0.58.20000519003809.00a85140@pop.example.com.3\" width=27 height=27 alt=\"2aa51371.png\"></html>\n"
},
"offset_header": 672,
"offset_body": 766,
"offset_end": 1998
},
{
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003809.00a85140@pop.example.com.2"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -258,7 +430,57 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa51367.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 2053,
"end": 2086
}
],
[
{
"Rfc": "content_id"
},
{
"start": 2097,
"end": 2152
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 2178,
"end": 2187
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 2207,
"end": 2241
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1585,20 +1807,21 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 2040,
"offset_body": 2243,
"offset_end": 4059
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa51371.png"
}
},
"content_id": "4.2.0.58.20000519003809.00a85140@pop.example.com.3",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003809.00a85140@pop.example.com.3"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1606,7 +1829,57 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa51371.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 4114,
"end": 4147
}
],
[
{
"Rfc": "content_id"
},
{
"start": 4158,
"end": 4213
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 4239,
"end": 4248
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 4268,
"end": 4302
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3061,19 +3334,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 4101,
"offset_body": 4304,
"offset_end": 6296
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -3081,7 +3353,48 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 6393,
"end": 6426
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 6452,
"end": 6461
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 6481,
"end": 6519
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -4408,19 +4721,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 6380,
"offset_body": 6521,
"offset_end": 8337
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -4428,7 +4740,48 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 8388,
"end": 8422
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 8448,
"end": 8457
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 8477,
"end": 8516
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -5728,7 +6081,10 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 8375,
"offset_body": 8518,
"offset_end": 10296
}
]
}
+282 -83
View File
@@ -83,105 +83,269 @@ Birds of a feather flock together.
--=====================_716740438==_--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 59,
"second": 31,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519005818.00a86aa0@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_716740438==_"
}
},
"others": {
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/></body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2,
3
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 59,
"second": 31,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519005818.00a86aa0@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_716740438==_"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
}
],
"attachments": [
{
"Text": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "HasenundFr�sche.txt"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "x-uuencode",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Rfc": "date"
},
{
"start": 175,
"end": 209
}
],
[
{
"Rfc": "to"
},
{
"start": 212,
"end": 266
}
],
[
{
"Rfc": "from"
},
{
"start": 271,
"end": 308
}
],
[
{
"Rfc": "subject"
},
{
"start": 316,
"end": 361
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 374,
"end": 380
}
],
[
{
"Rfc": "content_type"
},
{
"start": 393,
"end": 460
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 462,
"offset_end": 3741
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 513,
"end": 548
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 574,
"end": 593
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 500,
"offset_body": 595,
"offset_end": 1406
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "x-uuencode"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"x-mac-creator": "74747874",
"name": "HasenundFr�sche.txt",
"x-mac-type": "54455854"
"x-mac-type": "54455854",
"name": "HasenundFr�sche.txt"
}
}
},
"contents": "\r\nbegin 600 HasenundFr�sche.txt\r\nM1&EE($AA<V5N('5N9\"!D:64@1G+V<V-H90T*#0I$:64@2&%S96X@:VQA9W1E\r\nM;B!E:6YS=\"#\\8F5R(&EH<F4@;6G?;&EC:&4@3&%G93L@(G=I<B!L96)E;B(L\r\nM('-P<F%C:\"!E:6X@4F5D;F5R+\"`B:6X@<W1E=&5R($9U<F-H=\"!V;W(@365N\r\nM<V-H96X@=6YD(%1I97)E;BP@96EN92!\"975T92!D97(@2'5N9&4L(&1E<B!!\r\nM9&QE<BP@:F$@9F%S=\"!A;&QE<B!2875B=&EE<F4A(%5N<V5R92!S=&5T92!!\r\nM;F=S=\"!I<W0@Y')G97(@86QS(&1E<B!4;V0@<V5L8G-T+B!!=68L(&QAWW0@\r\nM=6YS(&5I;B!F_'(@86QL96UA;\"!S=&5R8F5N+B(@#0H-\"DEN(&5I;F5M(&YA\r\nM:&5N(%1E:6-H('=O;&QT96X@<VEE('-I8V@@;G5N(&5R<^1U9F5N.R!S:64@\r\nM96EL=&5N(&EH;2!Z=3L@86QL96EN(&1A<R!A==]E<F]R9&5N=&QI8VAE($=E\r\nM=/9S92!U;F0@:6AR92!W=6YD97)B87)E($=E<W1A;'0@97)S8VAR96-K=&4@\r\nM96EN92!-96YG92!&<O9S8VAE+\"!D:64@86T@569E<B!S8=]E;BP@<V\\@<V5H\r\nM<BP@9&'?('-I92!A=69S('-C:&YE;&QS=&4@=6YT97)T875C:'1E;BX@#0H-\r\nM\"B)(86QT(BP@<FEE9B!N=6X@96)E;B!D:65S97(@4W!R96-H97(L(\")W:7(@\r\nM=V]L;&5N(&1A<R!%<G/D=69E;B!N;V-H(&5I;B!W96YI9R!A=69S8VAI96)E\r\nM;BP@9&5N;B!A=6-H('5N<R!F_')C:'1E;BP@=VEE(&EH<B!S96AT+\"!E:6YI\r\nM9V4@5&EE<F4L('=E;&-H92!A;'-O('=O:&P@;F]C:\"!U;F=L_&-K;&EC:&5R\r\n;('-E:6X@;?QS<V5N(&%L<R!W:7(N(B`-\"@T*\r\n`\r\nend\r\n\r"
}
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "HasenundFr�sche.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1457,
"end": 1549
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1575,
"end": 1588
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1608,
"end": 1653
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nbegin 600 HasenundFr�sche.txt\r\nM1&EE($AA<V5N('5N9\"!D:64@1G+V<V-H90T*#0I$:64@2&%S96X@:VQA9W1E\r\nM;B!E:6YS=\"#\\8F5R(&EH<F4@;6G?;&EC:&4@3&%G93L@(G=I<B!L96)E;B(L\r\nM('-P<F%C:\"!E:6X@4F5D;F5R+\"`B:6X@<W1E=&5R($9U<F-H=\"!V;W(@365N\r\nM<V-H96X@=6YD(%1I97)E;BP@96EN92!\"975T92!D97(@2'5N9&4L(&1E<B!!\r\nM9&QE<BP@:F$@9F%S=\"!A;&QE<B!2875B=&EE<F4A(%5N<V5R92!S=&5T92!!\r\nM;F=S=\"!I<W0@Y')G97(@86QS(&1E<B!4;V0@<V5L8G-T+B!!=68L(&QAWW0@\r\nM=6YS(&5I;B!F_'(@86QL96UA;\"!S=&5R8F5N+B(@#0H-\"DEN(&5I;F5M(&YA\r\nM:&5N(%1E:6-H('=O;&QT96X@<VEE('-I8V@@;G5N(&5R<^1U9F5N.R!S:64@\r\nM96EL=&5N(&EH;2!Z=3L@86QL96EN(&1A<R!A==]E<F]R9&5N=&QI8VAE($=E\r\nM=/9S92!U;F0@:6AR92!W=6YD97)B87)E($=E<W1A;'0@97)S8VAR96-K=&4@\r\nM96EN92!-96YG92!&<O9S8VAE+\"!D:64@86T@569E<B!S8=]E;BP@<V\\@<V5H\r\nM<BP@9&'?('-I92!A=69S('-C:&YE;&QS=&4@=6YT97)T875C:'1E;BX@#0H-\r\nM\"B)(86QT(BP@<FEE9B!N=6X@96)E;B!D:65S97(@4W!R96-H97(L(\")W:7(@\r\nM=V]L;&5N(&1A<R!%<G/D=69E;B!N;V-H(&5I;B!W96YI9R!A=69S8VAI96)E\r\nM;BP@9&5N;B!A=6-H('5N<R!F_')C:'1E;BP@=VEE(&EH<B!S96AT+\"!E:6YI\r\nM9V4@5&EE<F4L('=E;&-H92!A;'-O('=O:&P@;F]C:\"!U;F=L_&-K;&EC:&5R\r\n;('-E:6X@;?QS<V5N(&%L<R!W:7(N(B`-\"@T*\r\n`\r\nend\r\n"
},
"offset_header": 1444,
"offset_body": 1655,
"offset_end": 2745
},
{
"Text": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "farmerandstork.txt"
}
},
"content_type": {
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
@@ -189,8 +353,43 @@ Birds of a feather flock together.
}
}
},
"contents": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n\r"
}
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "farmerandstork.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 2796,
"end": 2829
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 2849,
"end": 2893
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n"
},
"offset_header": 2783,
"offset_body": 2895,
"offset_end": 3701
}
]
}
+180 -59
View File
@@ -30,69 +30,190 @@ ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige =
Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 10,
"second": 31,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGMEKBCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Fr�sche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"Importance": [
"Normal"
],
"X-MSMail-Priority": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 10,
"second": 31,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGMEKBCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 89
}
],
[
{
"Rfc": "subject"
},
{
"start": 97,
"end": 148
}
],
[
{
"Rfc": "date"
},
{
"start": 153,
"end": 187
}
],
[
{
"Rfc": "message_id"
},
{
"start": 198,
"end": 248
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 261,
"end": 267
}
],
[
{
"Rfc": "content_type"
},
{
"start": 280,
"end": 317
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 343,
"end": 362
}
],
[
{
"Other": "X-Priority"
},
{
"start": 373,
"end": 386
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 404,
"end": 413
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 422,
"end": 475
}
],
[
{
"Other": "Importance"
},
{
"start": 486,
"end": 495
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 505,
"end": 553
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 0,
"offset_body": 555,
"offset_end": 1364
}
]
}
+386 -93
View File
@@ -155,105 +155,356 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_000C_01BFC038.5A5C8E60--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 44,
"second": 45,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGKEKFCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Test message from Microsoft Outlook 00",
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"boundary": "----=_NextPart_000_000C_01BFC038.5A5C8E60"
}
},
"others": {
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"X-MSMail-Priority": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-Priority": [
"3 (Normal)"
],
"Importance": [
"Normal"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"contents": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><FONT face=Arial size=2><BR>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp;&nbsp;</FONT></DIV>\n<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>\n<DIV><FONT face=Arial size=2><IMG align=baseline alt=\"blue ball\" border=0 \nhspace=0 src=\"cid:823504223@17052000-0f8d\"><BR>&nbsp;<BR>Slow but steady wins \nthe race.&nbsp; </FONT></DIV>\n<DIV>&nbsp;</DIV>\n<DIV><FONT face=Arial size=2><IMG align=baseline alt=\"red ball\" border=0 \nhspace=0 src=\"cid:823504223@17052000-0f94\"><BR></DIV></FONT></BODY></HTML>\n"
}
3
],
"text_body": [
2
],
"attachments": [
4,
5
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Test message from Microsoft Outlook 00"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 44,
"second": 45,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGKEKFCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"boundary": "----=_NextPart_000_000C_01BFC038.5A5C8E60"
}
}
}
},
"contents": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n\n\n \nSlow but steady wins the race. \n\n\n\n"
}
],
"attachments": [
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 76
}
],
[
{
"Rfc": "subject"
},
{
"start": 84,
"end": 125
}
],
[
{
"Rfc": "date"
},
{
"start": 130,
"end": 164
}
],
[
{
"Rfc": "message_id"
},
{
"start": 175,
"end": 225
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 238,
"end": 244
}
],
[
{
"Rfc": "content_type"
},
{
"start": 257,
"end": 333
}
],
[
{
"Other": "X-Priority"
},
{
"start": 344,
"end": 357
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 375,
"end": 384
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 393,
"end": 446
}
],
[
{
"Other": "Importance"
},
{
"start": 457,
"end": 466
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 476,
"end": 524
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
4,
5
]
},
"offset_header": 0,
"offset_body": 526,
"offset_end": 7633
},
{
"Binary": {
"header": {
"content_id": "823504223@17052000-0f8d",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "----=_NextPart_001_000D_01BFC038.5A5C8E60"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 632,
"end": 712
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 619,
"offset_body": 714,
"offset_end": 3435
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 774,
"end": 811
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 837,
"end": 856
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n\n\n \nSlow but steady wins the race. \n\n\n\n"
},
"offset_header": 761,
"offset_body": 858,
"offset_end": 1669
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1727,
"end": 1763
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1789,
"end": 1808
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><FONT face=Arial size=2><BR>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp;&nbsp;</FONT></DIV>\n<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>\n<DIV><FONT face=Arial size=2><IMG align=baseline alt=\"blue ball\" border=0 \nhspace=0 src=\"cid:823504223@17052000-0f8d\"><BR>&nbsp;<BR>Slow but steady wins \nthe race.&nbsp; </FONT></DIV>\n<DIV>&nbsp;</DIV>\n<DIV><FONT face=Arial size=2><IMG align=baseline alt=\"red ball\" border=0 \nhspace=0 src=\"cid:823504223@17052000-0f94\"><BR></DIV></FONT></BODY></HTML>\n"
},
"offset_header": 1714,
"offset_body": 1810,
"offset_end": 3388
},
{
"headers_rfc": {
"content_id": {
"Text": "823504223@17052000-0f8d"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "blueball.png"
}
}
},
"contents": [
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3495,
"end": 3530
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3556,
"end": 3565
}
],
[
{
"Rfc": "content_id"
},
{
"start": 3576,
"end": 3604
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1580,22 +1831,61 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 3482,
"offset_body": 3606,
"offset_end": 5424
},
{
"Binary": {
"header": {
"content_id": "823504223@17052000-0f94",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_id": {
"Text": "823504223@17052000-0f94"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "redball.png"
}
}
},
"contents": [
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5482,
"end": 5516
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5542,
"end": 5551
}
],
[
{
"Rfc": "content_id"
},
{
"start": 5562,
"end": 5590
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3050,7 +3340,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 5469,
"offset_body": 5592,
"offset_end": 7586
}
]
}
+162 -53
View File
@@ -26,63 +26,172 @@ reached the goal, and was comfortably dozing after her fatigue.
Slow but steady wins the race.
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 26,
"second": 16,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "392362D8.B650789F@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_transfer_encoding": "7bit",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
},
"others": {
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
],
"X-Accept-Language": [
"en"
],
"X-Priority": [
"1 (Highest)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise,<br/>who replied, laughing: \"Though you be swift as the wind, I will beat<br/>you in a race.\" The Hare, believing her assertion to be simply<br/>impossible, assented to the proposal; and they agreed that the Fox<br/>should choose the course and fix the goal. On the day appointed for the<br/>race the two started together. The Tortoise never for a moment stopped,<br/>but went on with a slow but steady pace straight to the end of the<br/>course. The Hare, lying down by the wayside, fell fast asleep. At last<br/>waking up, and moving as fast as he could, he saw the Tortoise had<br/>reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race.<br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r\n"
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 26,
"second": 16,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "392362D8.B650789F@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Other": "X-Priority"
},
{
"start": 305,
"end": 319
}
],
[
{
"Rfc": "content_type"
},
{
"start": 332,
"end": 363
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 389,
"end": 396
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r\n"
},
"offset_header": 0,
"offset_body": 398,
"offset_end": 1167
}
]
}
+350 -98
View File
@@ -110,87 +110,215 @@ Slow but steady wins the race.
--------------0BBC657DDC74A0B8454627FD--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 28,
"second": 27,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "3923635B.85C58444@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------0BBC657DDC74A0B8454627FD"
}
},
"others": {
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
],
"X-Accept-Language": [
"en"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise,<br/>who replied, laughing: \"Though you be swift as the wind, I will beat<br/>you in a race.\" The Hare, believing her assertion to be simply<br/>impossible, assented to the proposal; and they agreed that the Fox<br/>should choose the course and fix the goal. On the day appointed for the<br/>race the two started together. The Tortoise never for a moment stopped,<br/>but went on with a slow but steady pace straight to the end of the<br/>course. The Hare, lying down by the wayside, fell fast asleep. At last<br/>waking up, and moving as fast as he could, he saw the Tortoise had<br/>reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race.</body></html>"
},
0,
1
1,
2,
3
],
"text_body": [
1,
2,
3
],
"attachments": [
2,
3,
4
],
"parts": [
{
"header": {
"content_transfer_encoding": "7bit",
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 28,
"second": 27,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "3923635B.85C58444@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------0BBC657DDC74A0B8454627FD"
}
}
}
},
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r"
},
0,
1
],
"attachments": [
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "blueball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 376
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3,
4
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 6292
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 477,
"end": 508
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 534,
"end": 541
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race."
},
"offset_header": 464,
"offset_body": 543,
"offset_end": 1312
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -198,7 +326,48 @@ Slow but steady wins the race.
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1365,
"end": 1400
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1426,
"end": 1435
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1455,
"end": 1491
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -1525,19 +1694,18 @@ Slow but steady wins the race.
96,
130
]
}
},
"offset_header": 1352,
"offset_body": 1493,
"offset_end": 3311
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1545,7 +1713,48 @@ Slow but steady wins the race.
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3364,
"end": 3400
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3426,
"end": 3435
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3455,
"end": 3492
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -2845,19 +3054,18 @@ Slow but steady wins the race.
96,
130
]
}
},
"offset_header": 3351,
"offset_body": 3494,
"offset_end": 5276
},
{
"Text": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "hareandtoroise.txt"
}
},
"content_transfer_encoding": "7bit",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
@@ -2866,8 +3074,52 @@ Slow but steady wins the race.
}
}
},
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n\r"
}
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "hareandtoroise.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5329,
"end": 5389
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5415,
"end": 5422
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5442,
"end": 5484
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n"
},
"offset_header": 5316,
"offset_body": 5486,
"offset_end": 6250
}
]
}
+310 -77
View File
@@ -95,76 +95,185 @@ mWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBp
Z3VldDZzO7wAAAAASUVORK5CYII=
---1463757054-952513540-958744548=:8452--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 9,
"minute": 55,
"second": 48,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"message_id": "Pine.LNX.4.21.0005190951410.8452-102000@penguin.example.com",
"mime_version": "1.0",
"subject": "Test message from PINE",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "-1463757054-952513540-958744548=:8452"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>This is a test message from PINE MUA.<br/><br/></body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2,
3
],
"parts": [
{
"header": {
"headers_rfc": {
"subject": {
"Text": "Test message from PINE"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 9,
"minute": 55,
"second": 48,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "Pine.LNX.4.21.0005190951410.8452-102000@penguin.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "US-ASCII"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "-1463757054-952513540-958744548=:8452"
}
}
}
},
"contents": "This is a test message from PINE MUA.\r\n\r\n\r"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_description": "A PNG graphic file",
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
}
"headers_raw": [
[
{
"Rfc": "date"
},
"content_id": "Pine.LNX.4.21.0005190955480.8452@penguin.example.com",
"content_transfer_encoding": "BASE64",
"content_type": {
{
"start": 5,
"end": 45
}
],
[
{
"Rfc": "from"
},
{
"start": 50,
"end": 91
}
],
[
{
"Rfc": "to"
},
{
"start": 94,
"end": 124
}
],
[
{
"Rfc": "subject"
},
{
"start": 132,
"end": 157
}
],
[
{
"Rfc": "message_id"
},
{
"start": 168,
"end": 232
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 245,
"end": 251
}
],
[
{
"Rfc": "content_type"
},
{
"start": 264,
"end": 332
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 334,
"offset_end": 5171
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "US-ASCII"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 608,
"end": 639
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "This is a test message from PINE MUA.\r\n\r\n"
},
"offset_header": 595,
"offset_body": 641,
"offset_end": 684
},
{
"headers_rfc": {
"content_description": {
"Text": "A PNG graphic file"
},
"content_id": {
"Text": "Pine.LNX.4.21.0005190955480.8452@penguin.example.com"
},
"content_transfer_encoding": {
"Text": "BASE64"
},
"content_type": {
"ContentType": {
"c_type": "application",
"c_subtype": "octet-stream",
"attributes": {
@@ -172,7 +281,66 @@ Z3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 738,
"end": 785
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 811,
"end": 820
}
],
[
{
"Rfc": "content_id"
},
{
"start": 831,
"end": 888
}
],
[
{
"Rfc": "content_description"
},
{
"start": 908,
"end": 929
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 949,
"end": 986
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1627,21 +1795,24 @@ Z3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 725,
"offset_body": 988,
"offset_end": 2994
},
{
"Binary": {
"header": {
"content_description": "A PNG graphic file",
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
}
},
"content_id": "Pine.LNX.4.21.0005190955481.8452@penguin.example.com",
"content_transfer_encoding": "BASE64",
"content_type": {
"headers_rfc": {
"content_description": {
"Text": "A PNG graphic file"
},
"content_id": {
"Text": "Pine.LNX.4.21.0005190955481.8452@penguin.example.com"
},
"content_transfer_encoding": {
"Text": "BASE64"
},
"content_type": {
"ContentType": {
"c_type": "application",
"c_subtype": "octet-stream",
"attributes": {
@@ -1649,7 +1820,66 @@ Z3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3048,
"end": 3096
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3122,
"end": 3131
}
],
[
{
"Rfc": "content_id"
},
{
"start": 3142,
"end": 3199
}
],
[
{
"Rfc": "content_description"
},
{
"start": 3219,
"end": 3240
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3260,
"end": 3298
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -2976,7 +3206,10 @@ Z3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 3035,
"offset_body": 3300,
"offset_end": 5128
}
]
}
+373 -96
View File
@@ -132,97 +132,290 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
--------------C78F594988075E36AE03C243--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 8,
"second": 29,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "39235EAD.E48E2160@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------C78F594988075E36AE03C243"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "7bit",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "us-ascii"
}
}
},
"contents": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<b>Die Hasen und die Fr&ouml;sche</b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<br>&nbsp;\r\n<br>&nbsp;</html>\r\n\r"
},
0,
1
3,
4,
5
],
"text_body": [
2,
4,
5
],
"attachments": [
4,
5
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 8,
"second": 29,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "39235EAD.E48E2160@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------C78F594988075E36AE03C243"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
0,
1
],
"attachments": [
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "greenball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 376
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
4,
5
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 6608
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "------------D74AE2393FB01D1B284AE257"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 477,
"end": 552
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 464,
"offset_body": 554,
"offset_end": 2600
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 609,
"end": 642
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 668,
"end": 687
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
"offset_header": 596,
"offset_body": 689,
"offset_end": 1489
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1542,
"end": 1572
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1598,
"end": 1605
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<b>Die Hasen und die Fr&ouml;sche</b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<br>&nbsp;\r\n<br>&nbsp;</html>\r\n"
},
"offset_header": 1529,
"offset_body": 1607,
"offset_end": 2558
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -230,7 +423,48 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 2655,
"end": 2691
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 2717,
"end": 2726
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 2746,
"end": 2783
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -1530,19 +1764,18 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 2642,
"offset_body": 2785,
"offset_end": 4567
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "blueball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1550,7 +1783,48 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 4620,
"end": 4655
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 4681,
"end": 4690
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 4710,
"end": 4746
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -2877,7 +3151,10 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 4607,
"offset_body": 4748,
"offset_end": 6566
}
]
}
+162 -53
View File
@@ -32,63 +32,172 @@ n
wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere,
welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 30,
"second": 41,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "392363E1.2AC47AB3@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "UTF-8"
}
},
"others": {
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
],
"X-Accept-Language": [
"en"
],
"X-Priority": [
"5 (Lowest)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Fr�sche<br/><br/>Die Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein<br/>Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,<br/>der Adler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der<br/>Tod selbst. Auf, la�t uns ein f�r allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;<br/>allein das au�erordentliche Get�se und ihre wunderbare Gestalt<br/>erschreckte eine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs<br/>schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein<br/>wenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,<br/>welche also wohl noch ungl�cklicher sein m�ssen als wir.\"<br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Fr�sche\n\nDie Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der\nTod selbst. Auf, la�t uns ein f�r allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;\nallein das au�erordentliche Get�se und ihre wunderbare Gestalt\nerschreckte eine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs\nschnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein\nwenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,\nwelche also wohl noch ungl�cklicher sein m�ssen als wir.\"\n"
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 30,
"second": 41,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "392363E1.2AC47AB3@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "UTF-8"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Other": "X-Priority"
},
{
"start": 305,
"end": 318
}
],
[
{
"Rfc": "content_type"
},
{
"start": 331,
"end": 359
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 385,
"end": 404
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Fr�sche\n\nDie Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der\nTod selbst. Auf, la�t uns ein f�r allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;\nallein das au�erordentliche Get�se und ihre wunderbare Gestalt\nerschreckte eine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs\nschnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein\nwenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,\nwelche also wohl noch ungl�cklicher sein m�ssen als wir.\"\n"
},
"offset_header": 0,
"offset_body": 406,
"offset_end": 1208
}
]
}
+153 -50
View File
@@ -25,60 +25,163 @@ schnellste untertauchten.
wenig aufschieben, denn auch uns f+vGM-hten, wie ihr seht, einige Tiere,
welche also wohl noch ungl+uKs-licher sein m+vLM-en als wir."
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 33,
"second": 43,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "39236497.12FA2A89@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Fr+APY-sche",
"to": {
"Address": {
"name": "Heinz M+APw-ller",
"address": "mueller@example.com"
}
},
"content_transfer_encoding": "7bit",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "UTF-7"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Fr岣he<br/><br/>Die Hasen klagten einst 롥r ihre miެiche Lage; \"wir leben\", sprach ein<br/>Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,<br/>der Adler, ja fast aller Raubtiere! Unsere stete Angst ist 㱧er als der<br/>Tod selbst. Auf, la޴ uns ein f밠allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ers㴦en; sie eilten ihm zu;<br/>allein das auޥrordentliche Get岥 und ihre wunderbare Gestalt<br/>erschreckte eine Menge Fr岣he, die am Ufer saޥn, so sehr, daݠsie aufs<br/>schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers㴦en noch ein<br/>wenig aufschieben, denn auch uns f뱣hten, wie ihr seht, einige Tiere,<br/>welche also wohl noch ungl뢫licher sein m벳en als wir.\"<br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Fr岣he\r\n\r\nDie Hasen klagten einst 롥r ihre miެiche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\r\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist 㱧er als der\r\nTod selbst. Auf, la޴ uns ein f밠allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ers㴦en; sie eilten ihm zu;\r\nallein das auޥrordentliche Get岥 und ihre wunderbare Gestalt\r\nerschreckte eine Menge Fr岣he, die am Ufer saޥn, so sehr, daݠsie aufs\r\nschnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers㴦en noch ein\r\nwenig aufschieben, denn auch uns f뱣hten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch ungl뢫licher sein m벳en als wir.\"\r\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Fr+APY-sche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz M+APw-ller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 33,
"second": 43,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "39236497.12FA2A89@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "UTF-7"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 253
}
],
[
{
"Rfc": "subject"
},
{
"start": 261,
"end": 293
}
],
[
{
"Rfc": "content_type"
},
{
"start": 306,
"end": 334
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 360,
"end": 367
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Fr岣he\r\n\r\nDie Hasen klagten einst 롥r ihre miެiche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\r\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist 㱧er als der\r\nTod selbst. Auf, la޴ uns ein f밠allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ers㴦en; sie eilten ihm zu;\r\nallein das auޥrordentliche Get岥 und ihre wunderbare Gestalt\r\nerschreckte eine Menge Fr岣he, die am Ufer saޥn, so sehr, daݠsie aufs\r\nschnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers㴦en noch ein\r\nwenig aufschieben, denn auch uns f뱣hten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch ungl뢫licher sein m벳en als wir.\"\r\n"
},
"offset_header": 0,
"offset_body": 369,
"offset_end": 1158
}
]
}
+537 -119
View File
@@ -211,103 +211,386 @@ YII=
--------------A1E83A41894D3755390B838A--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 13,
"second": 9,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "39235FC5.276CCE00@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Netscape Messenger 4.7)",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------A1E83A41894D3755390B838A"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "7bit",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "us-ascii"
}
}
},
"contents": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<img SRC=\"cid:part1.39235FC5.E71D8178@example.com\" ALT=\"blue ball\" height=27 width=27><b></b>\r\n<p><b>Die Hasen und die Fr&ouml;sche</b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<p><img SRC=\"cid:part2.39235FC5.E71D8178@example.com\" height=27 width=27>\r\n<br>&nbsp;\r\n<br>&nbsp;</html>\r\n\r"
},
2,
3
4,
7,
8
],
"text_body": [
2,
7,
8
],
"attachments": [
5,
6,
7,
8
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Netscape Messenger 4.7)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 13,
"second": 9,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "39235FC5.276CCE00@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------A1E83A41894D3755390B838A"
}
}
}
},
"contents": "[blue ball]\n\nDie Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n[Image]\n\n\n"
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 266
}
],
[
{
"Rfc": "subject"
},
{
"start": 274,
"end": 346
}
],
[
{
"Rfc": "content_type"
},
{
"start": 359,
"end": 428
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
7,
8
]
},
"offset_header": 0,
"offset_body": 430,
"offset_end": 11447
},
2,
3
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "------------F03F94BA73D3B9E8C1B94D92"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 529,
"end": 604
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 516,
"offset_body": 606,
"offset_end": 7265
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 661,
"end": 694
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 720,
"end": 739
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "[blue ball]\n\nDie Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n[Image]\n\n\n"
},
"offset_header": 648,
"offset_body": 741,
"offset_end": 1567
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"boundary": "------------C02FA3D0A04E95F295FB25EB"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1620,
"end": 1691
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
4,
5,
6
]
},
"offset_header": 1607,
"offset_body": 1693,
"offset_end": 7221
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1748,
"end": 1778
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1804,
"end": 1811
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<img SRC=\"cid:part1.39235FC5.E71D8178@example.com\" ALT=\"blue ball\" height=27 width=27><b></b>\r\n<p><b>Die Hasen und die Fr&ouml;sche</b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<p><img SRC=\"cid:part2.39235FC5.E71D8178@example.com\" height=27 width=27>\r\n<br>&nbsp;\r\n<br>&nbsp;</html>\r\n"
},
"offset_header": 1735,
"offset_body": 1813,
"offset_end": 2937
},
{
"headers_rfc": {
"content_id": {
"Text": "part1.39235FC5.E71D8178@example.com"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": null
}
},
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "C:TEMPnsmailEG.png"
}
},
"content_id": "part1.39235FC5.E71D8178@example.com",
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png"
}
},
"contents": [
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 2990,
"end": 3002
}
],
[
{
"Rfc": "content_id"
},
{
"start": 3013,
"end": 3053
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3079,
"end": 3088
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3108,
"end": 3150
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1634,25 +1917,77 @@ YII=
96,
130
]
}
},
"offset_header": 2977,
"offset_body": 3152,
"offset_end": 4970
},
{
"Binary": {
"header": {
"content_disposition": {
"headers_rfc": {
"content_id": {
"Text": "part2.39235FC5.E71D8178@example.com"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": null
}
},
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "C:TEMPnsmail39.png"
}
},
"content_id": "part2.39235FC5.E71D8178@example.com",
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png"
}
},
"contents": [
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5023,
"end": 5035
}
],
[
{
"Rfc": "content_id"
},
{
"start": 5046,
"end": 5086
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5112,
"end": 5121
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5141,
"end": 5183
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3107,19 +3442,18 @@ YII=
96,
130
]
}
},
"offset_header": 5010,
"offset_body": 5185,
"offset_end": 7179
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "redball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -3127,7 +3461,48 @@ YII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 7320,
"end": 7354
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 7380,
"end": 7389
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 7409,
"end": 7444
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -4582,19 +4957,18 @@ YII=
96,
130
]
}
},
"offset_header": 7307,
"offset_body": 7446,
"offset_end": 9440
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -4602,7 +4976,48 @@ YII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 9493,
"end": 9529
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 9555,
"end": 9564
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 9584,
"end": 9621
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -5902,7 +6317,10 @@ YII=
96,
130
]
}
},
"offset_header": 9480,
"offset_body": 9623,
"offset_end": 11405
}
]
}
+135 -42
View File
@@ -25,52 +25,145 @@ lche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 10,
"minute": 18,
"second": 3,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"message_id": "Pine.LNX.4.21.0005191014500.8452-100000@penguin.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"content_transfer_encoding": "QUOTED-PRINTABLE",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 10,
"minute": 18,
"second": 3,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "Pine.LNX.4.21.0005191014500.8452-100000@penguin.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "QUOTED-PRINTABLE"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "date"
},
{
"start": 5,
"end": 45
}
],
[
{
"Rfc": "from"
},
{
"start": 50,
"end": 91
}
],
[
{
"Rfc": "to"
},
{
"start": 94,
"end": 159
}
],
[
{
"Rfc": "subject"
},
{
"start": 167,
"end": 214
}
],
[
{
"Rfc": "message_id"
},
{
"start": 225,
"end": 289
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 302,
"end": 308
}
],
[
{
"Rfc": "content_type"
},
{
"start": 321,
"end": 354
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 380,
"end": 399
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n\n"
},
"offset_header": 0,
"offset_body": 401,
"offset_end": 1212
}
]
}
+240 -72
View File
@@ -50,85 +50,209 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
--------------E7889DDF0F75D34163841C59--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 42,
"second": 31,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "392366A7.21929EA7@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------E7889DDF0F75D34163841C59"
}
},
"others": {
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
],
"X-Accept-Language": [
"en"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body> </body></html>"
},
0
1,
2
],
"text_body": [
1,
2
],
"attachments": [
2
],
"parts": [
{
"header": {
"content_transfer_encoding": "7bit",
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 42,
"second": 31,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "392366A7.21929EA7@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------E7889DDF0F75D34163841C59"
}
}
}
},
"contents": " \r"
},
0
],
"attachments": [
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "blueball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 376
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 2587
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 477,
"end": 508
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 534,
"end": 541
}
]
],
"is_encoding_problem": false,
"body": {
"Text": " "
},
"offset_header": 464,
"offset_body": 543,
"offset_end": 546
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -136,7 +260,48 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 599,
"end": 634
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 660,
"end": 669
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 689,
"end": 725
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -1463,7 +1628,10 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 586,
"offset_body": 727,
"offset_end": 2545
}
]
}
+153 -50
View File
@@ -16,60 +16,163 @@ A HARE one day ridiculed the short feet and slow pace of the Tortoise, who repli
Slow but steady wins the race.
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 24,
"second": 11,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "3923625B.59F0C3AC@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_transfer_encoding": "7bit",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
},
"others": {
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
],
"X-Accept-Language": [
"en"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race.<br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r\n"
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 24,
"second": 11,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "3923625B.59F0C3AC@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 338
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 364,
"end": 371
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r\n"
},
"offset_header": 0,
"offset_body": 373,
"offset_end": 1133
}
]
}
+460 -109
View File
@@ -170,93 +170,309 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
--------------B7133A01A6B323BF00DBC9A7--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 18,
"second": 27,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "39236103.FFE674FC@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------B7133A01A6B323BF00DBC9A7"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
2,
5,
6
],
"text_body": [
2,
5,
6
],
"attachments": [
3,
4,
5,
6
],
"parts": [
{
"header": {
"content_transfer_encoding": "7bit",
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 18,
"second": 27,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "39236103.FFE674FC@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "us-ascii"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------B7133A01A6B323BF00DBC9A7"
}
}
}
},
"contents": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<img SRC=\"cid:part1.39236103.1B697A54@example.com\" ALT=\"blue ball\" height=27 width=27><b></b>\r\n<p><b><font size=+2>Die Hasen und die Fr&ouml;sche</font></b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<p><img SRC=\"cid:part2.39236103.1B697A54@example.com\" ALT=\"red ball\" height=27 width=27></html>\r\n\r"
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 277
}
],
[
{
"Rfc": "subject"
},
{
"start": 285,
"end": 331
}
],
[
{
"Rfc": "content_type"
},
{
"start": 344,
"end": 413
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
5,
6
]
},
"offset_header": 0,
"offset_body": 415,
"offset_end": 10135
},
2,
3
],
"text_body": [
{
"contents": "Die Hasen und die Frösche Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\""
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"boundary": "------------8E6A06810565BCAB5E1F7D97"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 514,
"end": 585
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3,
4
]
},
"offset_header": 501,
"offset_body": 587,
"offset_end": 6127
},
2,
3
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 642,
"end": 672
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 698,
"end": 705
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<img SRC=\"cid:part1.39236103.1B697A54@example.com\" ALT=\"blue ball\" height=27 width=27><b></b>\r\n<p><b><font size=+2>Die Hasen und die Fr&ouml;sche</font></b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<p><img SRC=\"cid:part2.39236103.1B697A54@example.com\" ALT=\"red ball\" height=27 width=27></html>\r\n"
},
"offset_header": 629,
"offset_body": 707,
"offset_end": 1843
},
{
"headers_rfc": {
"content_id": {
"Text": "part1.39236103.1B697A54@example.com"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": null
}
},
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "C:TEMPnsmailV0.png"
}
},
"content_id": "part1.39236103.1B697A54@example.com",
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png"
}
},
"contents": [
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1896,
"end": 1908
}
],
[
{
"Rfc": "content_id"
},
{
"start": 1919,
"end": 1959
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1985,
"end": 1994
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 2014,
"end": 2056
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1583,25 +1799,77 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 1883,
"offset_body": 2058,
"offset_end": 3876
},
{
"Binary": {
"header": {
"content_disposition": {
"headers_rfc": {
"content_id": {
"Text": "part2.39236103.1B697A54@example.com"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": null
}
},
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "C:TEMPnsmailNM.png"
}
},
"content_id": "part2.39236103.1B697A54@example.com",
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png"
}
},
"contents": [
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3929,
"end": 3941
}
],
[
{
"Rfc": "content_id"
},
{
"start": 3952,
"end": 3992
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 4018,
"end": 4027
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 4047,
"end": 4089
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3056,19 +3324,18 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 3916,
"offset_body": 4091,
"offset_end": 6085
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -3076,7 +3343,48 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 6182,
"end": 6218
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 6244,
"end": 6253
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 6273,
"end": 6310
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -4376,19 +4684,18 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 6169,
"offset_body": 6312,
"offset_end": 8094
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "blueball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -4396,7 +4703,48 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 8147,
"end": 8182
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 8208,
"end": 8217
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 8237,
"end": 8273
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -5723,7 +6071,10 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 8134,
"offset_body": 8275,
"offset_end": 10093
}
]
}
+153 -50
View File
@@ -27,60 +27,163 @@ schnellste untertauchten. =
n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere=
, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 41,
"second": 7,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "39236653.CAA8A090@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"<br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 41,
"second": 7,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "39236653.CAA8A090@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 277
}
],
[
{
"Rfc": "subject"
},
{
"start": 285,
"end": 332
}
],
[
{
"Rfc": "content_type"
},
{
"start": 345,
"end": 378
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 404,
"end": 423
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"\n"
},
"offset_header": 0,
"offset_body": 425,
"offset_end": 1231
}
]
}
+232 -63
View File
@@ -56,76 +56,183 @@ JXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5IFl2ZXMgUGlndWV0NnM7
vAAAAABJRU5ErkJggg==
---1463757054-170444605-958746196=:8452--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 10,
"minute": 23,
"second": 16,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"message_id": "Pine.LNX.4.21.0005191019440.8452-101000@penguin.example.com",
"mime_version": "1.0",
"subject": "PNG graphic",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "-1463757054-170444605-958746196=:8452"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body></body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"header": {
"headers_rfc": {
"subject": {
"Text": "PNG graphic"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 10,
"minute": 23,
"second": 16,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "Pine.LNX.4.21.0005191019440.8452-101000@penguin.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "US-ASCII"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "-1463757054-170444605-958746196=:8452"
}
}
}
},
"contents": "\r"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_description": "red ball",
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
}
"headers_raw": [
[
{
"Rfc": "date"
},
"content_id": "Pine.LNX.4.21.0005191023160.8452@penguin.example.com",
"content_transfer_encoding": "BASE64",
"content_type": {
{
"start": 5,
"end": 45
}
],
[
{
"Rfc": "from"
},
{
"start": 50,
"end": 91
}
],
[
{
"Rfc": "to"
},
{
"start": 94,
"end": 150
}
],
[
{
"Rfc": "subject"
},
{
"start": 158,
"end": 172
}
],
[
{
"Rfc": "message_id"
},
{
"start": 183,
"end": 247
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 260,
"end": 266
}
],
[
{
"Rfc": "content_type"
},
{
"start": 279,
"end": 347
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 349,
"offset_end": 3001
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "US-ASCII"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 623,
"end": 654
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\n"
},
"offset_header": 610,
"offset_body": 656,
"offset_end": 658
},
{
"headers_rfc": {
"content_description": {
"Text": "red ball"
},
"content_id": {
"Text": "Pine.LNX.4.21.0005191023160.8452@penguin.example.com"
},
"content_transfer_encoding": {
"Text": "BASE64"
},
"content_type": {
"ContentType": {
"c_type": "application",
"c_subtype": "octet-stream",
"attributes": {
@@ -133,7 +240,66 @@ vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 712,
"end": 759
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 785,
"end": 794
}
],
[
{
"Rfc": "content_id"
},
{
"start": 805,
"end": 862
}
],
[
{
"Rfc": "content_description"
},
{
"start": 882,
"end": 893
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 913,
"end": 950
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1588,7 +1754,10 @@ vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 699,
"offset_body": 952,
"offset_end": 2958
}
]
}
+240 -72
View File
@@ -57,93 +57,261 @@ Birds of a feather flock together.
--------------77060D866A66DC8D0921E051--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 50,
"second": 4,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "3923686C.99FB5E36@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------77060D866A66DC8D0921E051"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise,<br/>who replied, laughing: \"Though you be swift as the wind, I will beat<br/>you in a race.\" The Hare, believing her assertion to be simply<br/>impossible, assented to the proposal; and they agreed that the Fox<br/>should choose the course and fix the goal. On the day appointed for the<br/>race the two started together. The Tortoise never for a moment stopped,<br/>but went on with a slow but steady pace straight to the end of the<br/>course. The Hare, lying down by the wayside, fell fast asleep. At last<br/>waking up, and moving as fast as he could, he saw the Tortoise had<br/>reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race.</body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"header": {
"content_transfer_encoding": "7bit",
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 50,
"second": 4,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "3923686C.99FB5E36@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------77060D866A66DC8D0921E051"
}
}
}
},
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r"
}
],
"attachments": [
{
"Text": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "farmerandstork.txt"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "7bit",
"content_type": {
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 376
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 2370
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii",
"name": "farmerandstork.txt"
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 477,
"end": 508
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 534,
"end": 541
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race."
},
"offset_header": 464,
"offset_body": 543,
"offset_end": 1312
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"name": "farmerandstork.txt",
"charset": "us-ascii"
}
}
},
"contents": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n\r"
}
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "farmerandstork.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1365,
"end": 1425
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1451,
"end": 1458
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1478,
"end": 1520
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n"
},
"offset_header": 1352,
"offset_body": 1522,
"offset_end": 2328
}
]
}
+226 -65
View File
@@ -60,79 +60,240 @@ als wir."
--------------9D454F23DA86BCD63FA3805F--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 22,
"minute": 47,
"second": 43,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "392359CF.DFF4527@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Netscape Communicator 4.7)",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "------------9D454F23DA86BCD63FA3805F"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"header": {
"content_transfer_encoding": "7bit",
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "us-ascii"
}
}
},
"contents": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<b>Die Hasen und die Fr&ouml;sche</b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<br>&nbsp;\r\n<br>&nbsp;</html>\r\n\r"
}
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Netscape Communicator 4.7)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 22,
"minute": 47,
"second": 43,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "392359CF.DFF4527@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": {
"boundary": "------------9D454F23DA86BCD63FA3805F"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 44
}
],
[
{
"Rfc": "date"
},
{
"start": 49,
"end": 83
}
],
[
{
"Rfc": "from"
},
{
"start": 88,
"end": 125
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 134,
"end": 164
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 182,
"end": 187
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 200,
"end": 206
}
],
[
{
"Rfc": "to"
},
{
"start": 209,
"end": 265
}
],
[
{
"Rfc": "subject"
},
{
"start": 273,
"end": 348
}
],
[
{
"Rfc": "content_type"
},
{
"start": 361,
"end": 436
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 438,
"offset_end": 2484
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 493,
"end": 526
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 552,
"end": 571
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
"offset_header": 480,
"offset_body": 573,
"offset_end": 1373
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1426,
"end": 1456
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1482,
"end": 1489
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<b>Die Hasen und die Fr&ouml;sche</b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<br>&nbsp;\r\n<br>&nbsp;</html>\r\n"
},
"offset_header": 1413,
"offset_body": 1491,
"offset_end": 2442
}
]
}
+351 -99
View File
@@ -136,89 +136,217 @@ xW62p+lT+Yi747sD/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBi
eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
--------------A1FCDEE154E03D875E5D6779--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 6,
"second": 4,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "39235E1C.1DC7EA90@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------A1FCDEE154E03D875E5D6779"
}
},
"others": {
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
],
"X-Accept-Language": [
"en"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein<br/>Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,<br/>der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der<br/>Tod selbst. Auf, laßt uns ein für allemal sterben.\"<br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;<br/>allein das außerordentliche Getöse und ihre wunderbare Gestalt<br/>erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs<br/>schnellste untertauchten.<br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein<br/>wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,<br/>welche also wohl noch unglücklicher sein müssen als wir.\"<br/><br/><br/></body></html>"
},
0,
1,
2
2,
3,
4
],
"text_body": [
1,
2,
3,
4
],
"attachments": [
2,
3,
4
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 6,
"second": 4,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "39235E1C.1DC7EA90@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------A1FCDEE154E03D875E5D6779"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
0,
1,
2
],
"attachments": [
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "redball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 376
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3,
4
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 7536
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 477,
"end": 510
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 536,
"end": 555
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
"offset_header": 464,
"offset_body": 557,
"offset_end": 1357
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -226,7 +354,48 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1410,
"end": 1444
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1470,
"end": 1479
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1499,
"end": 1534
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -1681,19 +1850,18 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 1397,
"offset_body": 1536,
"offset_end": 3530
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1701,7 +1869,48 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3583,
"end": 3619
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3645,
"end": 3654
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3674,
"end": 3711
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -3001,19 +3210,18 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 3570,
"offset_body": 3713,
"offset_end": 5495
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "blueball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -3021,7 +3229,48 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5548,
"end": 5583
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5609,
"end": 5618
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5638,
"end": 5674
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
137,
80,
78,
@@ -4348,7 +4597,10 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 5535,
"offset_body": 5676,
"offset_end": 7494
}
]
}
+238 -69
View File
@@ -41,82 +41,189 @@ LCBlaW5pZ2UgVGllcmUsIHdlbGNoZSBhbHNvIHdvaGwgbm9jaCB1bmds/GNr
bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo=
---1463757054-891160829-958746372=:8452--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 10,
"minute": 26,
"second": 12,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"message_id": "Pine.LNX.4.21.0005191024380.8452-200000@penguin.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"AddressList": [
{
"name": "Joe Blow",
"address": "blow@example.com"
},
{
"name": "Heinz Müller",
"address": "mueller@example.com"
}
]
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "-1463757054-891160829-958746372=:8452"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body></body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"header": {
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"to": {
"AddressList": [
{
"name": "Joe Blow",
"address": "blow@example.com"
},
{
"name": "Heinz Müller",
"address": "mueller@example.com"
}
]
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 10,
"minute": 26,
"second": 12,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "Pine.LNX.4.21.0005191024380.8452-200000@penguin.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "US-ASCII"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "-1463757054-891160829-958746372=:8452"
}
}
}
},
"contents": "\r"
}
],
"attachments": [
{
"Text": {
"header": {
"content_description": "Short story in German",
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "HasenundFrösche.txt"
}
"headers_raw": [
[
{
"Rfc": "date"
},
"content_id": "Pine.LNX.4.21.0005191026120.8452@penguin.example.com",
"content_transfer_encoding": "BASE64",
"content_type": {
{
"start": 5,
"end": 45
}
],
[
{
"Rfc": "from"
},
{
"start": 50,
"end": 91
}
],
[
{
"Rfc": "to"
},
{
"start": 94,
"end": 185
}
],
[
{
"Rfc": "subject"
},
{
"start": 193,
"end": 240
}
],
[
{
"Rfc": "message_id"
},
{
"start": 251,
"end": 315
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 328,
"end": 334
}
],
[
{
"Rfc": "content_type"
},
{
"start": 347,
"end": 415
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 417,
"offset_end": 2170
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "US-ASCII"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 691,
"end": 722
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\n"
},
"offset_header": 678,
"offset_body": 724,
"offset_end": 726
},
{
"headers_rfc": {
"content_description": {
"Text": "Short story in German"
},
"content_id": {
"Text": "Pine.LNX.4.21.0005191026120.8452@penguin.example.com"
},
"content_transfer_encoding": {
"Text": "BASE64"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
@@ -125,8 +232,70 @@ bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo=
}
}
},
"contents": "Die Hasen und die Frösche\r\r\n\r\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\r\n\r\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\r\n\r\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\r\n\r\r\n"
}
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "HasenundFrösche.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 780,
"end": 856
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 882,
"end": 891
}
],
[
{
"Rfc": "content_id"
},
{
"start": 902,
"end": 959
}
],
[
{
"Rfc": "content_description"
},
{
"start": 979,
"end": 1003
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1023,
"end": 1083
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\r\n\r\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\r\n\r\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\r\n\r\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\r\n\r\r\n"
},
"offset_header": 767,
"offset_body": 1085,
"offset_end": 2127
}
]
}
+153 -50
View File
@@ -31,60 +31,163 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 22,
"minute": 31,
"second": 57,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "3923561C.B7078DEF@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Netscape Communicator 4.7)",
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein<br/>Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,<br/>der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der<br/>Tod selbst. Auf, laßt uns ein für allemal sterben.\"<br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;<br/>allein das außerordentliche Getöse und ihre wunderbare Gestalt<br/>erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs<br/>schnellste untertauchten.<br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein<br/>wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,<br/>welche also wohl noch unglücklicher sein müssen als wir.\"<br/><br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Netscape Communicator 4.7)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 22,
"minute": 31,
"second": 57,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "3923561C.B7078DEF@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "message_id"
},
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 277
}
],
[
{
"Rfc": "subject"
},
{
"start": 285,
"end": 360
}
],
[
{
"Rfc": "content_type"
},
{
"start": 373,
"end": 406
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 432,
"end": 451
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
"offset_header": 0,
"offset_body": 453,
"offset_end": 1251
}
]
}
+238 -70
View File
@@ -59,83 +59,207 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere=
--------------CA611088711119FBDB3473B4--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 47,
"second": 8,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "392367BC.3D075C95@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------CA611088711119FBDB3473B4"
}
},
"others": {
"X-Accept-Language": [
"en"
],
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise,<br/>who replied, laughing: \"Though you be swift as the wind, I will beat<br/>you in a race.\" The Hare, believing her assertion to be simply<br/>impossible, assented to the proposal; and they agreed that the Fox<br/>should choose the course and fix the goal. On the day appointed for the<br/>race the two started together. The Tortoise never for a moment stopped,<br/>but went on with a slow but steady pace straight to the end of the<br/>course. The Hare, lying down by the wayside, fell fast asleep. At last<br/>waking up, and moving as fast as he could, he saw the Tortoise had<br/>reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race.</body></html>"
}
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"header": {
"content_transfer_encoding": "7bit",
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 47,
"second": 8,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "392367BC.3D075C95@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------CA611088711119FBDB3473B4"
}
}
}
},
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r"
}
],
"attachments": [
{
"Text": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "HasenundFrösche.txt"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 376
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 2436
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 477,
"end": 508
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 534,
"end": 541
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race."
},
"offset_header": 464,
"offset_body": 543,
"offset_end": 1312
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
@@ -144,8 +268,52 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere=
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
}
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "HasenundFrösche.txt"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1365,
"end": 1449
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1475,
"end": 1494
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1514,
"end": 1578
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 1352,
"offset_body": 1580,
"offset_end": 2394
}
]
}
+354 -105
View File
@@ -154,89 +154,217 @@ end
--------------177483472E7788F4AD46AB1A--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 44,
"second": 12,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "3923670C.67D83A99@example.com",
"mime_version": "1.0",
"subject": "Test message from Netscape Communicator 4.7",
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------177483472E7788F4AD46AB1A"
}
},
"others": {
"X-Mailer": [
"Mozilla 4.7 [en] (WinNT; I)"
],
"X-Accept-Language": [
"en"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body><br/>The Hare and the Tortoise <br/> <br/>A HARE one day ridiculed the short feet and slow pace of the Tortoise,<br/>who replied, laughing: \"Though you be swift as the wind, I will beat<br/>you in a race.\" The Hare, believing her assertion to be simply<br/>impossible, assented to the proposal; and they agreed that the Fox<br/>should choose the course and fix the goal. On the day appointed for the<br/>race the two started together. The Tortoise never for a moment stopped,<br/>but went on with a slow but steady pace straight to the end of the<br/>course. The Hare, lying down by the wayside, fell fast asleep. At last<br/>waking up, and moving as fast as he could, he saw the Tortoise had<br/>reached the goal, and was comfortably dozing after her fatigue. <br/> <br/>Slow but steady wins the race.</body></html>"
},
0,
1,
2
2,
3,
4
],
"text_body": [
1,
2,
3,
4
],
"attachments": [
2,
3,
4
],
"parts": [
{
"header": {
"content_transfer_encoding": "7bit",
"headers_rfc": {
"subject": {
"Text": "Test message from Netscape Communicator 4.7"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 44,
"second": 12,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "3923670C.67D83A99@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "------------177483472E7788F4AD46AB1A"
}
}
}
},
"contents": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r"
},
0,
1,
2
],
"attachments": [
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "redball.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_transfer_encoding": "x-uuencode",
"content_type": {
{
"start": 11,
"end": 45
}
],
[
{
"Rfc": "date"
},
{
"start": 50,
"end": 84
}
],
[
{
"Rfc": "from"
},
{
"start": 89,
"end": 126
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 135,
"end": 165
}
],
[
{
"Other": "X-Accept-Language"
},
{
"start": 183,
"end": 188
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 201,
"end": 207
}
],
[
{
"Rfc": "to"
},
{
"start": 210,
"end": 240
}
],
[
{
"Rfc": "subject"
},
{
"start": 248,
"end": 294
}
],
[
{
"Rfc": "content_type"
},
{
"start": 307,
"end": 376
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3,
4
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 7718
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "7bit"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 477,
"end": 508
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 534,
"end": 541
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race."
},
"offset_header": 464,
"offset_body": 543,
"offset_end": 1312
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "x-uuencode"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -244,7 +372,48 @@ end
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "redball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1365,
"end": 1399
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1425,
"end": 1438
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1458,
"end": 1493
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
98,
101,
103,
@@ -2311,22 +2480,20 @@ end
110,
100,
13,
10,
13
10
]
}
},
"offset_header": 1352,
"offset_body": 1495,
"offset_end": 3564
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "x-uuencode",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "x-uuencode"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -2334,7 +2501,48 @@ end
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3617,
"end": 3653
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3679,
"end": 3692
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3712,
"end": 3749
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
98,
101,
103,
@@ -4183,22 +4391,20 @@ end
110,
100,
13,
10,
13
10
]
}
},
"offset_header": 3604,
"offset_body": 3751,
"offset_end": 5602
},
{
"InlineBinary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "blueball.png"
}
},
"content_transfer_encoding": "x-uuencode",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "x-uuencode"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -4206,7 +4412,48 @@ end
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5655,
"end": 5690
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 5716,
"end": 5729
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 5749,
"end": 5785
}
]
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
98,
101,
103,
@@ -6093,10 +6340,12 @@ end
110,
100,
13,
10,
13
10
]
}
},
"offset_header": 5642,
"offset_body": 5787,
"offset_end": 7676
}
]
}
+139 -51
View File
File diff suppressed because one or more lines are too long
+328 -90
View File
@@ -108,88 +108,222 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
--=====================_715546120==_.REL--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 39,
"second": 36,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519003934.00a866f0@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"type": "text/html",
"boundary": "=====================_715546120==_.REL"
}
},
"others": {
"X-Priority": [
"2 (High)"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
],
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2,
3
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 39,
"second": 36,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519003934.00a866f0@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"type": "text/html",
"boundary": "=====================_715546120==_.REL"
}
}
}
},
"contents": "<html>\n<img src=\"cid:4.2.0.58.20000519003934.00a866f0@pop.example.com.2\" width=27 height=27 alt=\"2aa658b6.png\"><br>\n<br>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n<img src=\"cid:4.2.0.58.20000519003934.00a866f0@pop.example.com.3\" width=27 height=27 alt=\"2aa658c0.png\"></font></html>\n"
}
],
"text_body": [
{
"contents": "\n\nDie Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"\n\n"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa658b6.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_id": "4.2.0.58.20000519003934.00a866f0@pop.example.com.2",
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 192
}
],
[
{
"Rfc": "date"
},
{
"start": 197,
"end": 231
}
],
[
{
"Rfc": "to"
},
{
"start": 234,
"end": 288
}
],
[
{
"Rfc": "from"
},
{
"start": 293,
"end": 330
}
],
[
{
"Rfc": "subject"
},
{
"start": 338,
"end": 383
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 396,
"end": 402
}
],
[
{
"Rfc": "content_type"
},
{
"start": 415,
"end": 508
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 510,
"offset_end": 6229
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 565,
"end": 599
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 625,
"end": 644
}
]
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<img src=\"cid:4.2.0.58.20000519003934.00a866f0@pop.example.com.2\" width=27 height=27 alt=\"2aa658b6.png\"><br>\n<br>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n<img src=\"cid:4.2.0.58.20000519003934.00a866f0@pop.example.com.3\" width=27 height=27 alt=\"2aa658c0.png\"></font></html>\n"
},
"offset_header": 552,
"offset_body": 646,
"offset_end": 1887
},
{
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003934.00a866f0@pop.example.com.2"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -197,7 +331,57 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa658b6.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1942,
"end": 1975
}
],
[
{
"Rfc": "content_id"
},
{
"start": 1986,
"end": 2041
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 2067,
"end": 2076
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 2096,
"end": 2130
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1524,20 +1708,21 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 1929,
"offset_body": 2132,
"offset_end": 3948
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa658c0.png"
}
},
"content_id": "4.2.0.58.20000519003934.00a866f0@pop.example.com.3",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003934.00a866f0@pop.example.com.3"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1545,7 +1730,57 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa658c0.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 4003,
"end": 4036
}
],
[
{
"Rfc": "content_id"
},
{
"start": 4047,
"end": 4102
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 4128,
"end": 4137
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 4157,
"end": 4191
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3000,7 +3235,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 3990,
"offset_body": 4193,
"offset_end": 6185
}
]
}
+467 -111
View File
@@ -160,87 +160,259 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
--=====================_715515186==_--
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 39,
"second": 5,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"message_id": "4.2.0.58.20000519003903.00a859b0@pop.example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_715515186==_"
}
},
"others": {
"X-Mailer": [
"QUALCOMM Windows Eudora Pro Version 4.2.0.58"
],
"X-Priority": [
"2 (High)"
],
"X-Sender": [
"dwsauder@pop.example.com (Unverified)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/><br/>2aa5e03a.png2aa5e044.png</body></html>"
}
2
],
"text_body": [
2
],
"attachments": [
3,
4,
5,
6
],
"parts": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 39,
"second": 5,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "4.2.0.58.20000519003903.00a859b0@pop.example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "=====================_715515186==_"
}
}
}
},
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n2aa5e03a.png2aa5e044.png"
}
],
"attachments": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa5e03a.png"
}
"headers_raw": [
[
{
"Rfc": "message_id"
},
"content_id": "4.2.0.58.20000519003903.00a859b0@pop.example.com.2",
"content_transfer_encoding": "base64",
"content_type": {
{
"start": 11,
"end": 64
}
],
[
{
"Other": "X-Sender"
},
{
"start": 73,
"end": 113
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 122,
"end": 170
}
],
[
{
"Other": "X-Priority"
},
{
"start": 181,
"end": 192
}
],
[
{
"Rfc": "date"
},
{
"start": 197,
"end": 231
}
],
[
{
"Rfc": "to"
},
{
"start": 234,
"end": 288
}
],
[
{
"Rfc": "from"
},
{
"start": 293,
"end": 330
}
],
[
{
"Rfc": "subject"
},
{
"start": 338,
"end": 383
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 396,
"end": 402
}
],
[
{
"Rfc": "content_type"
},
{
"start": 415,
"end": 482
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
5,
6
]
},
"offset_header": 0,
"offset_body": 484,
"offset_end": 9941
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": {
"type": "text/plain",
"boundary": "=====================_715515186==_.REL"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 535,
"end": 629
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3,
4
]
},
"offset_header": 522,
"offset_body": 631,
"offset_end": 5945
},
{
"headers_rfc": {
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 686,
"end": 721
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 747,
"end": 766
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n2aa5e03a.png2aa5e044.png"
},
"offset_header": 673,
"offset_body": 768,
"offset_end": 1603
},
{
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003903.00a859b0@pop.example.com.2"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -248,7 +420,57 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa5e03a.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 1658,
"end": 1691
}
],
[
{
"Rfc": "content_id"
},
{
"start": 1702,
"end": 1757
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 1783,
"end": 1792
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 1812,
"end": 1846
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1575,20 +1797,21 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 1645,
"offset_body": 1848,
"offset_end": 3664
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa5e044.png"
}
},
"content_id": "4.2.0.58.20000519003903.00a859b0@pop.example.com.3",
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_id": {
"Text": "4.2.0.58.20000519003903.00a859b0@pop.example.com.3"
},
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -1596,7 +1819,57 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": {
"filename": "2aa5e044.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 3719,
"end": 3752
}
],
[
{
"Rfc": "content_id"
},
{
"start": 3763,
"end": 3818
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 3844,
"end": 3853
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 3873,
"end": 3907
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3051,19 +3324,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 3706,
"offset_body": 3909,
"offset_end": 5901
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -3071,7 +3343,48 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "blueball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 5998,
"end": 6031
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 6057,
"end": 6066
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 6086,
"end": 6124
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -4398,19 +4711,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 5985,
"offset_body": 6126,
"offset_end": 7942
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"headers_rfc": {
"content_transfer_encoding": {
"Text": "base64"
},
"content_type": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
@@ -4418,7 +4730,48 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
}
}
},
"contents": [
"content_disposition": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": {
"filename": "greenball.png"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 7993,
"end": 8027
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 8053,
"end": 8062
}
],
[
{
"Rfc": "content_disposition"
},
{
"start": 8082,
"end": 8121
}
]
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -5718,7 +6071,10 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 7980,
"offset_body": 8123,
"offset_end": 9901
}
]
}
+138 -50
View File
@@ -26,60 +26,148 @@ wenig aufschieben, denn auch uns f
welche also wohl noch unglücklicher sein müssen als wir."
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 28,
"second": 40,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGOEKDCHAA.doug@example.com",
"subject": "Die Hasen und die Fr�sche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "Heinz M�ller",
"address": "mueller@example.com"
}
},
"others": {
"X-MSMail-Priority": [
"Normal"
],
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"Importance": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Fr�sche<br/><br/>Die Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein<br/>Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der<br/>Adler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der Tod<br/>selbst. Auf, la�t uns ein f�r allemal sterben.\"<br/><br/>In einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;<br/>allein das au�erordentliche Get�se und ihre wunderbare Gestalt erschreckte<br/>eine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs schnellste<br/>untertauchten.<br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein<br/>wenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,<br/>welche also wohl noch ungl�cklicher sein m�ssen als wir.\"<br/><br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Fr�sche\r\n\r\nDie Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der Tod\r\nselbst. Auf, la�t uns ein f�r allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;\r\nallein das au�erordentliche Get�se und ihre wunderbare Gestalt erschreckte\r\neine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein\r\nwenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch ungl�cklicher sein m�ssen als wir.\"\r\n\r\n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Heinz M�ller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 28,
"second": 40,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGOEKDCHAA.doug@example.com"
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 82
}
],
[
{
"Rfc": "subject"
},
{
"start": 90,
"end": 141
}
],
[
{
"Rfc": "date"
},
{
"start": 146,
"end": 180
}
],
[
{
"Rfc": "message_id"
},
{
"start": 191,
"end": 241
}
],
[
{
"Other": "X-Priority"
},
{
"start": 252,
"end": 265
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 283,
"end": 292
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 301,
"end": 354
}
],
[
{
"Other": "Importance"
},
{
"start": 365,
"end": 374
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 384,
"end": 432
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Fr�sche\r\n\r\nDie Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der Tod\r\nselbst. Auf, la�t uns ein f�r allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;\r\nallein das au�erordentliche Get�se und ihre wunderbare Gestalt erschreckte\r\neine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein\r\nwenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch ungl�cklicher sein m�ssen als wir.\"\r\n\r\n"
},
"offset_header": 0,
"offset_body": 434,
"offset_end": 1186
}
]
}
+180 -59
View File
@@ -31,69 +31,190 @@ noch ein wenig aufschieben, denn auch uns f=C3=BCrchten, wie ihr seht, =
einige Tiere, welche also wohl noch ungl=C3=BCcklicher sein m=C3=BCssen =
als wir."=20
---- EXPECTED STRUCTURE ----
{
"header": {
"date": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 27,
"second": 4,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"message_id": "NDBBIAKOPKHFGPLCODIGKEKDCHAA.doug@example.com",
"mime_version": "1.0",
"subject": "Die Hasen und die Frösche (Microsoft Outlook 00)",
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "utf-8"
}
},
"others": {
"X-MimeOLE": [
"Produced By Microsoft MimeOLE V5.00.2314.1300"
],
"X-MSMail-Priority": [
"Normal"
],
"X-Mailer": [
"Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)"
],
"Importance": [
"Normal"
],
"X-Priority": [
"3 (Normal)"
]
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Die Hasen und die Frösche<br/><br/>Die Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" <br/><br/>In einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. <br/><br/>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" <br/></body></html>"
}
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"contents": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
"headers_rfc": {
"subject": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"from": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"to": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"date": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 27,
"second": 4,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"message_id": {
"Text": "NDBBIAKOPKHFGPLCODIGKEKDCHAA.doug@example.com"
},
"mime_version": {
"Text": "1.0"
},
"content_transfer_encoding": {
"Text": "quoted-printable"
},
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "utf-8"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "from"
},
{
"start": 5,
"end": 40
}
],
[
{
"Rfc": "to"
},
{
"start": 43,
"end": 97
}
],
[
{
"Rfc": "subject"
},
{
"start": 105,
"end": 177
}
],
[
{
"Rfc": "date"
},
{
"start": 182,
"end": 216
}
],
[
{
"Rfc": "message_id"
},
{
"start": 227,
"end": 277
}
],
[
{
"Rfc": "mime_version"
},
{
"start": 290,
"end": 296
}
],
[
{
"Rfc": "content_type"
},
{
"start": 309,
"end": 341
}
],
[
{
"Rfc": "content_transfer_encoding"
},
{
"start": 367,
"end": 386
}
],
[
{
"Other": "X-Priority"
},
{
"start": 397,
"end": 410
}
],
[
{
"Other": "X-MSMail-Priority"
},
{
"start": 428,
"end": 437
}
],
[
{
"Other": "X-Mailer"
},
{
"start": 446,
"end": 499
}
],
[
{
"Other": "Importance"
},
{
"start": 510,
"end": 519
}
],
[
{
"Other": "X-MimeOLE"
},
{
"start": 529,
"end": 577
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
},
"offset_header": 0,
"offset_body": 579,
"offset_end": 1440
}
]
}
+36 -10
View File
@@ -9,15 +9,41 @@ Content-Type: text/plain
Content-Type: text/html
--:foo--
---- EXPECTED STRUCTURE ----
{
"header": {
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": ":foo"
}
---- EXPECTED STRUCTURE ----{
"html_body": [],
"text_body": [],
"attachments": [],
"parts": [
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": ":foo"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 13,
"end": 47
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": []
},
"offset_header": 0,
"offset_body": 48,
"offset_end": 160
}
}
]
}
+101 -15
View File
@@ -9,25 +9,111 @@ Content-Type: text/plain
--a
---- EXPECTED STRUCTURE ----
{
"header": {
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "ab"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>Content-Type: text/plain<br/></body></html>"
}
2
],
"text_body": [
2
],
"attachments": [],
"parts": [
{
"contents": "Content-Type: text/plain\n"
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "ab"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 13,
"end": 45
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 46,
"offset_end": 132
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 64,
"end": 95
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 51,
"offset_body": 96,
"offset_end": 132
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
}
},
"headers_raw": [],
"is_encoding_problem": false,
"body": {
"Text": "Content-Type: text/plain\n"
},
"offset_header": 99,
"offset_body": 101,
"offset_end": 127
},
{
"headers_rfc": {},
"headers_raw": [],
"is_encoding_problem": true,
"body": {
"Binary": []
},
"offset_header": 131,
"offset_body": 132,
"offset_end": 132
}
]
}
+35 -14
View File
@@ -2,22 +2,43 @@ Content-Type: multipart/mixed; boundary="ab"
body
---- EXPECTED STRUCTURE ----
{
"header": {
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "ab"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [],
"text_body": [],
"attachments": [
0
],
"parts": [
{
"Text": {
"contents": "body\n"
}
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "ab"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 13,
"end": 45
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "body\n"
},
"offset_header": 0,
"offset_body": 46,
"offset_end": 51
}
]
}
+98 -19
View File
@@ -8,28 +8,107 @@ Content-Type: text/plain
body
---- EXPECTED STRUCTURE ----
{
"header": {
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [],
"text_body": [],
"attachments": [
2
],
"parts": [
{
"Text": {
"header": {
"content_type": {
"c_type": "text",
"c_subtype": "plain"
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a"
}
}
},
"contents": "body\n"
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 13,
"end": 44
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 45,
"offset_end": 129
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 62,
"end": 93
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2
]
},
"offset_header": 49,
"offset_body": 94,
"offset_end": 129
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 111,
"end": 123
}
]
],
"is_encoding_problem": true,
"body": {
"Text": "body\n"
},
"offset_header": 98,
"offset_body": 124,
"offset_end": 126
}
]
}
+56 -14
View File
@@ -8,22 +8,64 @@ Content-Type: text/plain
body
---- EXPECTED STRUCTURE ----
{
"header": {
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [],
"text_body": [],
"attachments": [
1
],
"parts": [
{
"Text": {
"contents": "Content-Type: multipart/mixed; boundary=\"a\"\n\n--ac\nContent-Type: text/plain\n\nbody\n"
}
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 13,
"end": 44
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 45,
"offset_end": 131
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
}
},
"headers_raw": [],
"is_encoding_problem": true,
"body": {
"Text": "Content-Type: multipart/mixed; boundary=\"a\"\n\n--ac\nContent-Type: text/plain\n\nbody\n"
},
"offset_header": 48,
"offset_body": 50,
"offset_end": 128
}
]
}
+96 -18
View File
@@ -12,31 +12,109 @@ Content-Type: text/html
body2
--a----
---- EXPECTED STRUCTURE ----
{
"header": {
"content_type": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a--"
}
}
},
---- EXPECTED STRUCTURE ----{
"html_body": [
{
"contents": "<html><body>body</body></html>"
}
2
],
"text_body": [
2
],
"attachments": [],
"parts": [
{
"header": {
"headers_rfc": {
"content_type": {
"c_type": "text",
"c_subtype": "plain"
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a--"
}
}
}
},
"contents": "body"
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 13,
"end": 46
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 189
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": {
"boundary": "a----"
}
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 66,
"end": 101
}
]
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2
]
},
"offset_header": 53,
"offset_body": 102,
"offset_end": 151
},
{
"headers_rfc": {
"content_type": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
}
},
"headers_raw": [
[
{
"Rfc": "content_type"
},
{
"start": 123,
"end": 135
}
]
],
"is_encoding_problem": false,
"body": {
"Text": "body"
},
"offset_header": 110,
"offset_body": 136,
"offset_end": 141
}
]
}

Some files were not shown because too many files have changed in this diff Show More