Compare commits

...
102 Commits
Author SHA1 Message Date
Mauro D f16aca7ee0 Renamed maildir files to make cargo publish happy. 2022-08-21 10:28:04 +00:00
Mauro D d4f45b7e34 Changed dev dependencies. 2022-08-21 10:25:22 +00:00
Mauro D ae62000a98 Raw message offsets fixes. 2022-08-21 10:21:17 +00:00
Mauro D f080b911df Maildir/mbox improvements. 2022-08-12 15:17:15 +00:00
Mauro D 1e868fd683 Support for metadata parsing within mbox mailboxes. 2022-08-11 13:03:28 +00:00
Mauro D 09960ef610 Renamed MBoxIterator to MessageIterator. 2022-08-10 16:30:58 +00:00
Mauro D a9694def15 Fixed CI tests. 2022-08-10 13:54:23 +00:00
Mauro D 20ecc490f2 v0.6.0 2022-08-10 13:38:42 +00:00
Mauro D 402ee4c4db v0.6.0 2022-08-10 12:51:30 +00:00
Mauro D e922562b1c Fixed raw offset range in body parts. 2022-08-02 16:24:47 +00:00
Mauro D 215d5aa9ac Renamed header offset fields. 2022-07-30 13:19:24 +00:00
Mauro D d230fce62f Headers and attributes are now stored in a Vec instead of a HashMap. 2022-07-30 13:16:20 +00:00
Mauro D 3a7126f64e Support for Content-Type attributes spanning multiple lines. 2022-07-28 12:15:03 +00:00
Mauro D bb0e3366da Support for malformed Thunderbird messages (#27). 2022-07-19 07:26:15 +00:00
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
Mauro D 6b0f8052ee Improved decoder results. 2021-11-03 16:19:08 +00:00
Mauro D bfaeeeb886 Improved decoder results. 2021-11-03 16:15:10 +00:00
Mauro D 514f989e7e v0.2.1 2021-11-03 15:07:02 +00:00
Mauro D bcf182bbc1 v0.2.1 2021-11-03 15:03:23 +00:00
Mauro D 78c4cd424f Improved MessageStream usage. 2021-11-03 14:52:12 +00:00
Mauro D 4835ccfb9e Simplified MessageStream -- Cell no longer required. 2021-11-03 14:28:59 +00:00
Mauro D c52670cf1f Replaced MessageStream::next with slice iterators. 2021-11-03 13:27:59 +00:00
Mauro D 96d8123b74 Replaced MessageStream::next with slice iterators. 2021-11-03 13:17:53 +00:00
Mauro D 6f98f52d77 100% safe Rust 2021-11-03 09:08:07 +00:00
Mauro D ee2d08be07 v0.1.1 2021-11-02 11:40:06 +00:00
Mauro D 1717f803db Added comments explaining the use of . 2021-11-02 11:21:42 +00:00
Mauro D 549e8d2428 Formatting. 2021-11-02 10:35:54 +00:00
Mauro D 972b4d6dfc Merge pull request #1 from barafael/main
Add example from readme as cargo example binary
2021-11-02 11:32:27 +01:00
Mauro D 5d4c4a06c7 Added Fuzz testing. 2021-11-02 08:58:54 +00:00
Mauro D 17833a57b4 Added Fuzz testing. 2021-11-02 08:57:01 +00:00
Rafael Bachmann 52a90c3eff Add example from readme as cargo example binary 2021-11-01 19:56:17 +01:00
Mauro D 31bb44cc29 Update rust.yml 2021-11-01 16:28:27 +01:00
Mauro D 24e17cf675 Merge branch 'main' of github.com:stalwartlabs/mail-parser into main 2021-11-01 15:20:07 +00:00
Mauro D 73af8a971e Added Github CI badge 2021-11-01 15:19:54 +00:00
Mauro D 847359ae39 Update rust.yml 2021-11-01 16:10:24 +01:00
Mauro D 419a9a9fad Gitlab CI 2021-11-01 16:05:36 +01:00
Mauro D 80c7b78646 Gitlab CI 2021-11-01 15:03:08 +00:00
Mauro D 4eebde1020 Travis CI 2021-11-01 14:55:24 +00:00
Mauro D 260fd98d7d Added shields to README. 2021-11-01 11:35:29 +00:00
309 changed files with 51306 additions and 29867 deletions
+22
View File
@@ -0,0 +1,22 @@
name: "CI"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
+18
View File
@@ -0,0 +1,18 @@
stages:
- build
rust-latest:
stage: build
image: rust:latest
script:
- cargo build --verbose
- cargo test --verbose
rust-nightly:
stage: build
image: rustlang/rust:nightly
script:
- cargo build --verbose
- cargo test --verbose
allow_failure: true
+8
View File
@@ -0,0 +1,8 @@
language: rust
rust:
- stable
- beta
- nightly
matrix:
allow_failures:
- rust: nightly
+103
View File
@@ -0,0 +1,103 @@
mail-parser 0.6.0
================================
- Maildir parsing support.
- Headers and attributes are now stored in a `Vec` instead of a `HashMap` for tiny performance enhancement.
- Support for Content-Type attributes spanning multiple lines.
- Support for malformed Thunderbird messages (#27).
- Fixed raw offset range for body parts.
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
+236 -50
View File
@@ -3,10 +3,34 @@
version = 3
[[package]]
name = "autocfg"
version = "1.0.1"
name = "android_system_properties"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e"
dependencies = [
"libc",
]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
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 = "bumpalo"
version = "3.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d"
[[package]]
name = "cfg-if"
@@ -15,31 +39,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "dtoa"
version = "0.4.8"
name = "chrono"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0"
checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1"
dependencies = [
"iana-time-zone",
"js-sys",
"num-integer",
"num-traits",
"time",
"wasm-bindgen",
"winapi",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
[[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",
]
[[package]]
name = "hashbrown"
version = "0.11.2"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "iana-time-zone"
version = "0.1.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad2bfd338099682614d3ee3fe0cd72e0b6a41ca6a87f6a74a3bd593c91650501"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"js-sys",
"wasm-bindgen",
"winapi",
]
[[package]]
name = "indexmap"
version = "1.7.0"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
dependencies = [
"autocfg",
"hashbrown",
@@ -47,74 +99,115 @@ dependencies = [
[[package]]
name = "itoa"
version = "0.4.8"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
[[package]]
name = "js-sys"
version = "0.3.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2"
dependencies = [
"wasm-bindgen",
]
[[package]]
name = "libc"
version = "0.2.132"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5"
[[package]]
name = "linked-hash-map"
version = "0.5.4"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "log"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if",
]
[[package]]
name = "mail-parser"
version = "0.1.0"
version = "0.6.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 = "once_cell"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e"
[[package]]
name = "proc-macro2"
version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.10"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
dependencies = [
"proc-macro2",
]
[[package]]
name = "ryu"
version = "1.0.5"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
[[package]]
name = "serde"
version = "1.0.130"
version = "1.0.144"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860"
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.144"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00"
dependencies = [
"proc-macro2",
"quote",
@@ -123,9 +216,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.68"
version = "1.0.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8"
checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7"
dependencies = [
"itoa",
"ryu",
@@ -134,32 +227,125 @@ dependencies = [
[[package]]
name = "serde_yaml"
version = "0.8.21"
version = "0.8.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8c608a35705a5d3cdc9fbe403147647ff34b921f8e833e49306df898f9b20af"
checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b"
dependencies = [
"dtoa",
"indexmap",
"ryu",
"serde",
"yaml-rust",
]
[[package]]
name = "syn"
version = "1.0.80"
version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194"
checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
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.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf"
[[package]]
name = "wasi"
version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]]
name = "wasm-bindgen"
version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
[[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.1.0"
version = "0.6.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" # Version 0.9 fails to parse certain inputs
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
+101 -101
View File
@@ -1,20 +1,20 @@
# mail-parser
![crates.io](https://img.shields.io/crates/v/mail-parser)
![docs.rs](https://img.shields.io/docsrs/mail-parser)
![crates.io](https://img.shields.io/crates/l/mail-parser)
![Twitter Follow](https://img.shields.io/twitter/follow/stalwartlabs?style=social)
[![crates.io](https://img.shields.io/crates/v/mail-parser)](https://crates.io/crates/mail-parser)
[![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)
_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
and Japanse languages such as BIG5 or ISO-2022-JP is provided by the optional dependency [encoding_rs](https://crates.io/crates/encoding_rs).
and Japanese languages such as BIG5 or ISO-2022-JP is provided by the optional dependency [encoding_rs](https://crates.io/crates/encoding_rs).
In general, this library abides by the Postel's law or [Robustness Principle](https://en.wikipedia.org/wiki/Robustness_principle) which
states that an implementation must be conservative in its sending behavior and liberal in its receiving behavior. This means that
_mail-parser_ will make a best effort to parse non-conformat e-mail messages as long as these do not deviate too much from the standard.
_mail-parser_ will make a best effort to parse non-conformant e-mail messages as long as these do not deviate too much from the standard.
Unlike other e-mail parsing libraries that return nested representations of the different MIME parts in a message, this library
conforms to [RFC 8621, Section 4.1.4](https://datatracker.ietf.org/doc/html/rfc8621#section-4.1.4) and provides a more human-friendly
@@ -23,93 +23,88 @@ HTML and plain text inline body parts is done automatically when the _alternativ
Performance and memory safety were two important factors while designing _mail-parser_:
- **Zero-copy parsing** is done in most cases (unless when decoding non-UTF8 text or when RFC2047/RFC2231 encoded parts are present).
Practically all strings and u8 slices returned by this library are `Cow<str>` or `Cow<[u8]>` references to the input raw message.
- Memory allocations are always avoided unless they are really necessary. In fact, all Base64 and Quoted-Printable parts are decoded in
place re-using the input buffer.
- [Perfect hashing](https://en.wikipedia.org/wiki/Perfect_hash_function) is used for fast look-up of message header fields, character
set names and aliases, HTML entities as well as month names while parsing _Date_ fields.
- Fully battle-tested with millions of real-world e-mail messages dating from 1995 until today.
- **Zero-copy**: Practically all strings returned by this library are `Cow<str>` references to the input raw message.
- **High performance Base64 decoding** based on Chromium's decoder ([the fastest non-SIMD decoder](https://github.com/lemire/fastbase64)).
- **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
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 mut 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()
.to_vec();
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(&mut 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"),
]
}
)
])
);
assert_eq!(
message.get_date().unwrap().to_iso8601(),
message.get_date().unwrap().to_rfc3339(),
"2021-11-20T14:22:01-08:00"
);
@@ -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,7 +170,9 @@ Performance and memory safety were two important factors while designing _mail-p
println!("{}", serde_yaml::to_string(&message).unwrap());
```
## Testing & Benchmarking
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:
@@ -191,13 +180,19 @@ To run the testsuite:
$ cargo test --all-features
```
or, to run the testsuite using MIRI:
or, to run the testsuite with MIRI:
```bash
$ cargo +nightly miri test --all-features
```
and to run the benchmarks:
To fuzz the library with `cargo-fuzz`:
```bash
$ cargo +nightly fuzz run mail_parser
```
and, to run the benchmarks:
```bash
$ cargo +nightly bench --all-features
@@ -213,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
@@ -278,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.
+18 -21
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
@@ -17,7 +17,7 @@ use std::{fs, path::PathBuf};
use test::Bencher;
fn bench_all_samples(b: &mut Bencher, name: &str, fnc: fn(&mut [u8], &str)) {
fn bench_all_samples(b: &mut Bencher, name: &str, fnc: fn(&[u8], &str)) {
const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----\n".as_bytes();
println!("Benchmarking {}...\n", name);
@@ -63,13 +63,9 @@ fn bench_all_samples(b: &mut Bencher, name: &str, fnc: fn(&mut [u8], &str)) {
b.iter(|| {
for test_msg in &test_data {
let input_str = String::from_utf8_lossy(&test_msg);
let mut input_bytes = test_msg.clone();
fnc(&mut input_bytes[..], &input_str);
fnc(test_msg, String::from_utf8_lossy(&test_msg).as_ref());
}
});
}
#[bench]
@@ -79,23 +75,19 @@ fn bench_stalwart(b: &mut Bencher) {
});
}
/*
// These libraries do not support all RFCs and might be faster
// on the benchmarks as they skip certain encoded parts or fail
// while trying to parse the messages.
// Also no body conversion between HTML/text is done by these.
// on the benchmarks as they do not parse all header fields,
// do not decode encoded parts or fail while trying to parse the messages.
// Also no text body conversion between HTML/plain-text is done by these.
//
// To benchmark against these libraries, add to Cargo.toml dev-dependencies:
//
// email = "0.0.21"
// email-format = "0.8"
// email-parser = "0.5.0"
// email-parser = { version = "0.5.0", features=["headers", "mime"] }
// mailparse = "0.13"
#[bench]
fn bench_mailparse(b: &mut Bencher) {
bench_all_samples(b, "mailparse", |bytes, _str| {
mailparse::parse_mail(bytes).unwrap();
});
}
/*
#[bench]
fn bench_email_parser(b: &mut Bencher) {
@@ -104,6 +96,13 @@ fn bench_email_parser(b: &mut Bencher) {
});
}
#[bench]
fn bench_mailparse(b: &mut Bencher) {
bench_all_samples(b, "mailparse", |bytes, _str| {
mailparse::parse_mail(bytes).unwrap();
});
}
#[bench]
fn benchmark_email(b: &mut Bencher) {
bench_all_samples(b, "email", |_bytes, str| {
@@ -119,6 +118,4 @@ fn bench_email_format(b: &mut Bencher) {
});
}
*/
+36
View File
@@ -0,0 +1,36 @@
/*
* 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::path::PathBuf;
use mail_parser::mailbox::maildir::FolderIterator;
fn main() {
// Iterates a Maildir++ structure printing the results to stdout.
let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
test_dir.push("tests");
test_dir.push("maildir");
for folder in FolderIterator::new(test_dir, ".".into()).unwrap() {
let folder = folder.unwrap();
println!("------\nMailbox: {:?}", folder.name().unwrap_or("INBOX"));
for message in folder {
let message = message.unwrap();
println!(
"Message with internal date {}, flags {:?} and content {:?}.",
message.internal_date(),
message.flags(),
String::from_utf8_lossy(message.contents())
);
}
}
}
+22
View File
@@ -0,0 +1,22 @@
/*
* 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::{mailbox::mbox::MessageIterator, Message};
fn main() {
// Reads an MBox mailbox from stdin and prints each message as YAML.
for raw_message in MessageIterator::new(std::io::stdin()) {
let raw_message = raw_message.unwrap();
let message = Message::parse(raw_message.contents()).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_rfc3339(),
"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());
}
+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());
}
}
}
+3
View File
@@ -0,0 +1,3 @@
target
corpus
artifacts
+118
View File
@@ -0,0 +1,118 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "arbitrary"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "577b08a4acd7b99869f863c50011b01eb73424ccc798ecd996f2e24817adfca7"
[[package]]
name = "cc"
version = "1.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd"
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "encoding_rs"
version = "0.8.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746"
dependencies = [
"cfg-if",
]
[[package]]
name = "libfuzzer-sys"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36a9a84a6e8b55dfefb04235e55edb2b9a2a18488fcae777a6bdaa6f06f1deb3"
dependencies = [
"arbitrary",
"cc",
"once_cell",
]
[[package]]
name = "mail-parser"
version = "0.5.0"
dependencies = [
"encoding_rs",
"serde",
]
[[package]]
name = "mail-parser-fuzz"
version = "0.0.0"
dependencies = [
"libfuzzer-sys",
"mail-parser",
]
[[package]]
name = "once_cell"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
[[package]]
name = "proc-macro2"
version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"
dependencies = [
"unicode-xid",
]
[[package]]
name = "quote"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
dependencies = [
"proc-macro2",
]
[[package]]
name = "serde"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "syn"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
]
[[package]]
name = "unicode-xid"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
+25
View File
@@ -0,0 +1,25 @@
[package]
name = "mail-parser-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
[package.metadata]
cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4"
[dependencies.mail-parser]
path = ".."
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[[bin]]
name = "mail_parser"
path = "fuzz_targets/mail_parser.rs"
test = false
doc = false
+143
View File
@@ -0,0 +1,143 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use mail_parser::{
decoders::{
base64::decode_base64,
charsets::{
map::get_charset_decoder,
single_byte::decoder_iso_8859_1,
utf::{decoder_utf16, decoder_utf16_be, decoder_utf16_le, decoder_utf7},
},
encoded_word::decode_rfc2047,
hex::decode_hex,
html::{add_html_token, html_to_text, text_to_html},
quoted_printable::decode_quoted_printable,
},
parsers::{
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},
thread::{thread_name, trim_trailing_fwd},
unstructured::parse_unstructured,
},
header::parse_header_name,
message::MessageStream,
mime::*,
},
Message,
};
fuzz_target!(|data: &[u8]| {
// Fuzz every parsing function
for n_fuzz in 1..=24 {
let mut stream = MessageStream::new(&data);
match n_fuzz {
1 => {
parse_date(&mut stream);
}
2 => {
parse_address(&mut stream);
}
3 => {
parse_id(&mut stream);
}
4 => {
parse_comma_separared(&mut stream);
}
5 => {
parse_and_ignore(&mut stream);
}
6 => {
parse_raw(&mut stream);
}
7 => {
parse_unstructured(&mut stream);
}
8 => {
parse_content_type(&mut stream);
}
9 => {
parse_header_name(&data);
}
10 => {
decode_rfc2047(&mut stream, 0);
}
11 => {
seek_next_part(&mut stream, b"\n");
}
12 => {
get_bytes_to_boundary(&mut stream, 0, b"\n", false);
}
13 => {
get_bytes_to_boundary(&mut stream, 0, &[], false);
}
14 => {
skip_crlf(&mut stream);
}
15 => {
is_boundary_end(&mut stream, 0);
}
16 => {
skip_multipart_end(&mut stream);
}
17 => {
decode_base64(&mut stream, 0, b"\n", true);
}
18 => {
decode_base64(&mut stream, 0, b"\n", false);
}
19 => {
decode_base64(&mut stream, 0, &[], true);
}
20 => {
decode_base64(&mut stream, 0, &[], false);
}
21 => {
decode_quoted_printable(&mut stream, 0, b"\n\n", true); // QP Boundaries have to be at least 2 bytes long
}
22 => {
decode_quoted_printable(&mut stream, 0, b"\n\n", false); // QP Boundaries have to be at least 2 bytes long
}
23 => {
decode_quoted_printable(&mut stream, 0, &[], true);
}
24 => {
decode_quoted_printable(&mut stream, 0, &[], false);
}
0 | 25..=u32::MAX => unreachable!(),
}
}
// 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);
for decoder in &[
decoder_utf7,
decoder_utf16_le,
decoder_utf16_be,
decoder_utf16,
decoder_iso_8859_1,
] as &[for<'x> fn(&'x [u8]) -> String]
{
decoder(data);
}
// Fuzz the entire library
Message::parse(&data[..]);
});
+91 -139
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,165 +9,108 @@
* except according to those terms.
*/
use crate::parsers::message_stream::MessageStream;
use crate::parsers::message::MessageStream;
#[repr(C)]
pub union Base64Chunk {
pub val: u32,
pub bytes: [u8; std::mem::size_of::<u32>()],
}
use super::DecodeResult;
pub trait Base64Decoder<'x> {
fn decode_base64(&self, boundary: &[u8], is_word: bool) -> (bool, bool, Option<&'x [u8]>);
}
pub fn decode_base64<'x>(
stream: &MessageStream<'x>,
start_pos: usize,
boundary: &[u8],
is_word: bool,
) -> (usize, DecodeResult) {
let mut success = boundary.is_empty();
// Miri does not play well with UnsafeCells, see https://github.com/rust-lang/miri/issues/1665
//
// When testing under Miri,
// (*data)[i] = val;
// is used instead of
// *(*data).get_unchecked_mut(i) = val;
//
let mut chunk: u32 = 0;
let mut byte_count: u8 = 0;
let mut match_count: usize = 0;
impl<'x> Base64Decoder<'x> for MessageStream<'x> {
fn decode_base64(&self, boundary: &[u8], is_word: bool) -> (bool, bool, Option<&'x [u8]>) {
unsafe {
let mut success = boundary.is_empty();
let mut bytes_read = 0;
let mut chunk = Base64Chunk { val: 0 };
let mut byte_count: u8 = 0;
let mut match_count: usize = 0;
let mut buf = Vec::with_capacity(stream.data.len() - start_pos);
let data = &mut *self.data.get();
let data_len = (*data).len();
for ch in stream.data[start_pos..].iter() {
bytes_read += 1;
let stream_pos = &mut *self.pos.get();
let start_pos = *stream_pos;
let mut read_pos = *stream_pos;
let mut write_pos = *stream_pos;
while read_pos < data_len {
let ch = (*data).get_unchecked(read_pos);
read_pos += 1;
if !success {
if ch == boundary.get_unchecked(match_count) {
match_count += 1;
if match_count == boundary.len() {
success = true;
break;
} else {
continue;
}
} else if match_count > 0 {
if ch == boundary.get_unchecked(0) {
match_count = 1;
continue;
} else {
match_count = 0;
}
}
if !success {
if *ch == boundary[match_count] {
match_count += 1;
if match_count == boundary.len() {
success = true;
break;
} else {
continue;
}
} else if match_count > 0 {
if *ch == boundary[0] {
match_count = 1;
continue;
} else {
match_count = 0;
}
}
}
let val = BASE64_MAP
.get_unchecked(byte_count as usize)
.get_unchecked(*ch as usize);
let val = BASE64_MAP[byte_count as usize][*ch as usize];
if *val >= 0x01ffffff {
if *ch == b'=' {
match byte_count {
1 | 2 => {
#[cfg(miri)]
{
(*data)[write_pos] = *chunk.bytes.get_unchecked(0);
}
#[cfg(not(miri))]
{
*((*data).get_unchecked_mut(write_pos)) =
*chunk.bytes.get_unchecked(0);
}
if val >= 0x01ffffff {
if *ch == b'=' {
match byte_count {
1 | 2 => {
buf.push(chunk.to_le_bytes()[0]);
write_pos += 1;
byte_count = 0;
}
3 => {
#[cfg(miri)]
{
(*data)[write_pos] = *chunk.bytes.get_unchecked(0);
(*data)[write_pos + 1] = *chunk.bytes.get_unchecked(1);
}
#[cfg(not(miri))]
{
(*data)
.get_unchecked_mut(write_pos..write_pos + 2)
.copy_from_slice(chunk.bytes.get_unchecked(0..2));
}
write_pos += 2;
byte_count = 0;
}
0 => (),
_ => {
success = false;
break;
}
}
} else if !(*ch).is_ascii_whitespace() || is_word {
byte_count = 0;
}
3 => {
buf.extend_from_slice(&chunk.to_le_bytes()[0..2]);
byte_count = 0;
}
0 => (),
_ => {
success = false;
break;
}
continue;
}
byte_count = (byte_count + 1) & 3;
if byte_count == 1 {
chunk.val = *val;
} else {
chunk.val |= *val;
if byte_count == 0 {
#[cfg(miri)]
{
(*data)[write_pos] = *chunk.bytes.get_unchecked(0);
(*data)[write_pos + 1] = *chunk.bytes.get_unchecked(1);
(*data)[write_pos + 2] = *chunk.bytes.get_unchecked(2);
}
#[cfg(not(miri))]
{
(*data)
.get_unchecked_mut(write_pos..write_pos + 3)
.copy_from_slice(chunk.bytes.get_unchecked(0..3));
}
write_pos += 3;
}
}
} else if !ch.is_ascii_whitespace() || is_word {
success = false;
break;
}
continue;
}
*stream_pos = read_pos;
byte_count = (byte_count + 1) & 3;
(
success,
false,
if write_pos > start_pos {
Some((*data).get_unchecked(start_pos..write_pos))
} else {
None
},
)
if byte_count == 1 {
chunk = val;
} else {
chunk |= val;
if byte_count == 0 {
buf.extend_from_slice(&chunk.to_le_bytes()[0..3]);
}
}
}
(
if success { bytes_read } else { 0 },
if !buf.is_empty() {
buf.shrink_to_fit();
DecodeResult::Owned(buf)
} else {
DecodeResult::Empty
},
)
}
#[cfg(test)]
mod tests {
use crate::parsers::message_stream::MessageStream;
use super::Base64Decoder;
use crate::{
decoders::{base64::decode_base64, DecodeResult},
parsers::message::MessageStream,
};
#[test]
fn decode_base64() {
fn decode_base64_strings() {
let inputs = [
("VGVzdA==", "Test", "", true),
("WWU=", "Ye", "", true),
@@ -220,14 +163,23 @@ mod tests {
];
for input in inputs {
let mut str = input.0.to_string();
let stream = MessageStream::new(unsafe { str.as_bytes_mut() });
let str = input.0.to_string();
let stream = MessageStream::new(str.as_bytes());
let (success, _, result) = stream.decode_base64(input.2.as_bytes(), input.3);
assert_eq!(success, !input.1.is_empty(), "Failed for '{:?}'", input.0);
let (bytes_read, result) = decode_base64(&stream, 0, input.2.as_bytes(), input.3);
assert_eq!(
bytes_read > 0,
!input.1.is_empty(),
"Failed for '{:?}'",
input.0
);
if !input.1.is_empty() {
let result_str = std::str::from_utf8(result.unwrap()).unwrap();
let bytes = match result {
DecodeResult::Owned(v) => v,
_ => unreachable!(),
};
let result_str = std::str::from_utf8(&bytes).unwrap();
//println!("'{}' -> '{}'", input.0.escape_debug(), result_str.escape_debug());
assert_eq!(
result_str,
File diff suppressed because it is too large Load Diff
+2 -4
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,14 +9,12 @@
* except according to those terms.
*/
use std::borrow::Cow;
pub mod map;
pub mod multi_byte;
pub mod single_byte;
pub mod utf;
pub type DecoderFnc<'x> = fn(&'x [u8]) -> Cow<'x, str>;
pub type DecoderFnc = fn(&[u8]) -> String;
#[cfg(test)]
mod tests {
+21 -26
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,16 +9,11 @@
* except according to those terms.
*/
use std::borrow::Cow;
#[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]) -> Cow<str> {
fn multi_byte_decoder(mut decoder: Decoder, bytes: &[u8]) -> String {
let mut result = String::with_capacity(bytes.len() * 3);
if let (CoderResult::OutputFull, _, _) = decoder.decode_to_string(bytes, &mut result, true) {
@@ -26,10 +21,10 @@ fn multi_byte_decoder(mut decoder: Decoder, bytes: &[u8]) -> Cow<str> {
}
result.shrink_to_fit();
result.into()
result
}
pub fn decoder_shift_jis(bytes: &[u8]) -> Cow<str> {
pub fn decoder_shift_jis(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(SHIFT_JIS.new_decoder(), bytes)
@@ -37,11 +32,11 @@ pub fn decoder_shift_jis(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
pub fn decoder_big5(bytes: &[u8]) -> Cow<str> {
pub fn decoder_big5(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(BIG5.new_decoder(), bytes)
@@ -49,11 +44,11 @@ pub fn decoder_big5(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
pub fn decoder_euc_jp(bytes: &[u8]) -> Cow<str> {
pub fn decoder_euc_jp(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(EUC_JP.new_decoder(), bytes)
@@ -61,11 +56,11 @@ pub fn decoder_euc_jp(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
pub fn decoder_euc_kr(bytes: &[u8]) -> Cow<str> {
pub fn decoder_euc_kr(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(EUC_KR.new_decoder(), bytes)
@@ -73,11 +68,11 @@ pub fn decoder_euc_kr(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
pub fn decoder_gb18030(bytes: &[u8]) -> Cow<str> {
pub fn decoder_gb18030(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(GB18030.new_decoder(), bytes)
@@ -85,11 +80,11 @@ pub fn decoder_gb18030(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
pub fn decoder_gbk(bytes: &[u8]) -> Cow<str> {
pub fn decoder_gbk(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(GBK.new_decoder(), bytes)
@@ -97,11 +92,11 @@ pub fn decoder_gbk(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
pub fn decoder_iso2022_jp(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso2022_jp(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(ISO_2022_JP.new_decoder(), bytes)
@@ -109,11 +104,11 @@ pub fn decoder_iso2022_jp(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
pub fn decoder_windows874(bytes: &[u8]) -> Cow<str> {
pub fn decoder_windows874(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(WINDOWS_874.new_decoder(), bytes)
@@ -121,11 +116,11 @@ pub fn decoder_windows874(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
pub fn decoder_ibm866(bytes: &[u8]) -> Cow<str> {
pub fn decoder_ibm866(bytes: &[u8]) -> String {
#[cfg(feature = "full_encoding")]
{
multi_byte_decoder(IBM866.new_decoder(), bytes)
@@ -133,6 +128,6 @@ pub fn decoder_ibm866(bytes: &[u8]) -> Cow<str> {
#[cfg(not(feature = "full_encoding"))]
{
decoder_default(bytes)
String::from_utf8_lossy(bytes).into_owned()
}
}
+32 -34
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,128 +9,126 @@
* except according to those terms.
*/
use std::borrow::Cow;
fn single_byte_decoder<'x>(table: &[char], bytes: &'x [u8]) -> Cow<'x, str> {
fn single_byte_decoder(table: &[char], bytes: &[u8]) -> String {
let mut result = String::with_capacity(bytes.len() * 2);
for byte in bytes {
result.push(unsafe { *table.get_unchecked(*byte as usize) });
result.push(table[*byte as usize]);
}
result.shrink_to_fit();
result.into()
result
}
pub fn decoder_iso_8859_1(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_1(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_1, bytes)
}
pub fn decoder_iso_8859_2(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_2(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_2, bytes)
}
pub fn decoder_iso_8859_3(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_3(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_3, bytes)
}
pub fn decoder_iso_8859_4(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_4(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_4, bytes)
}
pub fn decoder_iso_8859_5(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_5(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_5, bytes)
}
pub fn decoder_iso_8859_6(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_6(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_6, bytes)
}
pub fn decoder_iso_8859_7(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_7(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_7, bytes)
}
pub fn decoder_iso_8859_8(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_8(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_8, bytes)
}
pub fn decoder_iso_8859_9(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_9(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_9, bytes)
}
pub fn decoder_iso_8859_10(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_10(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_10, bytes)
}
pub fn decoder_iso_8859_13(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_13(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_13, bytes)
}
pub fn decoder_iso_8859_14(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_14(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_14, bytes)
}
pub fn decoder_iso_8859_15(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_15(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_15, bytes)
}
pub fn decoder_iso_8859_16(bytes: &[u8]) -> Cow<str> {
pub fn decoder_iso_8859_16(bytes: &[u8]) -> String {
single_byte_decoder(ISO_8859_16, bytes)
}
pub fn decoder_cp1250(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1250(bytes: &[u8]) -> String {
single_byte_decoder(CP1250, bytes)
}
pub fn decoder_cp1251(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1251(bytes: &[u8]) -> String {
single_byte_decoder(CP1251, bytes)
}
pub fn decoder_cp1252(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1252(bytes: &[u8]) -> String {
single_byte_decoder(CP1252, bytes)
}
pub fn decoder_cp1253(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1253(bytes: &[u8]) -> String {
single_byte_decoder(CP1253, bytes)
}
pub fn decoder_cp1254(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1254(bytes: &[u8]) -> String {
single_byte_decoder(CP1254, bytes)
}
pub fn decoder_cp1255(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1255(bytes: &[u8]) -> String {
single_byte_decoder(CP1255, bytes)
}
pub fn decoder_cp1256(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1256(bytes: &[u8]) -> String {
single_byte_decoder(CP1256, bytes)
}
pub fn decoder_cp1257(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1257(bytes: &[u8]) -> String {
single_byte_decoder(CP1257, bytes)
}
pub fn decoder_cp1258(bytes: &[u8]) -> Cow<str> {
pub fn decoder_cp1258(bytes: &[u8]) -> String {
single_byte_decoder(CP1258, bytes)
}
pub fn decoder_koi8_r(bytes: &[u8]) -> Cow<str> {
pub fn decoder_koi8_r(bytes: &[u8]) -> String {
single_byte_decoder(KOI8_R, bytes)
}
pub fn decoder_koi8_u(bytes: &[u8]) -> Cow<str> {
pub fn decoder_koi8_u(bytes: &[u8]) -> String {
single_byte_decoder(KOI8_U, bytes)
}
pub fn decoder_macintosh(bytes: &[u8]) -> Cow<str> {
pub fn decoder_macintosh(bytes: &[u8]) -> String {
single_byte_decoder(MACINTOSH, bytes)
}
pub fn decoder_ibm_850(bytes: &[u8]) -> Cow<str> {
pub fn decoder_ibm_850(bytes: &[u8]) -> String {
single_byte_decoder(IBM850, bytes)
}
pub fn decoder_tis_620(bytes: &[u8]) -> Cow<str> {
pub fn decoder_tis_620(bytes: &[u8]) -> String {
single_byte_decoder(TIS_620, bytes)
}
+27 -41
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,38 +9,32 @@
* except according to those terms.
*/
use std::{
borrow::Cow,
char::{decode_utf16, REPLACEMENT_CHARACTER},
};
use std::char::{decode_utf16, REPLACEMENT_CHARACTER};
use crate::decoders::base64::{Base64Chunk, BASE64_MAP};
use crate::decoders::base64::BASE64_MAP;
struct Utf7DecoderState {
utf16_bytes: Vec<u16>,
pending_byte: Option<u8>,
b64_bytes: Base64Chunk,
b64_bytes: u32,
}
fn add_utf16_bytes(state: &mut Utf7DecoderState, n_bytes: usize) {
debug_assert!(n_bytes < std::mem::size_of::<u32>());
// Safe because n_bytes is always lower than size_of::<u32>
unsafe {
for byte in state.b64_bytes.bytes.get_unchecked(0..n_bytes) {
if let Some(pending_byte) = state.pending_byte {
state
.utf16_bytes
.push(u16::from_be_bytes([pending_byte, *byte]));
state.pending_byte = None;
} else {
state.pending_byte = Some(*byte);
}
for byte in state.b64_bytes.to_le_bytes()[0..n_bytes].iter() {
if let Some(pending_byte) = state.pending_byte {
state
.utf16_bytes
.push(u16::from_be_bytes([pending_byte, *byte]));
state.pending_byte = None;
} else {
state.pending_byte = Some(*byte);
}
}
}
pub fn decoder_utf7(bytes: &[u8]) -> Cow<str> {
pub fn decoder_utf7(bytes: &[u8]) -> String {
let mut result = String::with_capacity(bytes.len());
let mut byte_count: u8 = 0;
let mut in_b64 = false;
@@ -48,28 +42,20 @@ pub fn decoder_utf7(bytes: &[u8]) -> Cow<str> {
let mut state = Utf7DecoderState {
utf16_bytes: Vec::with_capacity(10),
pending_byte: None,
b64_bytes: Base64Chunk { val: 0 },
b64_bytes: 0,
};
for byte in bytes {
if in_b64 {
// Safe because BASEMAP size is [4][u8::MAX]
let val = unsafe {
BASE64_MAP
.get_unchecked(byte_count as usize)
.get_unchecked(*byte as usize)
};
let val = BASE64_MAP[byte_count as usize][*byte as usize];
if *val < 0x01ffffff {
if val < 0x01ffffff {
byte_count = (byte_count + 1) & 3;
if byte_count == 1 {
state.b64_bytes.val = *val;
state.b64_bytes = val;
} else {
// Safe union read/write
unsafe {
state.b64_bytes.val |= *val;
}
state.b64_bytes |= val;
if byte_count == 0 {
add_utf16_bytes(&mut state, 3);
@@ -112,30 +98,29 @@ pub fn decoder_utf7(bytes: &[u8]) -> Cow<str> {
}
result.shrink_to_fit();
result.into()
result
}
fn decoder_utf16_(bytes: &[u8], fnc: fn([u8; 2]) -> u16) -> Cow<str> {
fn decoder_utf16_(bytes: &[u8], fnc: fn([u8; 2]) -> u16) -> String {
if bytes.len() >= 2 {
decode_utf16(bytes.chunks_exact(2).map(|c| fnc([c[0], c[1]])))
.map(|r| r.unwrap_or(REPLACEMENT_CHARACTER))
.collect::<String>()
.into()
} else {
"".into()
"".to_string()
}
}
pub fn decoder_utf16_le(bytes: &[u8]) -> Cow<str> {
pub fn decoder_utf16_le(bytes: &[u8]) -> String {
decoder_utf16_(bytes, u16::from_le_bytes)
}
pub fn decoder_utf16_be(bytes: &[u8]) -> Cow<str> {
pub fn decoder_utf16_be(bytes: &[u8]) -> String {
decoder_utf16_(bytes, u16::from_be_bytes)
}
#[allow(clippy::type_complexity)]
pub fn decoder_utf16(bytes: &[u8]) -> Cow<str> {
pub fn decoder_utf16(bytes: &[u8]) -> String {
// Read BOM
let (bytes, fnc): (&[u8], fn([u8; 2]) -> u16) = match bytes.get(0..2) {
Some([0xfe, 0xff]) => (bytes.get(2..).unwrap_or(&[]), u16::from_be_bytes),
@@ -146,8 +131,9 @@ pub fn decoder_utf16(bytes: &[u8]) -> Cow<str> {
decoder_utf16_(bytes, fnc)
}
pub fn decoder_utf8(bytes: &[u8]) -> Cow<str> {
String::from_utf8_lossy(bytes)
// Not currently used at the moment
pub fn decoder_utf8(bytes: &[u8]) -> String {
String::from_utf8_lossy(bytes).into_owned()
}
#[cfg(test)]
+84 -62
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,84 +9,106 @@
* except according to those terms.
*/
use std::borrow::Cow;
use crate::{decoders::charsets::map::get_charset_decoder, parsers::message::MessageStream};
use crate::{
decoders::{
base64::Base64Decoder, charsets::map::get_charset_decoder,
quoted_printable::QuotedPrintableDecoder,
},
parsers::message_stream::MessageStream,
use super::{
base64::decode_base64, quoted_printable::decode_quoted_printable, DecodeFnc, DecodeResult,
};
use super::charsets::map::decoder_default;
enum Rfc2047State {
Init,
Charset,
Encoding,
Data,
}
pub fn parse_encoded_word<'x>(stream: &MessageStream<'x>) -> Option<Cow<'x, str>> {
if !stream.skip_byte(&b'?') {
return None;
}
let charset_start = stream.get_pos();
let mut charset_end = charset_start;
let backup_pos = charset_start - 1;
pub fn decode_rfc2047(stream: &MessageStream, start_pos: usize) -> (usize, Option<String>) {
let mut read_pos: usize = start_pos;
let mut state = Rfc2047State::Init;
while let Some(ch) = stream.next() {
match ch {
b'?' => {
if charset_end == charset_start {
charset_end = stream.get_pos() - 1;
let mut charset_start = 0;
let mut charset_end = 0;
let mut decode_fnc: Option<DecodeFnc> = None;
for ch in stream.data[start_pos..].iter() {
read_pos += 1;
match state {
Rfc2047State::Init => {
if ch != &b'?' {
return (0, None);
}
break;
state = Rfc2047State::Charset;
charset_start = read_pos;
charset_end = read_pos;
}
b'*' => {
if charset_end == charset_start {
charset_end = stream.get_pos() - 1;
Rfc2047State::Charset => match ch {
b'?' => {
if charset_end == charset_start {
charset_end = read_pos - 1;
}
if (charset_end - charset_start) < 2 {
return (0, None);
}
state = Rfc2047State::Encoding;
}
b'*' => {
if charset_end == charset_start {
charset_end = read_pos - 1;
}
}
b'\n' => {
return (0, None);
}
_ => (),
},
Rfc2047State::Encoding => {
match ch {
b'q' | b'Q' => decode_fnc = Some(decode_quoted_printable),
b'b' | b'B' => decode_fnc = Some(decode_base64),
_ => {
return (0, None);
}
}
state = Rfc2047State::Data;
}
Rfc2047State::Data => {
if ch != &b'?' {
return (0, None);
} else {
break;
}
}
b'\n' => {
stream.set_pos(backup_pos);
return None;
}
_ => (),
}
}
if !(2..=45).contains(&(charset_end - charset_start)) {
stream.set_pos(backup_pos);
return None;
}
let (success, is_utf8_safe, bytes) = match stream.next() {
Some(b'q') | Some(b'Q') if stream.skip_byte(&b'?') => {
stream.decode_quoted_printable(b"?=", true)
if let Some(decode_fnc) = decode_fnc {
if let (bytes_read @ 1..=usize::MAX, DecodeResult::Owned(bytes)) =
decode_fnc(stream, read_pos, b"?=", true)
{
return (
(read_pos - start_pos) + bytes_read,
if let Some(decoder) = get_charset_decoder(&stream.data[charset_start..charset_end])
{
decoder(&bytes).into()
} else {
String::from_utf8(bytes)
.unwrap_or_else(|e| String::from_utf8_lossy(e.as_bytes()).into_owned())
.into()
},
);
}
Some(b'b') | Some(b'B') if stream.skip_byte(&b'?') => stream.decode_base64(b"?=", true),
_ => (false, false, None),
};
if !success {
stream.set_pos(backup_pos);
return None;
}
if let Some(decoder) =
get_charset_decoder(stream.get_bytes(charset_start, charset_end).unwrap())
{
decoder(bytes?).into()
} else if is_utf8_safe {
unsafe { Cow::from(std::str::from_utf8_unchecked(bytes?)).into() }
} else {
decoder_default(bytes?).into()
}
(0, None)
}
#[cfg(test)]
mod tests {
use crate::{
decoders::encoded_word::parse_encoded_word, parsers::message_stream::MessageStream,
};
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream};
#[test]
fn decode_rfc2047() {
fn decode_rfc2047_string() {
let inputs = [
(
"?iso-8859-1?q?this=20is=20some=20text?=".to_string(),
@@ -165,14 +187,14 @@ mod tests {
];
for input in inputs {
let mut str = input.0.to_string();
let str = input.0.to_string();
match parse_encoded_word(&MessageStream::new(unsafe { str.as_bytes_mut() })) {
Some(string) => {
match decode_rfc2047(&MessageStream::new(str.as_bytes()), 0) {
(_, Some(string)) => {
//println!("Decoded '{}'", string);
assert_eq!(string, input.1);
}
None => panic!("Failed to decode '{}'", input.0),
_ => panic!("Failed to decode '{}'", input.0),
}
}
}
+3 -3
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
@@ -39,7 +39,7 @@ pub fn decode_hex(src: &[u8]) -> (bool, Vec<u8>) {
result.push(*ch);
}
HexState::Percent => {
hex1 = unsafe { *HEX_MAP.get_unchecked(*ch as usize) };
hex1 = HEX_MAP[*ch as usize];
if hex1 != -1 {
state = HexState::Hex1;
} else {
@@ -48,7 +48,7 @@ pub fn decode_hex(src: &[u8]) -> (bool, Vec<u8>) {
}
}
HexState::Hex1 => {
let hex2 = unsafe { *HEX_MAP.get_unchecked(*ch as usize) };
let hex2 = HEX_MAP[*ch as usize];
state = HexState::None;
if hex2 != -1 {
+22 -28
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
@@ -30,36 +30,32 @@ pub fn add_html_token(result: &mut String, token: &[u8], add_space: bool) {
} else if (2..=31).contains(&entity.len()) {
let mut hash = entity.len() as u32;
/* Safe because ENTITY_HASH's size is 260 (u8::MAX + 5)
and ENTITY_MAP's size is 18016 (18079 - 64 + 1) */
debug_assert_eq!(ENTITY_HASH.len(), u8::MAX as usize + 5);
debug_assert_eq!(ENTITY_MAP.len(), 18079 - 64 + 1);
unsafe {
for (pos, ch) in entity.iter().enumerate() {
match pos {
0 | 5 | 6 | 9 | 11 => {
hash += *ENTITY_HASH.get_unchecked(*ch as usize);
}
1 => {
hash += *ENTITY_HASH.get_unchecked(*ch as usize + 4);
}
2 | 4 => {
hash += *ENTITY_HASH.get_unchecked(*ch as usize + 1);
}
3 => {
hash += *ENTITY_HASH.get_unchecked(*ch as usize + 3);
}
_ => (),
for (pos, ch) in entity.iter().enumerate() {
match pos {
0 | 5 | 6 | 9 | 11 => {
hash += ENTITY_HASH[*ch as usize];
}
if pos == entity.len() - 1 {
hash += *ENTITY_HASH.get_unchecked(*ch as usize);
1 => {
hash += ENTITY_HASH[*ch as usize + 4];
}
2 | 4 => {
hash += ENTITY_HASH[*ch as usize + 1];
}
3 => {
hash += ENTITY_HASH[*ch as usize + 3];
}
_ => (),
}
if pos == entity.len() - 1 {
hash += ENTITY_HASH[*ch as usize];
}
}
if (64..=18079).contains(&hash) {
entity_code = *ENTITY_MAP.get_unchecked((hash - 64) as usize);
}
if (64..=18079).contains(&hash) {
entity_code = ENTITY_MAP[(hash - 64) as usize];
}
}
@@ -69,9 +65,7 @@ pub fn add_html_token(result: &mut String, token: &[u8], add_space: bool) {
}
}
// Safe because the input string is tokenized by ASCII chars, therefore the resulting
// u8 array is UTF-8 safe.
result.push_str(unsafe { std::str::from_utf8_unchecked(token) });
result.push_str(std::str::from_utf8(token).unwrap());
}
pub fn html_to_text(input: &str) -> String {
@@ -237,7 +231,7 @@ pub fn text_to_html(input: &str) -> String {
}
result.extend_from_slice(b"</body></html>");
unsafe { String::from_utf8_unchecked(result) }
String::from_utf8(result).unwrap()
}
#[cfg(test)]
+11 -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
@@ -9,9 +9,19 @@
* except according to those terms.
*/
use crate::parsers::message::MessageStream;
pub mod base64;
pub mod charsets;
pub mod encoded_word;
pub mod hex;
pub mod html;
pub mod quoted_printable;
pub type DecodeFnc<'x> = fn(&MessageStream<'x>, usize, &[u8], bool) -> (usize, DecodeResult);
pub enum DecodeResult {
Owned(Vec<u8>),
Borrowed((usize, usize)),
Empty,
}
+161 -188
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,7 +9,9 @@
* except according to those terms.
*/
use crate::parsers::message_stream::MessageStream;
use crate::parsers::message::MessageStream;
use super::DecodeResult;
#[derive(PartialEq, Debug)]
enum QuotedPrintableState {
@@ -18,208 +20,157 @@ enum QuotedPrintableState {
Hex1,
}
pub trait QuotedPrintableDecoder<'x> {
fn decode_quoted_printable(
&self,
boundary: &[u8],
is_word: bool,
) -> (bool, bool, Option<&'x [u8]>);
}
pub fn decode_quoted_printable<'x>(
stream: &MessageStream<'x>,
start_pos: usize,
boundary: &[u8],
is_word: bool,
) -> (usize, DecodeResult) {
let mut success = boundary.is_empty();
// Miri does not play well with UnsafeCells, see https://github.com/rust-lang/miri/issues/1665
//
// When testing under Miri,
// (*data)[i] = val;
// is used instead of
// *(*data).get_unchecked_mut(i) = val;
//
let mut bytes_read = 0;
impl<'x> QuotedPrintableDecoder<'x> for MessageStream<'x> {
fn decode_quoted_printable(
&self,
boundary: &[u8],
is_word: bool,
) -> (bool, bool, Option<&'x [u8]>) {
unsafe {
let mut success = boundary.is_empty();
let mut is_utf8_safe = true;
let mut buf = Vec::with_capacity(stream.data.len() - start_pos);
let mut data = &mut *self.data.get();
let data_len = (*data).len();
let mut state = QuotedPrintableState::None;
let mut match_count = 0;
let mut hex1 = 0;
let mut lf_pos = 0;
let stream_pos = &mut *self.pos.get();
let start_pos = *stream_pos;
let mut read_pos = *stream_pos;
let mut write_pos = *stream_pos;
debug_assert!(boundary.is_empty() || boundary.len() >= 2);
let mut state = QuotedPrintableState::None;
let mut match_count = 0;
let mut hex1 = 0;
for ch in stream.data[start_pos..].iter() {
bytes_read += 1;
while read_pos < data_len {
let ch = *(*data).get_unchecked(read_pos);
read_pos += 1;
// if success is false, a boundary was provided
if !success {
let mut is_boundary_end = true;
if !success {
if ch == *boundary.get_unchecked(match_count) {
match_count += 1;
if match_count == boundary.len() {
let done = is_word || self.is_boundary_end(read_pos);
data = &mut *self.data.get(); // Avoid violating the Stacked Borrows rules
if done {
success = true;
break;
}
} else {
continue;
if *ch == boundary[match_count] {
match_count += 1;
if match_count == boundary.len() {
let done = if is_word {
true
} else {
is_boundary_end =
crate::parsers::mime::is_boundary_end(stream, start_pos + bytes_read);
if is_boundary_end && bytes_read - boundary.len() == lf_pos {
buf.pop();
}
is_boundary_end
};
if done {
success = true;
break;
}
if match_count > 0 {
for ch in boundary[..match_count].iter() {
if *ch != b'\n' || QuotedPrintableState::Eq != state {
#[cfg(miri)]
{
(*data)[write_pos] = *ch;
}
#[cfg(not(miri))]
{
*((*data).get_unchecked_mut(write_pos)) = *ch;
}
write_pos += 1;
if is_utf8_safe && *ch > 0x7f {
is_utf8_safe = false;
}
}
}
state = QuotedPrintableState::None;
if ch == *boundary.get_unchecked(0) {
match_count = 1;
continue;
} else {
match_count = 0;
}
}
}
match ch {
b'=' => {
if let QuotedPrintableState::None = state {
state = QuotedPrintableState::Eq
} else {
success = false;
break;
}
}
b'\n' => {
if is_word {
success = false;
break;
} else if QuotedPrintableState::Eq == state {
state = QuotedPrintableState::None;
} else {
#[cfg(miri)]
{
(*data)[write_pos] = b'\n';
}
#[cfg(not(miri))]
{
*((*data).get_unchecked_mut(write_pos)) = b'\n';
}
write_pos += 1;
}
}
b'_' if is_word => {
#[cfg(miri)]
{
(*data)[write_pos] = b' ';
}
#[cfg(not(miri))]
{
*((*data).get_unchecked_mut(write_pos)) = b' ';
}
write_pos += 1;
}
b'\r' => (),
_ => match state {
QuotedPrintableState::None => {
#[cfg(miri)]
{
(*data)[write_pos] = ch;
}
#[cfg(not(miri))]
{
*((*data).get_unchecked_mut(write_pos)) = ch;
}
write_pos += 1;
if is_utf8_safe && ch > 0x7f {
is_utf8_safe = false;
}
}
QuotedPrintableState::Eq => {
hex1 = *HEX_MAP.get_unchecked(ch as usize);
if hex1 != -1 {
state = QuotedPrintableState::Hex1;
} else {
success = false;
break;
}
}
QuotedPrintableState::Hex1 => {
let hex2 = *HEX_MAP.get_unchecked(ch as usize);
state = QuotedPrintableState::None;
if hex2 != -1 {
let ch = ((hex1 as u8) << 4) | hex2 as u8;
#[cfg(miri)]
{
(*data)[write_pos] = ch;
}
#[cfg(not(miri))]
{
*((*data).get_unchecked_mut(write_pos)) = ch;
}
write_pos += 1;
if is_utf8_safe && ch > 0x7f {
is_utf8_safe = false;
}
} else {
success = false;
break;
}
}
},
} else {
continue;
}
}
*stream_pos = read_pos;
if match_count > 0 {
if QuotedPrintableState::Eq != state {
for ch in boundary[..match_count].iter() {
buf.push(*ch);
}
}
state = QuotedPrintableState::None;
(
success,
is_utf8_safe,
if write_pos > start_pos {
Some((*data).get_unchecked(start_pos..write_pos))
// is_boundary_end is always true except in the rare event
// that a boundary was found without a proper MIME ending (-- or \r\n)
if is_boundary_end {
if *ch == boundary[0] {
// Char matched beginning of boundary, get next char.
match_count = 1;
continue;
} else {
// Reset match count and decode character
match_count = 0;
}
} else {
None
},
)
// There was a full boundary match but without a proper MIME
// ending, reset match count and continue.
match_count = 0;
continue;
}
}
}
match ch {
b'=' => {
if let QuotedPrintableState::None = state {
state = QuotedPrintableState::Eq
} else {
success = false;
break;
}
}
b'\n' => {
if is_word {
success = false;
break;
} else if QuotedPrintableState::Eq == state {
state = QuotedPrintableState::None;
} else {
buf.push(b'\n');
lf_pos = bytes_read;
}
}
b'_' if is_word => {
buf.push(b' ');
}
b'\r' => (),
_ => match state {
QuotedPrintableState::None => {
buf.push(*ch);
}
QuotedPrintableState::Eq => {
hex1 = HEX_MAP[*ch as usize];
if hex1 != -1 {
state = QuotedPrintableState::Hex1;
} else {
success = false;
break;
}
}
QuotedPrintableState::Hex1 => {
let hex2 = HEX_MAP[*ch as usize];
state = QuotedPrintableState::None;
if hex2 != -1 {
let ch = ((hex1 as u8) << 4) | hex2 as u8;
buf.push(ch);
} else {
success = false;
break;
}
}
},
}
}
(
if success { bytes_read } else { 0 },
if !buf.is_empty() {
buf.shrink_to_fit();
DecodeResult::Owned(buf)
} else {
DecodeResult::Empty
},
)
}
#[cfg(test)]
mod tests {
use crate::{
decoders::quoted_printable::QuotedPrintableDecoder, parsers::message_stream::MessageStream,
decoders::{quoted_printable::decode_quoted_printable, DecodeResult},
parsers::message::MessageStream,
};
#[test]
fn decode_quoted_printable() {
fn decode_quoted_printable_string() {
let inputs = [
(
concat!(
@@ -245,19 +196,19 @@ mod tests {
(
"=E2=80=94=E2=80=89Antoine de Saint-Exup=C3=A9ry\n--boundary",
"— Antoine de Saint-Exupéry",
"\n--boundary",
"--boundary",
false,
),
(
"=E2=80=94=E2=80=89Antoine de Saint-Exup=C3=A9ry\n--\n--boundary",
"— Antoine de Saint-Exupéry\n--",
"\n--boundary",
"--boundary",
false,
),
(
"=E2=80=94=E2=80=89Antoine de Saint-Exup=C3=A9ry=\n--\n--boundary",
"— Antoine de Saint-Exupéry--",
"\n--boundary",
"--boundary",
false,
),
(
@@ -289,15 +240,25 @@ mod tests {
];
for input in inputs {
let mut str = input.0.to_string();
let stream = MessageStream::new(unsafe { str.as_bytes_mut() });
let str = input.0.to_string();
let stream = MessageStream::new(str.as_bytes());
let (success, _, result) = stream.decode_quoted_printable(input.2.as_bytes(), input.3);
let (bytes_read, result) =
decode_quoted_printable(&stream, 0, input.2.as_bytes(), input.3);
assert_eq!(success, !input.1.is_empty(), "Failed for '{:?}'", input.0);
assert_eq!(
bytes_read > 0,
!input.1.is_empty(),
"Failed for '{:?}'",
input.0
);
if !input.1.is_empty() {
let result_str = std::str::from_utf8(result.unwrap()).unwrap();
let bytes = match result {
DecodeResult::Owned(v) => v,
_ => unreachable!(),
};
let result_str = std::str::from_utf8(&bytes).unwrap();
/*println!(
"Decoded '{}'\n -> to ->\n'{}'\n{}",
@@ -314,6 +275,18 @@ mod tests {
);
}
}
// MIRI overflow tests
for input in [b"\x0a\x0a\x00\x0b".to_vec(), b":B\x0a%".to_vec()] {
let stream = MessageStream::new(&input[..]);
decode_quoted_printable(&stream, 0, b"\n\n", true);
let stream = MessageStream::new(&input[..]);
decode_quoted_printable(&stream, 0, b"\n\n", false);
let stream = MessageStream::new(&input[..]);
decode_quoted_printable(&stream, 0, &[], true);
let stream = MessageStream::new(&input[..]);
decode_quoted_printable(&stream, 0, &[], false);
}
}
}
+1271 -651
View File
File diff suppressed because it is too large Load Diff
+361
View File
@@ -0,0 +1,361 @@
/*
* 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::{
fs, io,
path::{Path, PathBuf},
};
/// Maildir folder iterator
pub struct FolderIterator<'x> {
inbox: Option<MessageIterator>,
it_stack: Vec<fs::ReadDir>,
name_stack: Vec<String>,
prefix: Option<&'x str>,
}
/// Maildir message iterator
pub struct MessageIterator {
name: Option<String>,
cur_it: fs::ReadDir,
new_it: fs::ReadDir,
}
/// Maildir message contents and metadata
#[derive(Debug, PartialEq, Eq, Clone, PartialOrd, Ord)]
pub struct Message {
internal_date: u64,
flags: Vec<Flag>,
contents: Vec<u8>,
path: PathBuf,
}
/// Flags of Maildir message
#[derive(Debug, PartialEq, Eq, Clone, Copy, PartialOrd, Ord)]
pub enum Flag {
Passed,
Replied,
Seen,
Trashed,
Draft,
Flagged,
}
impl FolderIterator<'_> {
/// Creates a new Maildir folder iterator.
/// For Maildir++ mailboxes use `Some(".")` as the prefix.
/// For Dovecot Maildir mailboxes using LAYOUT=fs, use `None` as the prefix.
pub fn new(
path: impl Into<PathBuf>,
sub_folder_prefix: Option<&str>,
) -> io::Result<FolderIterator> {
let path = path.into();
Ok(FolderIterator {
it_stack: vec![fs::read_dir(&path)?],
name_stack: Vec::new(),
inbox: match MessageIterator::new_(&path, None) {
Ok(inbox) => inbox.into(),
Err(err) => {
if err.kind() == io::ErrorKind::NotFound {
None
} else {
return Err(err);
}
}
},
prefix: sub_folder_prefix,
})
}
}
impl MessageIterator {
/// Creates a new Maildir message iterator
pub fn new(path: impl Into<PathBuf>) -> io::Result<MessageIterator> {
MessageIterator::new_(&path.into(), None)
}
fn new_(path: &Path, name: Option<String>) -> io::Result<MessageIterator> {
let mut cur_path = path.to_path_buf();
cur_path.push("cur");
if !cur_path.exists() {
return Err(io::Error::new(
io::ErrorKind::NotFound,
"Invalid Maildir format, 'cur' directory not found.",
));
}
let mut new_path = path.to_path_buf();
new_path.push("new");
if !new_path.exists() {
return Err(io::Error::new(
io::ErrorKind::NotFound,
"Invalid Maildir format, 'new' directory not found.",
));
}
Ok(MessageIterator {
name,
cur_it: fs::read_dir(cur_path)?,
new_it: fs::read_dir(new_path)?,
})
}
/// Returns the mailbox name of None for 'INBOX'.
pub fn name(&self) -> Option<&str> {
self.name.as_deref()
}
}
impl Iterator for FolderIterator<'_> {
type Item = io::Result<MessageIterator>;
fn next(&mut self) -> Option<Self::Item> {
if let Some(inbox) = self.inbox.take() {
return Some(Ok(inbox));
}
loop {
let entry = match self.it_stack.last_mut().unwrap().next() {
Some(Ok(entry)) => entry,
Some(Err(err)) => return Some(Err(err)),
None => {
self.it_stack.pop();
self.name_stack.pop();
if !self.it_stack.is_empty() {
continue;
} else {
return None;
}
}
};
let path = entry.path();
if path.is_dir() {
if let Some(name) =
path.file_name()
.and_then(|name| name.to_str())
.and_then(|name| {
if !["cur", "new", "tmp"].contains(&name) {
if let Some(prefix) = self.prefix {
name.strip_prefix(prefix)
} else {
name.into()
}
} else {
None
}
})
{
match fs::read_dir(&path) {
Ok(next_it) => {
self.it_stack.push(next_it);
self.name_stack.push(name.to_string());
}
Err(err) => {
return Some(Err(err));
}
}
match MessageIterator::new_(
&path,
self.name_stack.join(self.prefix.unwrap_or("/")).into(),
) {
Ok(folder) => return Some(Ok(folder)),
Err(err) => {
if err.kind() != io::ErrorKind::NotFound {
return Some(Err(err));
}
}
}
}
}
}
}
}
impl Iterator for MessageIterator {
type Item = io::Result<Message>;
fn next(&mut self) -> Option<Self::Item> {
loop {
let entry = match self.cur_it.next().or_else(|| self.new_it.next()) {
Some(Ok(entry)) => entry,
Some(Err(err)) => return Some(Err(err)),
None => return None,
};
let path = entry.path();
if path.is_file() {
if let Some(name) = path.file_name().and_then(|name| name.to_str()) {
if !name.starts_with('.') {
let internal_date =
match fs::metadata(&path).and_then(|m| m.created()).and_then(|d| {
d.duration_since(std::time::UNIX_EPOCH)
.map(|d| d.as_secs())
.map_err(|e| {
io::Error::new(io::ErrorKind::InvalidData, e.to_string())
})
}) {
Ok(metadata) => metadata,
Err(err) => return Some(Err(err)),
};
let contents = match fs::read(&path) {
Ok(contents) => contents,
Err(err) => return Some(Err(err)),
};
let mut flags = Vec::new();
if let Some((_, part)) = name.rsplit_once("2,") {
for &ch in part.as_bytes() {
match ch {
b'P' => flags.push(Flag::Passed),
b'R' => flags.push(Flag::Replied),
b'S' => flags.push(Flag::Seen),
b'T' => flags.push(Flag::Trashed),
b'D' => flags.push(Flag::Draft),
b'F' => flags.push(Flag::Flagged),
_ => {
if !ch.is_ascii_alphanumeric() {
break;
}
}
}
}
}
return Some(Ok(Message {
contents,
internal_date,
flags,
path: path.to_path_buf(),
}));
}
}
}
}
}
}
impl Message {
/// Returns the message creation date in seconds since UNIX epoch
pub fn internal_date(&self) -> u64 {
self.internal_date
}
/// Returns the message flags
pub fn flags(&self) -> &[Flag] {
&self.flags
}
/// Returns the path to the message file
pub fn path(&self) -> &Path {
&self.path
}
/// Returns the message contents
pub fn contents(&self) -> &[u8] {
&self.contents
}
/// Unwraps the message contents
pub fn unwrap_contents(self) -> Vec<u8> {
self.contents
}
}
#[cfg(test)]
mod tests {
use std::path::PathBuf;
use crate::mailbox::maildir::{Flag, Message};
use super::FolderIterator;
#[test]
fn parse_maildir() {
let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
test_dir.push("tests");
test_dir.push("maildir");
let mut messages = Vec::new();
let expected_messages = vec![
(
"INBOX".to_string(),
Message {
internal_date: 0,
flags: vec![Flag::Seen],
contents: vec![98, 10],
path: "unknown".into(),
},
),
(
"INBOX".to_string(),
Message {
internal_date: 0,
flags: vec![Flag::Seen, Flag::Trashed],
contents: vec![97, 10],
path: "unknown".into(),
},
),
(
"My Folder".to_string(),
Message {
internal_date: 0,
flags: vec![],
contents: vec![100, 10],
path: "unknown".into(),
},
),
(
"My Folder".to_string(),
Message {
internal_date: 0,
flags: vec![Flag::Trashed, Flag::Draft, Flag::Replied],
contents: vec![99, 10],
path: "unknown".into(),
},
),
(
"My Folder.Nested Folder".to_string(),
Message {
internal_date: 0,
flags: vec![Flag::Replied, Flag::Draft, Flag::Flagged],
contents: vec![102, 10],
path: "unknown".into(),
},
),
(
"My Folder.Nested Folder".to_string(),
Message {
internal_date: 0,
flags: vec![Flag::Flagged, Flag::Passed],
contents: vec![101, 10],
path: "unknown".into(),
},
),
];
for folder in FolderIterator::new(test_dir, ".".into()).unwrap() {
let folder = folder.unwrap();
let name = folder.name().unwrap_or("INBOX").to_string();
for message in folder {
let mut message = message.unwrap();
assert_ne!(message.internal_date(), 0);
assert!(message.path.exists());
message.internal_date = 0;
message.path = PathBuf::from("unknown");
messages.push((name.clone(), message));
}
}
messages.sort_unstable();
assert_eq!(messages, expected_messages);
}
}
+279
View File
@@ -0,0 +1,279 @@
/*
* 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 crate::DateTime;
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 MessageIterator<T: Read> {
reader: BufReader<T>,
message: Option<Message>,
}
/// Mbox message contents and metadata
#[derive(Debug, PartialEq, Eq, Clone, PartialOrd, Ord)]
pub struct Message {
internal_date: u64,
from: String,
contents: Vec<u8>,
}
#[derive(Debug)]
pub struct ParseError {}
impl<T> MessageIterator<T>
where
T: Read,
{
pub fn new(reader: T) -> MessageIterator<T> {
MessageIterator {
reader: BufReader::new(reader),
message: None,
}
}
}
impl<T> Iterator for MessageIterator<T>
where
T: Read,
{
type Item = Result<Message, ParseError>;
fn next(&mut self) -> Option<Self::Item> {
let mut message_line = Vec::with_capacity(80);
loop {
match self.reader.read_until(b'\n', &mut message_line) {
Ok(bytes_read) => {
if bytes_read == 0 {
break;
}
}
Err(_) => {
return Some(Err(ParseError {}));
}
}
let is_from = message_line
.get(..5)
.map(|line| line == b"From ")
.unwrap_or(false);
if let Some(message) = &mut self.message {
if !is_from {
if message_line[0] != b'>' {
message.contents.append(&mut message_line);
} else if message_line
.iter()
.skip_while(|&&ch| ch == b'>')
.take(5)
.copied()
.collect::<Vec<u8>>()
== b"From "
{
message.contents.extend_from_slice(&message_line[1..]);
message_line.clear();
} else {
message.contents.append(&mut message_line);
}
} else {
let message = self.message.take().map(Ok);
self.message =
Message::new(std::str::from_utf8(&message_line).unwrap_or("")).into();
return message;
}
} else {
if is_from {
self.message =
Message::new(std::str::from_utf8(&message_line).unwrap_or("")).into();
}
message_line.clear();
}
}
self.message.take().map(Ok)
}
}
impl Message {
fn new(hdr: &str) -> Self {
let (internal_date, from) = if let Some((from, date)) = hdr
.strip_prefix("From ")
.and_then(|hdr| hdr.split_once(' '))
{
let mut dt = DateTime {
year: u16::MAX,
month: u8::MAX,
day: u8::MAX,
hour: u8::MAX,
minute: u8::MAX,
second: u8::MAX,
tz_before_gmt: false,
tz_hour: 0,
tz_minute: 0,
};
for (pos, part) in date.split_whitespace().enumerate() {
match pos {
1 => {
dt.month = if part.eq_ignore_ascii_case("jan") {
1
} else if part.eq_ignore_ascii_case("feb") {
2
} else if part.eq_ignore_ascii_case("mar") {
3
} else if part.eq_ignore_ascii_case("apr") {
4
} else if part.eq_ignore_ascii_case("may") {
5
} else if part.eq_ignore_ascii_case("jun") {
6
} else if part.eq_ignore_ascii_case("jul") {
7
} else if part.eq_ignore_ascii_case("aug") {
8
} else if part.eq_ignore_ascii_case("sep") {
9
} else if part.eq_ignore_ascii_case("oct") {
10
} else if part.eq_ignore_ascii_case("nov") {
11
} else if part.eq_ignore_ascii_case("dec") {
12
} else {
u8::MAX
};
}
2 => {
dt.day = part.parse().unwrap_or(u8::MAX);
}
3 => {
for (pos, part) in part.split(':').enumerate() {
match pos {
0 => {
dt.hour = part.parse().unwrap_or(u8::MAX);
}
1 => {
dt.minute = part.parse().unwrap_or(u8::MAX);
}
2 => {
dt.second = part.parse().unwrap_or(u8::MAX);
}
_ => {
break;
}
}
}
}
4 => {
dt.year = part.parse().unwrap_or(u16::MAX);
}
_ => (),
}
}
(
if dt.is_valid() {
dt.to_timestamp() as u64
} else {
0
},
from.trim().to_string(),
)
} else {
(0, "".to_string())
};
Self {
internal_date,
from,
contents: Vec::with_capacity(1024),
}
}
/// Returns the message creation date in UTC seconds since UNIX epoch
pub fn internal_date(&self) -> u64 {
self.internal_date
}
/// Returns the message sender address
pub fn from(&self) -> &str {
&self.from
}
/// Returns the message contents
pub fn contents(&self) -> &[u8] {
&self.contents
}
/// Unwraps the message contents
pub fn unwrap_contents(self) -> Vec<u8> {
self.contents
}
}
#[cfg(test)]
mod tests {
use crate::mailbox::mbox::Message;
use super::MessageIterator;
#[test]
fn parse_mbox() {
let message = br#"From god@heaven.af.mil Sat Jan 3 01:05:34 1996
Message 1
From cras@irccrew.org Tue Jul 23 19:39:23 2002
Message 2
From test@test.com Tue Aug 6 13:34:34 2002
Message 3
>From hello
>>From world
>>>From test
From other@domain.com Mon Jan 15 15:30:00 2018
Message 4
> From
>F
"#;
let parser = MessageIterator::new(&message[..]);
let expected_messages = vec![
Message {
internal_date: 820631134,
from: "god@heaven.af.mil".to_string(),
contents: b"Message 1\n\n".to_vec(),
},
Message {
internal_date: 1027453163,
from: "cras@irccrew.org".to_string(),
contents: b"Message 2\n\n".to_vec(),
},
Message {
internal_date: 1028640874,
from: "test@test.com".to_string(),
contents: b"Message 3\nFrom hello\n>From world\n>>From test\n\n".to_vec(),
},
Message {
internal_date: 1516030200,
from: "other@domain.com".to_string(),
contents: b"Message 4\n> From\n>F\n".to_vec(),
},
];
for (message, expected_messages) in parser.zip(expected_messages) {
assert_eq!(message.unwrap(), expected_messages);
}
}
}
+2
View File
@@ -0,0 +1,2 @@
pub mod maildir;
pub mod mbox;
+32 -51
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,22 +12,10 @@
use std::borrow::Cow;
use crate::{
decoders::encoded_word::parse_encoded_word, parsers::message_stream::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,
@@ -40,7 +28,6 @@ pub struct AddressParser<'x> {
token_start: usize,
token_end: usize,
is_token_safe: bool,
is_token_email: bool,
is_token_start: bool,
is_escaped: bool,
@@ -64,13 +51,7 @@ pub fn add_token<'x>(
add_trail_space: bool,
) {
if parser.token_start > 0 {
let token = stream
.get_string(
parser.token_start - 1,
parser.token_end,
parser.is_token_safe,
)
.unwrap();
let token = String::from_utf8_lossy(&stream.data[parser.token_start - 1..parser.token_end]);
let mut add_space = false;
let list = match parser.state {
AddressState::Address => &mut parser.mail_tokens,
@@ -100,7 +81,6 @@ pub fn add_token<'x>(
}
parser.token_start = 0;
parser.is_token_safe = true;
parser.is_token_email = false;
parser.is_token_start = true;
parser.is_escaped = false;
@@ -233,12 +213,11 @@ pub fn add_group(parser: &mut AddressParser) {
});
}
pub fn parse_address<'x>(stream: &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,
is_token_safe: true,
is_token_email: false,
is_token_start: true,
is_escaped: false,
@@ -256,13 +235,18 @@ pub fn parse_address<'x>(stream: &MessageStream<'x>) -> Address<'x> {
result: Vec::new(),
};
while let Some(ch) = stream.next() {
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => {
add_token(&mut parser, stream, false);
match stream.peek() {
match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
stream.advance(1);
iter.next();
stream.pos += 1;
if !parser.is_token_start {
parser.is_token_start = true;
}
@@ -274,7 +258,7 @@ pub fn parse_address<'x>(stream: &MessageStream<'x>) -> Address<'x> {
b'\\' if parser.state != AddressState::Name => {
if parser.token_start > 0 {
if parser.state == AddressState::Quote {
parser.token_end = stream.get_pos() - 1;
parser.token_end = stream.pos - 1;
}
add_token(&mut parser, stream, false);
}
@@ -315,7 +299,7 @@ pub fn parse_address<'x>(stream: &MessageStream<'x>) -> Address<'x> {
parser.is_token_email = true;
}
b'=' if parser.is_token_start && !parser.is_escaped => {
if let Some(token) = parse_encoded_word(stream) {
if let (d_bytes_read, Some(token)) = decode_rfc2047(stream, stream.pos) {
let add_space = parser.state != AddressState::Quote; // Make borrow-checker happy
add_token(&mut parser, stream, add_space);
(if parser.state != AddressState::Comment {
@@ -323,7 +307,9 @@ pub fn parse_address<'x>(stream: &MessageStream<'x>) -> Address<'x> {
} else {
&mut parser.comment_tokens
})
.push(token);
.push(token.into());
stream.pos += d_bytes_read;
iter = stream.data[stream.pos..].iter();
continue;
}
}
@@ -336,10 +322,10 @@ pub fn parse_address<'x>(stream: &MessageStream<'x>) -> Address<'x> {
}
if parser.state == AddressState::Quote {
if parser.token_start == 0 {
parser.token_start = stream.get_pos();
parser.token_start = stream.pos;
parser.token_end = parser.token_start;
} else {
parser.token_end = stream.get_pos();
parser.token_end = stream.pos;
}
}
continue;
@@ -373,12 +359,7 @@ pub fn parse_address<'x>(stream: &MessageStream<'x>) -> Address<'x> {
add_group(&mut parser);
continue;
}
0..=0x7f => (),
_ => {
if parser.is_token_safe {
parser.is_token_safe = false;
}
}
_ => (),
}
if parser.is_escaped {
@@ -390,10 +371,10 @@ pub fn parse_address<'x>(stream: &MessageStream<'x>) -> Address<'x> {
}
if parser.token_start == 0 {
parser.token_start = stream.get_pos();
parser.token_start = stream.pos;
parser.token_end = parser.token_start;
} else {
parser.token_end = stream.get_pos();
parser.token_end = stream.pos;
}
}
@@ -402,25 +383,25 @@ pub fn parse_address<'x>(stream: &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
}
}
mod tests {
#[test]
fn parse_addresses() {
use crate::parsers::{fields::address::parse_address, message_stream::MessageStream};
use crate::parsers::fields::address::parse_address;
use super::*;
@@ -941,9 +922,9 @@ mod tests {
];
for input in inputs {
let mut str = input.0.to_string();
let result = parse_address(&MessageStream::new(unsafe { str.as_bytes_mut() }));
let expected: Address = serde_yaml::from_str(input.1).unwrap_or(Address::Empty);
let str = input.0.to_string();
let result = parse_address(&mut MessageStream::new(str.as_bytes()));
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
+163 -54
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,33 +11,103 @@
use std::fmt;
use crate::{parsers::message_stream::MessageStream, DateTime};
use crate::{parsers::message::MessageStream, DateTime, HeaderValue};
impl DateTime {
/// Returns an ISO-8601 representation of the parsed RFC5322 datetime field
pub fn to_iso8601(&self) -> String {
format!(
"{:04}-{:02}-{:02}T{:02}:{:02}:{:02}{}{:02}:{:02}",
self.year,
self.month,
self.day,
self.hour,
self.minute,
self.second,
if self.tz_before_gmt { "-" } else { "+" },
self.tz_hour,
self.tz_minute
)
/// Parses an RFC822 date
pub fn parse_rfc822(&self, value: &str) -> Option<Self> {
match parse_date(&mut MessageStream {
data: value.as_bytes(),
pos: 0,
}) {
HeaderValue::DateTime(dt) => dt.into(),
_ => None,
}
}
/// Returns an RFC3339 representation of the parsed RFC5322 datetime field
pub fn to_rfc3339(&self) -> String {
if self.tz_hour != 0 || self.tz_minute != 0 {
format!(
"{:04}-{:02}-{:02}T{:02}:{:02}:{:02}{}{:02}:{:02}",
self.year,
self.month,
self.day,
self.hour,
self.minute,
self.second,
if self.tz_before_gmt && (self.tz_hour > 0 || self.tz_minute > 0) {
"-"
} else {
"+"
},
self.tz_hour,
self.tz_minute
)
} else {
format!(
"{:04}-{:02}-{:02}T{:02}:{:02}:{:02}Z",
self.year, self.month, self.day, self.hour, self.minute, self.second,
)
}
}
/// 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 month = self.month as u32;
let year_base = 4800; /* Before min year, multiple of 400. */
let m_adj = month.wrapping_sub(3); /* March-based month. */
let carry = if m_adj > 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 {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.write_str(&self.to_iso8601())
fmt.write_str(&self.to_rfc3339())
}
}
pub fn parse_date(stream: &MessageStream, abort_on_invalid: bool) -> 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 = [
@@ -57,13 +127,18 @@ pub fn parse_date(stream: &MessageStream, abort_on_invalid: bool) -> Option<Date
let mut ignore = true;
let mut comment_count = 0;
while let Some(ch) = stream.next() {
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
let mut next_part = false;
stream.pos += 1;
match ch {
b'\n' => match stream.peek() {
b'\n' => match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
stream.advance(1);
iter.next();
stream.pos += 1;
if !is_new_token && !ignore && comment_count == 0 {
next_part = true;
} else {
@@ -78,7 +153,9 @@ pub fn parse_date(stream: &MessageStream, abort_on_invalid: bool) -> Option<Date
} else if *ch == b'(' {
comment_count += 1;
} else if *ch == b'\\' {
stream.skip_byte(&b')');
if let Some(b')') = stream.data.get(stream.pos) {
stream.pos += 1;
}
}
continue;
}
@@ -115,10 +192,9 @@ pub fn parse_date(stream: &MessageStream, abort_on_invalid: bool) -> Option<Date
b'a'..=b'z' | b'A'..=b'Z' => {
if pos == 1 {
if (1..=2).contains(&month_pos) {
month_hash += unsafe {
*MONTH_HASH
.get_unchecked((if *ch <= b'Z' { *ch + 32 } else { *ch }) as usize)
} as usize;
month_hash += MONTH_HASH
[(if *ch <= b'Z' { *ch + 32 } else { *ch }) as usize]
as usize;
}
month_pos += 1;
}
@@ -132,12 +208,7 @@ pub fn parse_date(stream: &MessageStream, abort_on_invalid: bool) -> Option<Date
continue;
}
b',' | b'\r' => (),
_ => {
if abort_on_invalid {
stream.rewind(1);
break;
}
}
_ => (),
}
if next_part {
@@ -150,27 +221,27 @@ pub fn parse_date(stream: &MessageStream, abort_on_invalid: bool) -> Option<Date
}
if pos >= 6 {
Some(DateTime {
HeaderValue::DateTime(DateTime {
year: if (1..=99).contains(&parts[2]) {
parts[2] + 1900
} else {
parts[2]
},
} as u16,
month: if month_pos == 3 && month_hash <= 30 {
(unsafe { *MONTH_MAP.get_unchecked(month_hash) }) as u32
MONTH_MAP[month_hash] as u8
} else {
parts[1]
parts[1] as u8
},
day: parts[0],
hour: parts[3],
minute: parts[4],
second: parts[5],
tz_hour: parts[6] / 100,
tz_minute: parts[6] % 100,
day: parts[0] as u8,
hour: parts[3] as u8,
minute: parts[4] as u8,
second: parts[5] as u8,
tz_hour: (parts[6] / 100) as u8,
tz_minute: (parts[6] % 100) as u8,
tz_before_gmt: !is_plus,
})
} else {
None
HeaderValue::Empty
}
}
@@ -188,13 +259,18 @@ static MONTH_HASH: &[u8] = &[
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
];
pub static MONTH_MAP: &[u8] = &[
pub static MONTH_MAP: &[u8; 31] = &[
5, 0, 0, 0, 10, 3, 0, 0, 0, 7, 1, 0, 0, 0, 12, 6, 0, 0, 0, 8, 4, 0, 0, 0, 2, 9, 0, 0, 0, 0, 11,
];
#[cfg(test)]
mod tests {
use crate::parsers::{fields::date::parse_date, message_stream::MessageStream};
use chrono::{FixedOffset, LocalResult, SecondsFormat, TimeZone, Utc};
use crate::{
parsers::{fields::date::parse_date, message::MessageStream},
HeaderValue,
};
#[test]
fn parse_dates() {
@@ -231,7 +307,7 @@ mod tests {
"Tue, 1 Jul 2003 ((tricky)\n comment) 10:52:37 +0200",
"2003-07-01T10:52:37+02:00",
),
("21 Nov 97 09:55:06 GMT", "1997-11-21T09:55:06+00:00"),
("21 Nov 97 09:55:06 GMT", "1997-11-21T09:55:06Z"),
(
"20 11 (some \n 44 comments(more comments\n )) 79 05:34:27 -0300",
"1979-11-20T05:34:27-03:00",
@@ -258,17 +334,50 @@ mod tests {
("13 zzz 2021 09:55:06 +0200", "2021-00-13T09:55:06+02:00"),
];
for input in inputs {
let mut str = input.0.to_string();
match parse_date(&MessageStream::new(unsafe { str.as_bytes_mut() }), false) {
Some(date) => {
//println!("{} -> {}", input.0.escape_debug(), date.to_iso8601());
assert_eq!(input.1, date.to_iso8601());
for (input, expected_result) in inputs {
match parse_date(&mut MessageStream::new(input.as_bytes())) {
HeaderValue::DateTime(datetime) => {
assert_eq!(expected_result, datetime.to_rfc3339());
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 as u32,
datetime.day as u32,
)
.and_hms_opt(
datetime.hour as u32,
datetime.minute as u32,
datetime.second as u32,
) {
assert_eq!(
chrono_datetime.timestamp(),
datetime.to_timestamp(),
"{} -> {} ({}) -> {} ({})",
input.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());
assert!(expected_result.is_empty());
}
_ => panic!("Unexpected result"),
}
}
}
+66 -33
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,25 +9,42 @@
* except according to those terms.
*/
use std::borrow::Cow;
use crate::{parsers::message::MessageStream, HeaderValue};
use crate::parsers::message_stream::MessageStream;
pub fn parse_id<'x>(stream: &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 is_token_safe = true;
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();
while let Some(ch) = stream.next() {
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => match stream.peek() {
b'\n' => match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
stream.advance(1);
iter.next();
stream.pos += 1;
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'<' => {
is_id_part = true;
@@ -36,38 +53,38 @@ pub fn parse_id<'x>(stream: &MessageStream<'x>) -> Option<Vec<Cow<'x, str>>> {
b'>' => {
is_id_part = false;
if token_start > 0 {
ids.push(
stream
.get_string(token_start - 1, token_end, is_token_safe)
.unwrap(),
);
is_token_safe = true;
ids.push(String::from_utf8_lossy(
&stream.data[token_start - 1..token_end],
));
token_start = 0;
} else {
continue;
}
}
b' ' | b'\t' | b'\r' => continue,
0..=0x7f => (),
_ => {
if is_token_safe {
is_token_safe = false;
}
}
_ => {}
}
if is_id_part {
if token_start == 0 {
token_start = stream.get_pos();
token_start = stream.pos;
}
token_end = stream.get_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, message_stream::MessageStream};
use crate::parsers::fields::id::parse_id;
use crate::parsers::message::MessageStream;
use crate::HeaderValue;
#[test]
fn parse_message_ids() {
@@ -100,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 mut str = input.0.to_string();
assert_eq!(
input.1,
parse_id(&MessageStream::new(unsafe { str.as_bytes_mut() })).unwrap(),
"Failed to parse '{:?}'",
input.0
);
let str = input.0.to_string();
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),
}
}
}
}
+41 -39
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,12 +11,11 @@
use std::borrow::Cow;
use crate::{decoders::encoded_word::parse_encoded_word, parsers::message_stream::MessageStream};
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, HeaderValue};
struct ListParser<'x> {
token_start: usize,
token_end: usize,
is_token_safe: bool,
is_token_start: bool,
tokens: Vec<Cow<'x, str>>,
list: Vec<Cow<'x, str>>,
@@ -27,22 +26,15 @@ fn add_token<'x>(parser: &mut ListParser<'x>, stream: &MessageStream<'x>, add_sp
if !parser.tokens.is_empty() {
parser.tokens.push(" ".into());
}
parser.tokens.push(
stream
.get_string(
parser.token_start - 1,
parser.token_end,
parser.is_token_safe,
)
.unwrap(),
);
parser.tokens.push(String::from_utf8_lossy(
&stream.data[parser.token_start - 1..parser.token_end],
));
if add_space {
parser.tokens.push(" ".into());
}
parser.token_start = 0;
parser.is_token_safe = true;
parser.is_token_start = true;
}
}
@@ -59,35 +51,39 @@ fn add_tokens_to_list(parser: &mut ListParser) {
}
}
pub fn parse_comma_separared<'x>(stream: &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,
is_token_safe: true,
is_token_start: true,
tokens: Vec::new(),
list: Vec::new(),
};
while let Some(ch) = stream.next() {
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => {
add_token(&mut parser, stream, false);
match stream.peek() {
match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
if !parser.is_token_start {
parser.is_token_start = true;
}
stream.advance(1);
iter.next();
stream.pos += 1;
continue;
}
_ => {
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),
};
}
}
@@ -99,9 +95,11 @@ pub fn parse_comma_separared<'x>(stream: &MessageStream<'x>) -> Option<Vec<Cow<'
continue;
}
b'=' if parser.is_token_start => {
if let Some(token) = parse_encoded_word(stream) {
if let (bytes_read, Some(token)) = decode_rfc2047(stream, stream.pos) {
add_token(&mut parser, stream, true);
parser.tokens.push(token);
parser.tokens.push(token.into());
stream.pos += bytes_read;
iter = stream.data[stream.pos..].iter();
continue;
}
}
@@ -111,12 +109,7 @@ pub fn parse_comma_separared<'x>(stream: &MessageStream<'x>) -> Option<Vec<Cow<'
continue;
}
b'\r' => continue,
0..=0x7f => (),
_ => {
if parser.is_token_safe {
parser.is_token_safe = false;
}
}
_ => (),
}
if parser.is_token_start {
@@ -124,18 +117,20 @@ pub fn parse_comma_separared<'x>(stream: &MessageStream<'x>) -> Option<Vec<Cow<'
}
if parser.token_start == 0 {
parser.token_start = stream.get_pos();
parser.token_start = stream.pos;
}
parser.token_end = stream.get_pos();
parser.token_end = stream.pos;
}
None
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
use crate::parsers::{fields::list::parse_comma_separared, message_stream::MessageStream};
use crate::parsers::fields::list::parse_comma_separared;
use crate::parsers::message::MessageStream;
use crate::HeaderValue;
#[test]
fn parse_comma_separated_text() {
@@ -177,11 +172,18 @@ mod tests {
];
for input in inputs {
let mut str = input.0.to_string();
assert_eq!(
parse_comma_separared(&MessageStream::new(unsafe { str.as_bytes_mut() }),).unwrap(),
input.1
);
let str = input.0.to_string();
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 -564
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,573 +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_stream::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: &MessageStream<'x>);
fn set_sender(&mut self, stream: &MessageStream<'x>);
fn set_received(&mut self, stream: &MessageStream<'x>);
fn set_references(&mut self, stream: &MessageStream<'x>);
fn set_cc(&mut self, stream: &MessageStream<'x>);
fn set_comments(&mut self, stream: &MessageStream<'x>);
fn set_resent_cc(&mut self, stream: &MessageStream<'x>);
fn set_content_id(&mut self, stream: &MessageStream<'x>);
fn set_resent_message_id(&mut self, stream: &MessageStream<'x>);
fn set_reply_to(&mut self, stream: &MessageStream<'x>);
fn set_resent_to(&mut self, stream: &MessageStream<'x>);
fn set_resent_bcc(&mut self, stream: &MessageStream<'x>);
fn set_subject(&mut self, stream: &MessageStream<'x>);
fn set_keywords(&mut self, stream: &MessageStream<'x>);
fn set_list_help(&mut self, stream: &MessageStream<'x>);
fn set_list_id(&mut self, stream: &MessageStream<'x>);
fn set_list_owner(&mut self, stream: &MessageStream<'x>);
fn set_resent_date(&mut self, stream: &MessageStream<'x>);
fn set_to(&mut self, stream: &MessageStream<'x>);
fn set_bcc(&mut self, stream: &MessageStream<'x>);
fn set_from(&mut self, stream: &MessageStream<'x>);
fn set_content_transfer_encoding(&mut self, stream: &MessageStream<'x>);
fn set_return_path(&mut self, stream: &MessageStream<'x>);
fn set_list_archive(&mut self, stream: &MessageStream<'x>);
fn set_resent_sender(&mut self, stream: &MessageStream<'x>);
fn set_list_subscribe(&mut self, stream: &MessageStream<'x>);
fn set_message_id(&mut self, stream: &MessageStream<'x>);
fn set_content_type(&mut self, stream: &MessageStream<'x>);
fn set_list_post(&mut self, stream: &MessageStream<'x>);
fn set_in_reply_to(&mut self, stream: &MessageStream<'x>);
fn set_content_description(&mut self, stream: &MessageStream<'x>);
fn set_resent_from(&mut self, stream: &MessageStream<'x>);
fn set_content_disposition(&mut self, stream: &MessageStream<'x>);
fn set_list_unsubscribe(&mut self, stream: &MessageStream<'x>);
fn set_mime_version(&mut self, stream: &MessageStream<'x>);
fn set_unsupported(&mut self, stream: &MessageStream<'x>, name: &'x [u8]);
}
impl<'x> FieldSet<'x> for MessageHeader<'x> {
fn set_date(&mut self, stream: &MessageStream<'x>) {
self.date = self::date::parse_date(stream, false);
}
fn set_sender(&mut self, stream: &MessageStream<'x>) {
self.sender = parse_address(stream);
}
fn set_received(&mut self, stream: &MessageStream<'x>) {
append_line(&mut self.received, parse_raw(stream));
}
fn set_references(&mut self, stream: &MessageStream<'x>) {
self.references = parse_id(stream);
}
fn set_cc(&mut self, stream: &MessageStream<'x>) {
self.cc = parse_address(stream);
}
fn set_comments(&mut self, stream: &MessageStream<'x>) {
append_line(&mut self.comments, parse_unstructured(stream));
}
fn set_resent_cc(&mut self, stream: &MessageStream<'x>) {
append_address_line(&mut self.resent_cc, parse_address(stream));
}
fn set_resent_message_id(&mut self, stream: &MessageStream<'x>) {
append_line_many(&mut self.resent_message_id, parse_id(stream));
}
fn set_reply_to(&mut self, stream: &MessageStream<'x>) {
self.reply_to = parse_address(stream);
}
fn set_resent_to(&mut self, stream: &MessageStream<'x>) {
append_address_line(&mut self.resent_to, parse_address(stream));
}
fn set_resent_bcc(&mut self, stream: &MessageStream<'x>) {
append_address_line(&mut self.resent_bcc, parse_address(stream));
}
fn set_subject(&mut self, stream: &MessageStream<'x>) {
self.subject = parse_unstructured(stream);
}
fn set_keywords(&mut self, stream: &MessageStream<'x>) {
append_line_many(&mut self.keywords, parse_comma_separared(stream));
}
fn set_list_help(&mut self, stream: &MessageStream<'x>) {
self.list_help = parse_address(stream);
}
fn set_list_id(&mut self, stream: &MessageStream<'x>) {
self.list_id = parse_address(stream);
}
fn set_list_owner(&mut self, stream: &MessageStream<'x>) {
self.list_owner = parse_address(stream);
}
fn set_resent_date(&mut self, stream: &MessageStream<'x>) {
append_date_line(&mut self.resent_date, self::date::parse_date(stream, false));
}
fn set_to(&mut self, stream: &MessageStream<'x>) {
self.to = parse_address(stream);
}
fn set_bcc(&mut self, stream: &MessageStream<'x>) {
self.bcc = parse_address(stream);
}
fn set_from(&mut self, stream: &MessageStream<'x>) {
self.from = parse_address(stream);
}
fn set_return_path(&mut self, stream: &MessageStream<'x>) {
append_line_many(&mut self.return_path, parse_id(stream));
}
fn set_list_archive(&mut self, stream: &MessageStream<'x>) {
self.list_archive = parse_address(stream);
}
fn set_resent_sender(&mut self, stream: &MessageStream<'x>) {
append_address_line(&mut self.resent_sender, parse_address(stream));
}
fn set_list_subscribe(&mut self, stream: &MessageStream<'x>) {
self.list_subscribe = parse_address(stream);
}
fn set_message_id(&mut self, stream: &MessageStream<'x>) {
self.message_id = parse_id(stream).map(|mut v| v.pop().unwrap());
}
fn set_list_post(&mut self, stream: &MessageStream<'x>) {
self.list_post = parse_address(stream);
}
fn set_in_reply_to(&mut self, stream: &MessageStream<'x>) {
self.reply_to = parse_address(stream);
}
fn set_resent_from(&mut self, stream: &MessageStream<'x>) {
append_address_line(&mut self.resent_from, parse_address(stream));
}
fn set_list_unsubscribe(&mut self, stream: &MessageStream<'x>) {
self.list_unsubscribe = parse_address(stream);
}
fn set_mime_version(&mut self, stream: &MessageStream<'x>) {
self.mime_version = parse_raw(stream);
}
fn set_unsupported(&mut self, stream: &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: &MessageStream<'x>) {
self.content_id = parse_id(stream).map(|mut v| v.pop().unwrap());
}
fn set_content_transfer_encoding(&mut self, stream: &MessageStream<'x>) {
self.content_transfer_encoding = parse_unstructured(stream);
}
fn set_content_type(&mut self, stream: &MessageStream<'x>) {
self.content_type = self::content_type::parse_content_type(stream);
}
fn set_content_description(&mut self, stream: &MessageStream<'x>) {
self.content_description = parse_unstructured(stream);
}
fn set_content_disposition(&mut self, stream: &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: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_sender(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_received(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_references(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_cc(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_comments(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_cc(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_message_id(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_reply_to(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_to(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_bcc(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_subject(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_keywords(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_help(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_id(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_owner(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_date(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_to(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_bcc(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_from(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_return_path(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_archive(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_sender(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_subscribe(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_message_id(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_post(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_in_reply_to(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_resent_from(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_list_unsubscribe(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_mime_version(&mut self, stream: &MessageStream<'x>) {
parse_and_ignore(stream);
}
fn set_unsupported(&mut self, stream: &MessageStream<'x>, _name: &'x [u8]) {
parse_and_ignore(stream);
}
fn set_content_id(&mut self, stream: &MessageStream<'x>) {
self.content_id = parse_id(stream).map(|mut v| v.pop().unwrap());
}
fn set_content_transfer_encoding(&mut self, stream: &MessageStream<'x>) {
self.content_transfer_encoding = parse_unstructured(stream);
}
fn set_content_type(&mut self, stream: &MessageStream<'x>) {
self.content_type = self::content_type::parse_content_type(stream);
}
fn set_content_description(&mut self, stream: &MessageStream<'x>) {
self.content_description = parse_unstructured(stream);
}
fn set_content_disposition(&mut self, stream: &MessageStream<'x>) {
self.content_disposition = self::content_type::parse_content_type(stream);
}
}
pub fn parse_date<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_date(stream);
}
pub fn parse_sender<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_sender(stream);
}
pub fn parse_received<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_received(stream);
}
pub fn parse_references<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_references(stream);
}
pub fn parse_cc<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_cc(stream);
}
pub fn parse_comments<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_comments(stream);
}
pub fn parse_resent_cc<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_resent_cc(stream);
}
pub fn parse_content_id<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_content_id(stream);
}
pub fn parse_resent_message_id<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_resent_message_id(stream);
}
pub fn parse_reply_to<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_reply_to(stream);
}
pub fn parse_resent_to<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_resent_to(stream);
}
pub fn parse_resent_bcc<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_resent_bcc(stream);
}
pub fn parse_subject<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_subject(stream);
}
pub fn parse_keywords<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_keywords(stream);
}
pub fn parse_list_help<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_list_help(stream);
}
pub fn parse_list_id<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_list_id(stream);
}
pub fn parse_list_owner<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_list_owner(stream);
}
pub fn parse_resent_date<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_resent_date(stream);
}
pub fn parse_to<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_to(stream);
}
pub fn parse_bcc<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_bcc(stream);
}
pub fn parse_from<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_from(stream);
}
pub fn parse_content_transfer_encoding<'x>(
header: &mut dyn MessageField<'x>,
stream: &MessageStream<'x>,
) {
header.set_content_transfer_encoding(stream);
}
pub fn parse_return_path<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_return_path(stream);
}
pub fn parse_list_archive<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_list_archive(stream);
}
pub fn parse_resent_sender<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_resent_sender(stream);
}
pub fn parse_list_subscribe<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_list_subscribe(stream);
}
pub fn parse_message_id<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_message_id(stream);
}
pub fn parse_content_type<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_content_type(stream);
}
pub fn parse_list_post<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_list_post(stream);
}
pub fn parse_in_reply_to<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_in_reply_to(stream);
}
pub fn parse_content_description<'x>(
header: &mut dyn MessageField<'x>,
stream: &MessageStream<'x>,
) {
header.set_content_description(stream);
}
pub fn parse_resent_from<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_resent_from(stream);
}
pub fn parse_content_disposition<'x>(
header: &mut dyn MessageField<'x>,
stream: &MessageStream<'x>,
) {
header.set_content_disposition(stream);
}
pub fn parse_list_unsubscribe<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) {
header.set_list_unsubscribe(stream);
}
pub fn parse_mime_version<'x>(header: &mut dyn MessageField<'x>, stream: &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: &MessageStream<'x>) {}
pub fn parse_unsupported<'x>(
header: &mut dyn MessageField<'x>,
stream: &MessageStream<'x>,
name: &'x [u8],
) {
header.set_unsupported(stream, name);
}
+67 -31
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,61 +9,61 @@
* except according to those terms.
*/
use std::borrow::Cow;
use crate::{parsers::message::MessageStream, HeaderValue};
use crate::parsers::message_stream::MessageStream;
pub fn parse_raw<'x>(stream: &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;
let mut is_token_safe = true;
while let Some(ch) = stream.next() {
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => match stream.peek() {
b'\n' => match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
stream.advance(1);
iter.next();
stream.pos += 1;
continue;
}
_ => {
return if token_start > 0 {
stream
.get_string(token_start - 1, token_end, is_token_safe)
.unwrap()
.into()
HeaderValue::Text(String::from_utf8_lossy(
&stream.data[token_start - 1..token_end],
))
} else {
None
HeaderValue::Empty
};
}
},
b' ' | b'\t' | b'\r' => continue,
0..=0x7f => (),
_ => {
if is_token_safe {
is_token_safe = false;
}
}
_ => (),
}
if token_start == 0 {
token_start = stream.get_pos();
token_start = stream.pos;
}
token_end = stream.get_pos();
token_end = stream.pos;
}
None
HeaderValue::Empty
}
pub fn parse_and_ignore(stream: &MessageStream) {
while let Some(ch) = stream.next() {
pub fn parse_and_ignore(stream: &mut MessageStream) {
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
if ch == &b'\n' {
match stream.peek() {
match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
stream.advance(1);
iter.next();
stream.pos += 1;
continue;
}
_ => return,
_ => break,
}
}
}
@@ -71,7 +71,9 @@ pub fn parse_and_ignore(stream: &MessageStream) {
#[cfg(test)]
mod tests {
use crate::parsers::{fields::raw::parse_raw, message_stream::MessageStream};
use crate::parsers::fields::raw::parse_raw;
use crate::parsers::message::MessageStream;
use crate::Message;
#[test]
fn parse_raw_text() {
@@ -93,13 +95,47 @@ mod tests {
];
for input in inputs {
let mut str = input.0.to_string();
let str = input.0.to_string();
assert_eq!(
parse_raw(&MessageStream::new(unsafe { str.as_bytes_mut() })).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_headers_raw();
assert_eq!(
iter.next().unwrap(),
("From", " Art Vandelay <art@vandelay.com>\n")
);
assert_eq!(iter.next().unwrap(), ("To", " jane@example.com\n"));
assert_eq!(
iter.next().unwrap(),
("Date", " Sat, 20 Nov 2021 14:22:01 -0800\n")
);
assert_eq!(
iter.next().unwrap(),
(
"Subject",
" Why not both importing AND exporting? =?utf-8?b?4pi6?=\n"
)
);
assert_eq!(
iter.next().unwrap(),
("Content-Type", " multipart/mixed; boundary=\"festivus\";\n")
);
}
}
+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);
}
}
}
+28 -38
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,11 +11,10 @@
use std::borrow::Cow;
use crate::{decoders::encoded_word::parse_encoded_word, parsers::message_stream::MessageStream};
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, HeaderValue};
struct UnstructuredParser<'x> {
token_start: usize,
token_end: usize,
is_token_safe: bool,
is_token_start: bool,
tokens: Vec<Cow<'x, str>>,
}
@@ -25,53 +24,49 @@ fn add_token<'x>(parser: &mut UnstructuredParser<'x>, stream: &MessageStream<'x>
if !parser.tokens.is_empty() {
parser.tokens.push(" ".into());
}
parser.tokens.push(
stream
.get_string(
parser.token_start - 1,
parser.token_end,
parser.is_token_safe,
)
.unwrap(),
);
parser.tokens.push(String::from_utf8_lossy(
&stream.data[parser.token_start - 1..parser.token_end],
));
if add_space {
parser.tokens.push(" ".into());
}
parser.token_start = 0;
parser.is_token_safe = true;
parser.is_token_start = true;
}
}
pub fn parse_unstructured<'x>(stream: &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,
is_token_safe: true,
is_token_start: true,
tokens: Vec::new(),
};
while let Some(ch) = stream.next() {
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => {
add_token(&mut parser, stream, false);
match stream.peek() {
match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
if !parser.is_token_start {
parser.is_token_start = true;
}
stream.advance(1);
iter.next();
stream.pos += 1;
continue;
}
_ => {
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()),
};
}
}
@@ -83,19 +78,16 @@ pub fn parse_unstructured<'x>(stream: &MessageStream<'x>) -> Option<Cow<'x, str>
continue;
}
b'=' if parser.is_token_start => {
if let Some(token) = parse_encoded_word(stream) {
if let (bytes_read, Some(token)) = decode_rfc2047(stream, stream.pos) {
add_token(&mut parser, stream, true);
parser.tokens.push(token);
parser.tokens.push(token.into());
stream.pos += bytes_read;
iter = stream.data[stream.pos..].iter();
continue;
}
}
b'\r' => continue,
0..=0x7f => (),
_ => {
if parser.is_token_safe {
parser.is_token_safe = false;
}
}
_ => (),
}
if parser.is_token_start {
@@ -103,23 +95,21 @@ pub fn parse_unstructured<'x>(stream: &MessageStream<'x>) -> Option<Cow<'x, str>
}
if parser.token_start == 0 {
parser.token_start = stream.get_pos();
parser.token_start = stream.pos;
}
parser.token_end = stream.get_pos();
parser.token_end = stream.pos;
}
None
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
#[test]
fn parse_unstructured_text() {
use crate::parsers::{
fields::unstructured::parse_unstructured, message_stream::MessageStream,
};
use crate::parsers::fields::unstructured::parse_unstructured;
use crate::parsers::message::MessageStream;
let inputs = [
("Saying Hello\n", "Saying Hello", true),
@@ -191,9 +181,9 @@ mod tests {
];
for input in inputs {
let mut str = input.0.to_string();
let str = input.0.to_string();
assert_eq!(
parse_unstructured(&MessageStream::new(unsafe { str.as_bytes_mut() }),).unwrap(),
parse_unstructured(&mut MessageStream::new(str.as_bytes()),).unwrap_text(),
input.1,
"Failed to parse '{:?}'",
input.0
+259 -201
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,311 +9,369 @@
* except according to those terms.
*/
use crate::{parsers::message_stream::MessageStream, MessageHeader, MimeHeader};
use std::borrow::Cow;
use super::fields::{parse_unsupported, MessageField};
use crate::{Header, HeaderName, HeaderValue, RfcHeader};
impl<'x> MessageHeader<'x> {
pub fn new() -> MessageHeader<'x> {
MessageHeader {
..Default::default()
}
}
}
use super::{
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> 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()
}
}
enum HeaderParserResult<'x> {
Supported(fn(&mut dyn MessageField<'x>, &MessageStream<'x>)),
Unsupported(&'x [u8]),
#[derive(Debug, PartialEq, Eq)]
pub enum HeaderParserResult<'x> {
Rfc(RfcHeader),
Other(Cow<'x, str>),
Lf,
Eof,
}
pub fn parse_headers<'x>(header: &mut dyn MessageField<'x>, stream: &MessageStream<'x>) -> bool {
pub fn parse_headers<'x>(headers: &mut Vec<Header<'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;
headers.push(Header {
name: HeaderName::Rfc(name),
value: parser(stream),
offset_start: from_offset,
offset_end: stream.pos,
});
}
HeaderParserResult::Other(name) => {
let from_offset = stream.pos;
parse_and_ignore(stream);
headers.push(Header {
name: HeaderName::Other(name),
value: HeaderValue::Text(String::from_utf8_lossy(
&stream.data[from_offset..stream.pos],
)),
offset_start: from_offset,
offset_end: stream.pos,
});
}
HeaderParserResult::Lf => return true,
HeaderParserResult::Eof => return false,
}
}
}
fn parse_header_name<'x>(stream: &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 data.iter() {
bytes_read += 1;
while let Some(ch) = stream.next() {
match ch {
b':' => {
if token_start != 0 {
let field = stream.get_bytes(token_start - 1, token_end).unwrap();
if (2..=25).contains(&token_len) {
token_hash += token_len
+ unsafe {
*HDR_HASH.get_unchecked(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(unsafe {
HDR_NAMES.get_unchecked(token_hash)
}) {
return HeaderParserResult::Supported(unsafe {
*HDR_FNCS.get_unchecked(token_hash)
});
}
}
}
return HeaderParserResult::Unsupported(field);
break;
}
}
b'\n' => {
stream.rewind(1);
return HeaderParserResult::Lf;
return (bytes_read - 1, HeaderParserResult::Lf);
}
_ => {
if !(*ch).is_ascii_whitespace() {
if token_start == 0 {
token_start = stream.get_pos();
token_start = bytes_read;
token_end = token_start;
} else {
token_end = stream.get_pos();
token_end = bytes_read;
last_ch = *ch;
}
if let 0 | 9 = token_len {
token_hash +=
unsafe { *HDR_HASH.get_unchecked((*ch).to_ascii_lowercase() as usize) }
as usize;
token_hash += HDR_HASH[(*ch).to_ascii_lowercase() as usize] as usize;
}
token_len += 1;
}
}
}
}
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_stream::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 mut str = input.0.to_string();
match parse_header_name(&MessageStream::new(unsafe { str.as_bytes_mut() })) {
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 str = input.0.to_string();
let (_, result) = parse_header_name(str.as_bytes());
assert_eq!(input.1, result, "Failed to parse '{:?}'", input.0);
}
}
}
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,
#[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_FNCS: &[for<'x, 'y> fn(&mut dyn MessageField<'x>, &MessageStream<'x>)] = &[
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_HASH: &[u8] = &[
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_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]] = &[
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",
];
+407 -318
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,16 +13,17 @@ use std::borrow::Cow;
use crate::{
decoders::{
base64::Base64Decoder,
charsets::map::{decoder_default, get_charset_decoder},
html::{html_to_text, text_to_html},
quoted_printable::QuotedPrintableDecoder,
base64::decode_base64, charsets::map::get_charset_decoder,
quoted_printable::decode_quoted_printable, DecodeFnc, DecodeResult,
},
MessagePart, BinaryPart, InlinePart, ContentType, Message, MessageHeader, MimeHeader,
TextPart,
ContentType, Encoding, GetHeader, HeaderValue, Message, MessageAttachment, MessagePart,
MessagePartId, PartType, RfcHeader,
};
use super::{fields::MessageField, header::parse_headers, message_stream::MessageStream};
use super::{
header::parse_headers,
mime::{get_bytes_to_boundary, seek_crlf, seek_next_part, skip_crlf, skip_multipart_end},
};
#[derive(Debug, PartialEq)]
enum MimeType {
@@ -38,24 +39,41 @@ enum MimeType {
Other,
}
#[inline(always)]
fn bytes_to_string<'x>(
bytes: &'x [u8],
content_type: Option<&ContentType>,
is_utf8_safe: bool,
) -> Cow<'x, str> {
if let Some(content_type) = content_type {
if let Some(charset) = content_type.get_attribute("charset") {
if let Some(decoder_fnc) = get_charset_decoder(charset.as_bytes()) {
return decoder_fnc(bytes);
}
}
impl Default for MimeType {
fn default() -> Self {
MimeType::Message
}
}
if !is_utf8_safe {
decoder_default(bytes)
} else {
(unsafe { std::str::from_utf8_unchecked(bytes) }).into()
fn result_to_string<'x>(
result: DecodeResult,
data: &'x [u8],
content_type: Option<&ContentType>,
) -> Cow<'x, str> {
match (
result,
content_type.and_then(|ct| {
ct.get_attribute("charset")
.and_then(|c| get_charset_decoder(c.as_bytes()))
}),
) {
(DecodeResult::Owned(vec), Some(charset_decoder)) => charset_decoder(&vec).into(),
(DecodeResult::Owned(vec), None) => String::from_utf8(vec)
.unwrap_or_else(|e| String::from_utf8_lossy(e.as_bytes()).into_owned())
.into(),
(DecodeResult::Borrowed((from, to)), Some(charset_decoder)) => {
charset_decoder(&data[from..to]).into()
}
(DecodeResult::Borrowed((from, to)), None) => String::from_utf8_lossy(&data[from..to]),
(DecodeResult::Empty, _) => "\n".to_string().into(),
}
}
fn result_to_bytes(result: DecodeResult, data: &[u8]) -> Cow<[u8]> {
match result {
DecodeResult::Owned(vec) => Cow::Owned(vec),
DecodeResult::Borrowed((from, to)) => Cow::Borrowed(&data[from..to]),
DecodeResult::Empty => Cow::from(vec![b'?']),
}
}
@@ -84,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),
@@ -96,6 +114,25 @@ fn get_mime_type(
}
}
/*#[inline(always)]
fn add_missing_type<'x>(
headers: &mut Vec<Header<'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>>,
@@ -105,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 {
@@ -118,279 +160,371 @@ impl MessageParserState {
text_parts: 0,
need_text_body: true,
need_html_body: true,
..Default::default()
}
}
}
pub struct MessageStream<'x> {
pub data: &'x [u8],
pub pos: usize,
}
impl<'x> MessageStream<'x> {
pub fn new(data: &'x [u8]) -> MessageStream<'x> {
MessageStream { data, pos: 0 }
}
}
impl<'x> Message<'x> {
fn new() -> Message<'x> {
Message {
header: Box::new(MessageHeader::new()),
..Default::default()
}
}
/// Parses a byte slice containing the RFC5322 raw message and returns a
/// Returns `false` if at least one header field was successfully parsed.
pub fn is_empty(&self) -> bool {
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.
///
/// Note: The `parse()` function requires a mutable `[u8]` as input in order
/// to perform BASE64/Quoted-Printable decoding in-place.
///
pub fn parse(bytes: &'x mut [u8]) -> Message<'x> {
let stream = MessageStream::new(bytes);
/// if no headers are found None is returned.
///
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_headers = Vec::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, &stream) {
state.offset_header = stream.pos;
if !parse_headers(&mut part_headers, &mut stream) {
break;
}
state.parts += 1;
state.sub_part_ids.push(message.parts.len());
let content_type = part_headers
.get_rfc(&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();
let mime_boundary = format!("--{}", mime_boundary).into_bytes();
state.offset_body = seek_crlf(&stream, stream.pos);
if stream.seek_next_part(mime_boundary.as_ref()) {
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: std::mem::take(&mut part_headers),
offset_header: state.offset_header,
offset_body: state.offset_body,
offset_end: 0,
is_encoding_problem: false,
encoding: Encoding::None,
body: PartType::default(),
});
state_stack.push((state, None));
state = new_state;
stream.skip_crlf();
skip_crlf(&mut stream);
continue;
} else {
mime_type = MimeType::TextOther;
is_text = true;
}
}
} else if mime_type == MimeType::Message {
}
skip_crlf(&mut stream);
state.offset_body = stream.pos;
let (is_binary, mut encoding, decode_fnc): (bool, Encoding, DecodeFnc) =
match part_headers.get_rfc(&RfcHeader::ContentTransferEncoding) {
Some(HeaderValue::Text(encoding))
if encoding.eq_ignore_ascii_case("base64") =>
{
(false, Encoding::Base64, decode_base64)
}
Some(HeaderValue::Text(encoding))
if encoding.eq_ignore_ascii_case("quoted-printable") =>
{
(false, Encoding::QuotedPrintable, decode_quoted_printable)
}
_ => (true, Encoding::None, 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(),
in_alternative: false,
parts: 0,
html_parts: 0,
text_parts: 0,
need_html_body: true,
need_text_body: true,
part_id: message.parts.len(),
..Default::default()
};
mime_part_header.clear();
message_stack.push(message);
state_stack.push(state);
message.attachments.push(message.parts.len());
message.parts.push(MessagePart {
headers: std::mem::take(&mut part_headers),
encoding,
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;
stream.skip_crlf();
continue;
}
stream.skip_crlf();
let (success, mut is_utf8_safe, mut bytes) = match header
.get_content_transfer_encoding()
{
Some(encoding) if encoding.eq_ignore_ascii_case("base64") => stream.decode_base64(
state
.mime_boundary
.as_ref()
.map_or_else(|| &[][..], |b| &b[..]),
false,
),
Some(encoding) if encoding.eq_ignore_ascii_case("quoted-printable") => stream
.decode_quoted_printable(
state
.mime_boundary
.as_ref()
.map_or_else(|| &[][..], |b| &b[..]),
false,
),
_ => stream.get_bytes_to_boundary(
state
.mime_boundary
.as_ref()
.map_or_else(|| &[][..], |b| &b[..]),
),
};
let (bytes_read, mut bytes) = decode_fnc(
&stream,
stream.pos,
state
.mime_boundary
.as_ref()
.map_or_else(|| &[][..], |b| &b[..]),
false,
);
// Attempt to recover contents of an invalid message
if !success {
if !stream.is_eof() {
let is_encoding_problem = bytes_read == 0;
if is_encoding_problem {
encoding = Encoding::None;
let did_recover = if !(stream.pos >= stream.data.len()
|| (is_binary && state.mime_boundary.is_none()))
{
// Get raw MIME part
let (success, r_is_utf8_safe, r_bytes) = stream.get_bytes_to_boundary(
state
.mime_boundary
.as_ref()
.map_or_else(|| &[][..], |b| &b[..]),
);
if !success {
// If there is MIME boundary, ignore it and get raw message
if !stream.is_eof() && state.mime_boundary.is_some() {
let (_, r_is_utf8_safe, r_bytes) =
stream.get_bytes_to_boundary(&[][..]);
if r_bytes.is_some() {
is_utf8_safe = r_is_utf8_safe;
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 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;
state.mime_boundary = None;
true
} else {
break;
false
}
} else {
break;
false
}
} else {
is_utf8_safe = r_is_utf8_safe;
bytes = r_bytes;
stream.pos += bytes_read;
true
}
} else {
false
};
if did_recover {
mime_type = MimeType::TextOther;
is_inline = false;
is_text = true;
} else if bytes.is_none() {
} else {
// Could not recover error, add part and abort
message.parts.push(MessagePart {
headers: std::mem::take(&mut part_headers),
encoding: Encoding::None,
is_encoding_problem: true,
body: PartType::Binary((&[][..]).into()),
offset_header: state.offset_header,
offset_body: state.offset_body,
offset_end: stream.pos,
});
break;
}
} else {
stream.pos += bytes_read;
}
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")))));
// Obtain offset end
state.offset_end = if let Some(mime_boundary) = &state.mime_boundary {
let pos = stream.pos.saturating_sub(mime_boundary.len());
std::cmp::max(
stream.data.get(pos - 2).map_or(pos - 1, |&ch| {
if ch == b'\r' {
pos - 2
} else {
pos - 1
}
}),
state.offset_body,
)
} else {
stream.pos
};
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 body_part = if mime_type != MimeType::Message {
let is_inline = is_inline
&& part_headers
.get_rfc(&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),
}
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;
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)
message.attachments.push(message.parts.len());
PartType::Message(MessageAttachment::Raw(result_to_bytes(bytes, stream.data)))
};
if is_text {
let text_part = TextPart {
contents: bytes_to_string(
bytes.map_or_else(|| "\n".as_bytes(), |v| v),
header.get_content_type(),
is_utf8_safe,
),
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: bytes.map_or_else(|| "?".as_bytes(), |v| v).into(),
};
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: std::mem::take(&mut part_headers),
encoding,
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| {
let pos = stream.pos.saturating_sub(b.len());
stream.data.get(pos - 2).map_or(pos - 1, |&ch| {
if ch == b'\r' {
pos - 2
} else {
pos - 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;
@@ -400,7 +534,7 @@ impl<'x> Message<'x> {
}
}
if stream.skip_multipart_end() {
if skip_multipart_end(&mut stream) {
// End of MIME part reached
if MimeType::MultipartAlernative == state.mime_type
@@ -411,16 +545,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);
}
}
@@ -428,53 +554,79 @@ 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;
if let Some(ref mime_boundary) = state.mime_boundary {
// Ancestor has a MIME boundary, seek it.
if stream.seek_next_part(mime_boundary) {
if seek_next_part(&mut stream, mime_boundary) {
continue 'inner;
}
}
}
break 'outer;
} else {
stream.skip_crlf();
skip_crlf(&mut stream);
// Headers of next part expected next, break inner look.
break 'inner;
}
}
} else if stream.is_eof() {
} else if stream.pos >= stream.data.len() {
break 'outer;
}
}
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() {
message.parts[0].offset_end = message.raw_message.len();
Some(message)
} else {
None
}
}
}
#[cfg(test)]
mod tests {
use std::{fs, path::PathBuf};
@@ -483,8 +635,6 @@ mod tests {
#[test]
fn parse_full_messages() {
const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----\n".as_bytes();
for test_suite in ["rfc", "legacy", "thirdparty", "malformed"] {
let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
test_dir.push("tests");
@@ -493,36 +643,25 @@ mod tests {
let mut tests_run = 0;
for file_name in fs::read_dir(&test_dir).unwrap() {
let file_name = file_name.as_ref().unwrap().path();
if file_name.extension().map_or(false, |e| e == "txt") {
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 mut file_name = file_name.unwrap().path();
if file_name.extension().map_or(false, |e| e == "eml") {
let raw_message = fs::read(&file_name).unwrap();
file_name.set_extension("json");
let expected_result = fs::read(&file_name).unwrap();
tests_run += 1;
let input = input.split_at_mut(pos);
let message = Message::parse(input.0);
let message = 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(),
"Test failed for '{}', result was:\n{}",
file_name.display(),
serde_json::to_string_pretty(&message).unwrap()
);
if json_message.as_bytes() != expected_result {
file_name.set_extension("failed");
fs::write(&file_name, json_message.as_bytes()).unwrap();
panic!(
"Test failed, parsed message saved to {}",
file_name.display()
);
}
}
}
@@ -533,54 +672,4 @@ mod tests {
);
}
}
/*#[test]
fn generate_test_samples() {
const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----\n".as_bytes();
for test_suite in ["malformed" /*"legacy","malformed"*/] {
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
.as_ref()
.unwrap()
.path()
.to_str()
.unwrap()
.contains("001")
{
continue;
}*/
let mut input = fs::read(file_name.as_ref().unwrap().path()).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.");
let input = input.split_at_mut(pos);
/*println!(
"{}",
serde_json::to_string_pretty(&Message::parse(input.0)).unwrap()
);*/
let mut output = Vec::new();
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(),
);
fs::write(file_name.as_ref().unwrap().path(), &output).unwrap();
}
}
}*/
}
-254
View File
@@ -1,254 +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 std::{borrow::Cow, cell::UnsafeCell};
pub struct MessageStream<'x> {
pub data: UnsafeCell<&'x mut [u8]>,
pub pos: UnsafeCell<usize>,
}
impl<'x> MessageStream<'x> {
pub fn new(data: &'x mut [u8]) -> MessageStream<'x> {
MessageStream {
data: data.into(),
pos: 0.into(),
}
}
#[inline(always)]
pub fn get_bytes(&self, from: usize, to: usize) -> Option<&'x [u8]> {
unsafe { (*self.data.get()).get(from..to) }
}
pub fn get_string(&self, from: usize, to: usize, utf8_valid: bool) -> Option<Cow<'x, str>> {
unsafe {
if utf8_valid {
Cow::from(std::str::from_utf8_unchecked(
(*self.data.get()).get(from..to)?,
))
.into()
} else {
String::from_utf8_lossy((*self.data.get()).get(from..to)?).into()
}
}
}
#[inline(always)]
pub fn is_eof(&self) -> bool {
unsafe { *self.pos.get() >= (*self.data.get()).len() }
}
#[inline(always)]
pub fn set_pos(&self, pos: usize) {
unsafe {
*self.pos.get() = pos;
}
}
#[inline(always)]
pub fn get_pos(&self) -> usize {
unsafe { *self.pos.get() }
}
#[inline(always)]
pub fn next(&self) -> Option<&'x u8> {
unsafe {
let pos = &mut *self.pos.get();
let data = &mut *self.data.get();
if *pos < data.len() {
let result = data.get_unchecked(*pos);
*pos += 1;
Some(result)
} else {
None
}
}
}
#[inline(always)]
pub fn peek(&self) -> Option<&'x u8> {
unsafe { (*self.data.get()).get(*self.pos.get()) }
}
#[inline(always)]
pub fn advance(&self, pos: usize) {
unsafe {
*self.pos.get() += pos;
}
}
pub fn seek_next_part(&self, boundary: &[u8]) -> bool {
if !boundary.is_empty() {
unsafe {
let cur_pos = &mut *self.pos.get();
let data = &mut *self.data.get();
let mut pos = *cur_pos;
let mut match_count = 0;
for ch in (*data)[*cur_pos..].iter() {
pos += 1;
if ch == boundary.get_unchecked(match_count) {
match_count += 1;
if match_count == boundary.len() {
*cur_pos = pos;
return true;
} else {
continue;
}
} else if match_count > 0 {
if ch == boundary.get_unchecked(0) {
match_count = 1;
continue;
} else {
match_count = 0;
}
}
}
}
}
false
}
pub fn get_bytes_to_boundary(&self, boundary: &[u8]) -> (bool, bool, Option<&'x [u8]>) {
unsafe {
let mut data = &mut *self.data.get();
let stream_pos = &mut *self.pos.get();
let start_pos = *stream_pos;
return if !boundary.is_empty() {
let mut pos = *stream_pos;
let mut match_count = 0;
let mut is_utf8_safe = true;
for ch in (*data)[pos..].iter() {
pos += 1;
if is_utf8_safe && *ch > 0x7f {
is_utf8_safe = false;
}
if ch == boundary.get_unchecked(match_count) {
match_count += 1;
if match_count == boundary.len() {
let is_boundary_end = self.is_boundary_end(pos);
data = &mut *self.data.get(); // Avoid violating the Stacked Borrows rules
if is_boundary_end {
let match_pos = pos - match_count;
*stream_pos = pos;
return (
true,
is_utf8_safe,
if start_pos < match_pos {
(*data).get(start_pos..match_pos)
} else {
None
},
);
} else {
match_count = 0;
}
}
continue;
} else if match_count > 0 {
if ch == boundary.get_unchecked(0) {
match_count = 1;
continue;
} else {
match_count = 0;
}
}
}
(false, false, None)
} else if *stream_pos < (*data).len() {
*stream_pos = (*data).len();
(true, false, (*data).get(start_pos..))
} else {
(false, false, None)
};
}
}
#[inline(always)]
pub fn skip_crlf(&self) {
unsafe {
let cur_pos = &mut *self.pos.get();
let data = &mut *self.data.get();
let mut pos = *cur_pos;
for ch in (*data)[*cur_pos..].iter() {
match ch {
b'\r' | b' ' | b'\t' => pos += 1,
b'\n' => {
*cur_pos = pos + 1;
break;
}
_ => break,
}
}
}
}
#[inline(always)]
pub fn skip_byte(&self, ch: &u8) -> bool {
unsafe {
let pos = &mut *self.pos.get();
let data = &mut *self.data.get();
if (*data).get(*pos) == Some(ch) {
*pos += 1;
true
} else {
false
}
}
}
#[inline(always)]
pub fn is_boundary_end(&self, pos: usize) -> bool {
matches!(
unsafe { (*self.data.get()).get(pos..) },
Some([b'\n' | b'\r' | b' ' | b'\t', ..]) | Some([b'-', b'-', ..]) | Some([]) | None
)
}
pub fn skip_multipart_end(&self) -> bool {
unsafe {
let pos = &mut *self.pos.get();
match (*self.data.get()).get(*pos..*pos + 2) {
Some(b"--") => {
if let Some(byte) = (*self.data.get()).get(*pos + 2) {
if !(*byte).is_ascii_whitespace() {
return false;
}
}
*pos += 2;
true
}
_ => false,
}
}
}
pub fn rewind(&self, r: usize) {
unsafe {
*self.pos.get() -= r;
}
}
}
+168
View File
@@ -0,0 +1,168 @@
/*
* 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 crate::decoders::DecodeResult;
use super::message::MessageStream;
pub(crate) fn seek_next_part(stream: &mut MessageStream, boundary: &[u8]) -> bool {
if !boundary.is_empty() {
let mut pos = stream.pos;
let mut match_count = 0;
for ch in &stream.data[pos..] {
pos += 1;
if ch == &boundary[match_count] {
match_count += 1;
if match_count == boundary.len() {
stream.pos = pos;
return true;
} else {
continue;
}
} else if match_count > 0 {
if ch == &boundary[0] {
match_count = 1;
continue;
} else {
match_count = 0;
}
}
}
}
false
}
pub(crate) fn get_bytes_to_boundary<'x>(
stream: &MessageStream<'x>,
start_pos: usize,
boundary: &[u8],
_is_word: bool,
) -> (usize, DecodeResult) {
let mut read_pos = start_pos;
if !boundary.is_empty() {
let mut match_count = 0;
let mut cr_pos = 0;
let mut lf_pos = 0;
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 mut match_pos = read_pos - match_count;
if match_pos > 0 && match_pos == lf_pos {
if lf_pos == cr_pos + 1 {
match_pos -= 2;
} else {
match_pos -= 1;
}
}
return (
read_pos - start_pos,
if start_pos < match_pos {
DecodeResult::Borrowed((start_pos, match_pos))
} else {
DecodeResult::Empty
},
);
} else {
match_count = 0;
}
}
continue;
} else if match_count > 0 {
if ch == &boundary[0] {
match_count = 1;
continue;
} else {
match_count = 0;
}
}
if ch == &b'\r' {
cr_pos = read_pos;
} else if ch == &b'\n' {
lf_pos = read_pos;
}
}
(0, DecodeResult::Empty)
} else if start_pos < stream.data.len() {
(
stream.data.len() - start_pos,
DecodeResult::Borrowed((start_pos, stream.data.len())),
)
} else {
(0, DecodeResult::Empty)
}
}
#[inline(always)]
pub(crate) fn is_boundary_end(stream: &MessageStream, pos: usize) -> bool {
matches!(
stream.data.get(pos..),
Some([b'\n' | b'\r' | b' ' | b'\t', ..]) | Some([b'-', b'-', ..]) | Some([]) | None
)
}
pub(crate) fn skip_multipart_end(stream: &mut MessageStream) -> bool {
match stream.data.get(stream.pos..stream.pos + 2) {
Some(b"--") => {
if let Some(byte) = stream.data.get(stream.pos + 2) {
if !(*byte).is_ascii_whitespace() {
return false;
}
}
stream.pos += 2;
true
}
_ => false,
}
}
#[inline(always)]
pub(crate) fn skip_crlf(stream: &mut MessageStream) {
for ch in &stream.data[stream.pos..] {
match ch {
b'\r' | b' ' | b'\t' => stream.pos += 1,
b'\n' => {
stream.pos += 1;
break;
}
_ => break,
}
}
}
#[inline(always)]
pub(crate) 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 -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
@@ -12,4 +12,5 @@
pub mod fields;
pub mod header;
pub mod message;
pub mod message_stream;
pub mod mime;
pub mod preview;
+186
View File
@@ -0,0 +1,186 @@
/*
* 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>, mut max_len: usize) -> Cow<'x, str> {
if text.len() > max_len {
let add_dots = max_len > 6;
if add_dots {
max_len -= 3;
}
let mut result = String::with_capacity(max_len);
for ch in text.chars() {
if ch.len_utf8() + result.len() > max_len {
break;
}
result.push(ch);
}
if add_dots {
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>, mut max_len: usize) -> Cow<'x, str> {
if html.len() > max_len {
let add_dots = max_len > 6;
if add_dots {
max_len -= 3;
}
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 > 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
}],
);
if add_dots {
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);
}
}
}
+84 -87
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,135 +13,132 @@ use mail_parser::*;
#[test]
fn test_api() {
let mut 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()
.to_vec();
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(&mut 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::<Vec<Header>>(
&bincode::serialize(&message.parts[0].headers).unwrap()
)
.unwrap(),
message.parts[0].headers
);
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"),
]
}
)
])
);
assert_eq!(
message.get_date().unwrap().to_iso8601(),
message.get_date().unwrap().to_rfc3339(),
"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());
}
+43
View File
@@ -0,0 +1,43 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:35:05 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGKEKECHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: image/png;
name="redball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="redball.png"
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
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
+188 -107
View File
@@ -1,112 +1,190 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:35:05 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGKEKECHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: image/png;
name="redball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="redball.png"
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
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
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)"
]
}
},
"html_body": [],
"text_body": [],
"attachments": [
0
],
"parts": [
{
"Binary": {
"contents": [
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"offset_start": 43,
"offset_end": 76
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Microsoft Outlook 00"
},
"offset_start": 84,
"offset_end": 125
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 35,
"second": 5,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 130,
"offset_end": 164
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGKEKECHAA.doug@example.com"
},
"offset_start": 175,
"offset_end": 225
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 238,
"offset_end": 244
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"redball.png"
]
]
}
},
"offset_start": 257,
"offset_end": 291
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 317,
"offset_end": 326
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"redball.png"
]
]
}
},
"offset_start": 346,
"offset_end": 385
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_start": 396,
"offset_end": 409
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 427,
"offset_end": 436
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_start": 445,
"offset_end": 498
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 509,
"offset_end": 518
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_start": 528,
"offset_end": 576
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1561,7 +1639,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 0,
"offset_body": 578,
"offset_end": 2570
}
]
}
+34
View File
@@ -0,0 +1,34 @@
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
+183
View File
@@ -0,0 +1,183 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_start": 5,
"offset_end": 39
},
{
"name": {
"Rfc": "to"
},
"value": {
"AddressList": [
{
"name": "Joe Blow",
"address": "jblow@example.com"
},
{
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
]
},
"offset_start": 42,
"offset_end": 146
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_start": 154,
"offset_end": 224
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 18,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 229,
"offset_end": 262
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com"
},
"offset_start": 273,
"offset_end": 322
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 335,
"offset_end": 340
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"utf-7"
]
]
}
},
"offset_start": 353,
"offset_end": 383
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 409,
"offset_end": 427
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\n"
},
"offset_start": 438,
"offset_end": 450
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\n"
},
"offset_start": 468,
"offset_end": 476
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\n"
},
"offset_start": 485,
"offset_end": 537
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\n"
},
"offset_start": 548,
"offset_end": 556
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\n"
},
"offset_start": 566,
"offset_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
}
]
}
-107
View File
@@ -1,107 +0,0 @@
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
---- 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)"
]
}
},
"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>"
}
],
"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"
}
]
}
+36
View File
@@ -0,0 +1,36 @@
Message-Id: <4.2.0.58.20000519003052.00a89c40@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 2 (High)
Date: Fri, 19 May 2000 00:31:00 -0400
To: Heinz =?iso-8859-1?Q?M=FCller?= <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?=
Mime-Version: 1.0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<font face=3D"Arial, Helvetica" size=3D5 color=3D"#0000FF"><b>Die Hasen und =
die
Fr=F6sche<br>
<br>
</font></b><font face=3D"Arial, Helvetica">Die Hasen klagten einst =FCber
ihre mi=DFliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in
steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,
ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der Tod selbst.
Auf, la=DFt uns ein f=FCr allemal sterben.&quot; <br>
<br>
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie au=
fs
schnellste untertauchten. <br>
<br>
&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das
Ers=E4ufen noch ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr
seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als
wir.&quot; <br>
<br>
</font></html>
+157
View File
@@ -0,0 +1,157 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519003052.00a89c40@pop.example.com"
},
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 2 (High)\r\n"
},
"offset_start": 181,
"offset_end": 192
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 31,
"second": 0,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 197,
"offset_end": 231
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_start": 234,
"offset_end": 290
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_start": 295,
"offset_end": 332
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_start": 340,
"offset_end": 387
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 400,
"offset_end": 406
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 419,
"offset_end": 453
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 479,
"offset_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
}
]
}
-97
View File
@@ -1,97 +0,0 @@
Message-Id: <4.2.0.58.20000519003052.00a89c40@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 2 (High)
Date: Fri, 19 May 2000 00:31:00 -0400
To: Heinz =?iso-8859-1?Q?M=FCller?= <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?=
Mime-Version: 1.0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<font face=3D"Arial, Helvetica" size=3D5 color=3D"#0000FF"><b>Die Hasen und =
die
Fr=F6sche<br>
<br>
</font></b><font face=3D"Arial, Helvetica">Die Hasen klagten einst =FCber
ihre mi=DFliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in
steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,
ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der Tod selbst.
Auf, la=DFt uns ein f=FCr allemal sterben.&quot; <br>
<br>
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie au=
fs
schnellste untertauchten. <br>
<br>
&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das
Ers=E4ufen noch ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr
seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als
wir.&quot; <br>
<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)"
]
}
},
"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"
}
],
"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"
}
]
}
+63
View File
@@ -0,0 +1,63 @@
Message-Id: <4.2.0.58.20000519002557.00a88870@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 2 (High)
Date: Fri, 19 May 2000 00:29:55 -0400
To: Heinz =?iso-8859-1?Q?M=FCller?= <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?=
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="=====================_714967308==_.ALT"
--=====================_714967308==_.ALT
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =E4rger als der=
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch 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
--=====================_714967308==_.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<font face=3D"Arial, Helvetica" size=3D5 color=3D"#0000FF"><b>Die Hasen und =
die
Fr=F6sche<br>
<br>
</font></b><font face=3D"Arial, Helvetica">Die Hasen klagten einst =FCber
ihre mi=DFliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in
steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,
ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der Tod selbst.
Auf, la=DFt uns ein f=FCr allemal sterben.&quot; <br>
<br>
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie au=
fs
schnellste untertauchten. <br>
<br>
&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das
Ers=E4ufen noch ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr
seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als
wir.&quot; <br>
<br>
</font></html>
--=====================_714967308==_.ALT--
+230
View File
@@ -0,0 +1,230 @@
{
"html_body": [
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519002557.00a88870@pop.example.com"
},
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 2 (High)\r\n"
},
"offset_start": 181,
"offset_end": 192
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 29,
"second": 55,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 197,
"offset_end": 231
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_start": 234,
"offset_end": 290
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_start": 295,
"offset_end": 332
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_start": 340,
"offset_end": 387
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 400,
"offset_end": 406
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"=====================_714967308==_.ALT"
]
]
}
},
"offset_start": 419,
"offset_end": 496
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 498,
"offset_end": 2627
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 553,
"offset_end": 588
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 614,
"offset_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": 1444
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 1501,
"offset_end": 1535
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 1561,
"offset_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": 2579
}
]
}
-143
View File
@@ -1,143 +0,0 @@
Message-Id: <4.2.0.58.20000519002557.00a88870@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 2 (High)
Date: Fri, 19 May 2000 00:29:55 -0400
To: Heinz =?iso-8859-1?Q?M=FCller?= <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?=
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="=====================_714967308==_.ALT"
--=====================_714967308==_.ALT
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =E4rger als der=
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch 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
--=====================_714967308==_.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<font face=3D"Arial, Helvetica" size=3D5 color=3D"#0000FF"><b>Die Hasen und =
die
Fr=F6sche<br>
<br>
</font></b><font face=3D"Arial, Helvetica">Die Hasen klagten einst =FCber
ihre mi=DFliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in
steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,
ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der Tod selbst.
Auf, la=DFt uns ein f=FCr allemal sterben.&quot; <br>
<br>
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie au=
fs
schnellste untertauchten. <br>
<br>
&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das
Ers=E4ufen noch ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr
seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als
wir.&quot; <br>
<br>
</font></html>
--=====================_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"
]
}
},
"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"
}
],
"text_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"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"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
Message-Id: <4.2.0.58.20000519011207.00a8cd70@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 5 (Lowest)
Date: Fri, 19 May 2000 01:13:19 -0400
To: Joe Blow <blow@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: The Hare and the Tortoise
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
The Hare and the Tortoise
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.
Slow but steady wins the race.
+147
View File
@@ -0,0 +1,147 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519011207.00a8cd70@pop.example.com"
},
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 5 (Lowest)\r\n"
},
"offset_start": 181,
"offset_end": 194
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 13,
"second": 19,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 199,
"offset_end": 233
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"offset_start": 236,
"offset_end": 266
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_start": 271,
"offset_end": 308
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "The Hare and the Tortoise"
},
"offset_start": 316,
"offset_end": 344
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 357,
"offset_end": 363
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_start": 376,
"offset_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
}
]
}
-78
View File
@@ -1,78 +0,0 @@
Message-Id: <4.2.0.58.20000519011207.00a8cd70@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 5 (Lowest)
Date: Fri, 19 May 2000 01:13:19 -0400
To: Joe Blow <blow@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: The Hare and the Tortoise
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
The Hare and the Tortoise
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.
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"
]
}
},
"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>"
}
],
"text_body": [
{
"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"
}
]
}
+32
View File
@@ -0,0 +1,32 @@
From: "Doug Sauder" <doug@example.com>
To: =?utf-7?Q?Heinz_M+APw-ller?= <mueller@example.com>
Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:20:24 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGCEKDCHAA.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
+177
View File
@@ -0,0 +1,177 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_start": 43,
"offset_end": 96
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_start": 104,
"offset_end": 175
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 20,
"second": 24,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 180,
"offset_end": 214
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKDCHAA.doug@example.com"
},
"offset_start": 225,
"offset_end": 275
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 288,
"offset_end": 294
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"utf-7"
]
]
}
},
"offset_start": 307,
"offset_end": 339
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 365,
"offset_end": 384
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_start": 395,
"offset_end": 408
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 426,
"offset_end": 435
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_start": 444,
"offset_end": 497
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 508,
"offset_end": 517
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_start": 527,
"offset_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
}
]
}
-99
View File
@@ -1,99 +0,0 @@
From: "Doug Sauder" <doug@example.com>
To: =?utf-7?Q?Heinz_M+APw-ller?= <mueller@example.com>
Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:20:24 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGCEKDCHAA.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
---- 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"
]
}
},
"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>"
}
],
"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"
}
]
}
+83
View File
@@ -0,0 +1,83 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:36:13 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGOEKECHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0004_01BFC037.28F2FA90"
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
This is a multi-part message in MIME format.
------=_NextPart_000_0004_01BFC037.28F2FA90
Content-Type: image/png;
name="blueball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="blueball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
------=_NextPart_000_0004_01BFC037.28F2FA90
Content-Type: image/png;
name="redball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="redball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_0004_01BFC037.28F2FA90--
+273 -169
View File
@@ -1,161 +1,224 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:36:13 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGOEKECHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0004_01BFC037.28F2FA90"
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
This is a multi-part message in MIME format.
------=_NextPart_000_0004_01BFC037.28F2FA90
Content-Type: image/png;
name="blueball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="blueball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
------=_NextPart_000_0004_01BFC037.28F2FA90
Content-Type: image/png;
name="redball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="redball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
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)"
]
}
},
"html_body": [],
"text_body": [],
"attachments": [
1,
2
],
"parts": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "blueball.png"
}
}
"offset_start": 5,
"offset_end": 40
},
"contents": [
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"offset_start": 43,
"offset_end": 76
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Microsoft Outlook 00"
},
"offset_start": 84,
"offset_end": 125
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 36,
"second": 13,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 130,
"offset_end": 164
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGOEKECHAA.doug@example.com"
},
"offset_start": 175,
"offset_end": 225
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 238,
"offset_end": 244
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"----=_NextPart_000_0004_01BFC037.28F2FA90"
]
]
}
},
"offset_start": 257,
"offset_end": 331
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_start": 342,
"offset_end": 355
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 373,
"offset_end": 382
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_start": 391,
"offset_end": 444
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 455,
"offset_end": 464
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_start": 474,
"offset_end": 522
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 524,
"offset_end": 4809
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"blueball.png"
]
]
}
},
"offset_start": 630,
"offset_end": 665
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 691,
"offset_end": 700
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"blueball.png"
]
]
}
},
"offset_start": 720,
"offset_end": 760
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1482,27 +1545,65 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 617,
"offset_body": 762,
"offset_end": 2578
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"redball.png"
]
]
}
},
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "redball.png"
}
}
"offset_start": 2638,
"offset_end": 2672
},
"contents": [
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 2698,
"offset_end": 2707
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"redball.png"
]
]
}
},
"offset_start": 2727,
"offset_end": 2766
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -2957,7 +3058,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 2625,
"offset_body": 2768,
"offset_end": 4760
}
]
}
+31
View File
@@ -0,0 +1,31 @@
From: "Doug Sauder" <doug@example.com>
To: =?iso-8859-1?B?SvxyZ2VuIFNjaG38cmdlbg==?= <schmuergen@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:15:35 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGIEKCCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
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=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =
=E4rger als der Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; =
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt =
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF =
sie aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch =
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
+177
View File
@@ -0,0 +1,177 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"offset_start": 43,
"offset_end": 112
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_start": 120,
"offset_end": 194
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 15,
"second": 35,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 199,
"offset_end": 233
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGIEKCCHAA.doug@example.com"
},
"offset_start": 244,
"offset_end": 294
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 307,
"offset_end": 313
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 326,
"offset_end": 363
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 389,
"offset_end": 408
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_start": 419,
"offset_end": 432
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 450,
"offset_end": 459
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_start": 468,
"offset_end": 521
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 532,
"offset_end": 541
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_start": 551,
"offset_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
}
]
}
-98
View File
@@ -1,98 +0,0 @@
From: "Doug Sauder" <doug@example.com>
To: =?iso-8859-1?B?SvxyZ2VuIFNjaG38cmdlbg==?= <schmuergen@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:15:35 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGIEKCCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
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=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =
=E4rger als der Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; =
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt =
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF =
sie aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch =
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"
]
}
},
"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>"
}
],
"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"
}
]
}
+135
View File
@@ -0,0 +1,135 @@
From: "Doug Sauder" <doug@example.com>
To: =?iso-8859-1?Q?Heinz_M=FCller?= <mueller@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:32:47 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGGEKECHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0002_01BFC036.AE309650"
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
This is a multi-part message in MIME format.
------=_NextPart_000_0002_01BFC036.AE309650
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The Hare and the Tortoise=20
=20
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. =20
=20
Slow but steady wins the race. =20
------=_NextPart_000_0002_01BFC036.AE309650
Content-Type: image/png;
name="blueball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="blueball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
------=_NextPart_000_0002_01BFC036.AE309650
Content-Type: image/png;
name="greenball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="greenball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAAAEAAAGAAAIQAA
CAAAMQAAQgAAUgAAWgAASgAIYwAIcwAIewAQjAAIawAAOQAAYwAQlAAQnAAhpQAQpQAhrQBCvRhj
xjFjxjlSxiEpzgAYvQAQrQAYrQAhvQCU1mOt1nuE1lJK3hgh1gAYxgAYtQAAKQBCzhDO55Te563G
55SU52NS5yEh3gAYzgBS3iGc52vW75y974yE71JC7xCt73ul3nNa7ykh5wAY1gAx5wBS7yFr7zlK
7xgp5wAp7wAx7wAIhAAQtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAp1fnZAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAFtSURBVHicddJtV8IgFAdwD2zIgMEE1+NcqdsoK+m5tCyz7/+ZiLmHsyzvq53zO/cy
+N9ery1bVe9PWQA9z4MQ+H8Yoj7GASZ95IHfaBGmLOSchyIgyOu22mgQSjUcDuNYcoGjLiLK1cHh
0fHJaTKKOcMItgYxT89OzsfjyTTLC8UF0c2ZNmKquJhczq6ub+YmSVUYRF59GeDastu7+9nD41Nm
kiJ2jc2J3kAWZ9Pr55fH18XSmRuKUTXUaqHy7O19tfr4NFle/w3YDrWRUIlZrL/W86XJkyJVG9Ea
EjIx2XyZmZJGioeUaL+2AY8TY8omR6nkLKhu70zjUKVJXsp3quS2DVSJWNh3zzJKCyexI0ZxBP3a
fE0ElyqOlZJyw8r3BE2SFiJCyxA434SCkg65RhdeQBljQtCg39LWrA90RDDG1EWrYUO23hMANUKR
Rl61E529cR++D2G5LK002dr/qrcfu9u0V3bxn/XdhR/NYeeN0ggsLAAAACV0RVh0Q29tbWVudABj
bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
------=_NextPart_000_0002_01BFC036.AE309650
Content-Type: image/png;
name="redball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="redball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_0002_01BFC036.AE309650--
+371 -312
View File
@@ -1,291 +1,271 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:47:24 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGOEKFCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0010_01BFC038.B91BC650"
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
This is a multi-part message in MIME format.
------=_NextPart_000_0010_01BFC038.B91BC650
Content-Type: multipart/related;
boundary="----=_NextPart_001_0011_01BFC038.B91BC650"
------=_NextPart_001_0011_01BFC038.B91BC650
Content-Type: multipart/alternative;
boundary="----=_NextPart_002_0012_01BFC038.B91BC650"
------=_NextPart_002_0012_01BFC038.B91BC650
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The Hare and the Tortoise=20
=20
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. =20
=20
Slow but steady wins the race. =20
------=_NextPart_002_0012_01BFC038.B91BC650
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><IMG align=3Dbaseline alt=3D"blue ball" =
border=3D0=20
hspace=3D0 src=3D"cid:938014623@17052000-0f9b"></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>The Hare and the Tortoise =
<BR>&nbsp;<BR>A HARE=20
one day ridiculed the short feet and slow pace of the Tortoise, who =
replied,=20
laughing:&nbsp; "Though you be swift as the wind, I will beat you in a=20
race."&nbsp; The Hare, believing her assertion to be simply impossible, =
assented=20
to the proposal; and they agreed that the Fox should choose the course =
and fix=20
the goal.&nbsp; On the day appointed for the race the two started=20
together.&nbsp; The Tortoise never for a moment stopped, but went on =
with a slow=20
but steady pace straight to the end of the course.&nbsp; The Hare, lying =
down by=20
the wayside, fell fast asleep.&nbsp; At last waking up, and moving as =
fast as he=20
could, he saw the Tortoise had reached the goal, and was comfortably =
dozing=20
after her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the =
race.&nbsp;=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>&nbsp;</DIV></FONT></BODY></HTML>
------=_NextPart_002_0012_01BFC038.B91BC650--
------=_NextPart_001_0011_01BFC038.B91BC650
Content-Type: image/png;
name="blueball.png"
Content-Transfer-Encoding: base64
Content-ID: <938014623@17052000-0f9b>
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
------=_NextPart_001_0011_01BFC038.B91BC650--
------=_NextPart_000_0010_01BFC038.B91BC650
Content-Type: image/png;
name="greenball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="greenball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAAAEAAAGAAAIQAA
CAAAMQAAQgAAUgAAWgAASgAIYwAIcwAIewAQjAAIawAAOQAAYwAQlAAQnAAhpQAQpQAhrQBCvRhj
xjFjxjlSxiEpzgAYvQAQrQAYrQAhvQCU1mOt1nuE1lJK3hgh1gAYxgAYtQAAKQBCzhDO55Te563G
55SU52NS5yEh3gAYzgBS3iGc52vW75y974yE71JC7xCt73ul3nNa7ykh5wAY1gAx5wBS7yFr7zlK
7xgp5wAp7wAx7wAIhAAQtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAp1fnZAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAFtSURBVHicddJtV8IgFAdwD2zIgMEE1+NcqdsoK+m5tCyz7/+ZiLmHsyzvq53zO/cy
+N9ery1bVe9PWQA9z4MQ+H8Yoj7GASZ95IHfaBGmLOSchyIgyOu22mgQSjUcDuNYcoGjLiLK1cHh
0fHJaTKKOcMItgYxT89OzsfjyTTLC8UF0c2ZNmKquJhczq6ub+YmSVUYRF59GeDastu7+9nD41Nm
kiJ2jc2J3kAWZ9Pr55fH18XSmRuKUTXUaqHy7O19tfr4NFle/w3YDrWRUIlZrL/W86XJkyJVG9Ea
EjIx2XyZmZJGioeUaL+2AY8TY8omR6nkLKhu70zjUKVJXsp3quS2DVSJWNh3zzJKCyexI0ZxBP3a
fE0ElyqOlZJyw8r3BE2SFiJCyxA434SCkg65RhdeQBljQtCg39LWrA90RDDG1EWrYUO23hMANUKR
Rl61E529cR++D2G5LK002dr/qrcfu9u0V3bxn/XdhR/NYeeN0ggsLAAAACV0RVh0Q29tbWVudABj
bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
------=_NextPart_000_0010_01BFC038.B91BC650
Content-Type: image/png;
name="redball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="redball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
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"
]
}
},
"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"
}
1
],
"text_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"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"
}
1
],
"attachments": [
2,
3,
4
],
"parts": [
{
"Binary": {
"header": {
"content_id": "938014623@17052000-0f9b",
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "blueball.png"
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
}
},
"offset_start": 5,
"offset_end": 40
},
"contents": [
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_start": 43,
"offset_end": 99
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Microsoft Outlook 00"
},
"offset_start": 107,
"offset_end": 148
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 32,
"second": 47,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 153,
"offset_end": 187
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGGEKECHAA.doug@example.com"
},
"offset_start": 198,
"offset_end": 248
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 261,
"offset_end": 267
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"----=_NextPart_000_0002_01BFC036.AE309650"
]
]
}
},
"offset_start": 280,
"offset_end": 354
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_start": 365,
"offset_end": 378
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 396,
"offset_end": 405
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_start": 414,
"offset_end": 467
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 478,
"offset_end": 487
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_start": 497,
"offset_end": 545
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3,
4
]
},
"offset_header": 0,
"offset_body": 547,
"offset_end": 7747
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 653,
"offset_end": 690
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 716,
"offset_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": 1536
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"blueball.png"
]
]
}
},
"offset_start": 1596,
"offset_end": 1631
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 1657,
"offset_end": 1666
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"blueball.png"
]
]
}
},
"offset_start": 1686,
"offset_end": 1726
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1612,27 +1592,65 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 1583,
"offset_body": 1728,
"offset_end": 3544
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"greenball.png"
]
]
}
},
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "greenball.png"
}
}
"offset_start": 3604,
"offset_end": 3640
},
"contents": [
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 3666,
"offset_end": 3675
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"greenball.png"
]
]
}
},
"offset_start": 3695,
"offset_end": 3736
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -2932,27 +2950,65 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 3591,
"offset_body": 3738,
"offset_end": 5516
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "redball.png"
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"redball.png"
]
]
}
},
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "redball.png"
}
}
"offset_start": 5576,
"offset_end": 5610
},
"contents": [
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 5636,
"offset_end": 5645
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"redball.png"
]
]
}
},
"offset_start": 5665,
"offset_end": 5704
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -4407,7 +4463,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
96,
130
]
}
},
"offset_header": 5563,
"offset_body": 5706,
"offset_end": 7698
}
]
}
+36
View File
@@ -0,0 +1,36 @@
Message-Id: <4.2.0.58.20000519010441.00a8d140@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
Disposition-Notification-To: <dwsauder@example.com>
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 1 (Highest)
Date: Fri, 19 May 2000 01:06:18 -0400
To: =?iso-8859-1?Q?Jürgen?= =?iso-8859-1?Q?_Schmürgen?=
<jschmuergen@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Frösche?=
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach ein=
=20
Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,=20
der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der=
=20
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=20
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte=20
eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie aufs=
schnellste=20
untertauchten.
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ein=
=20
wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere,=20
welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."
+171
View File
@@ -0,0 +1,171 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519010441.00a8d140@pop.example.com"
},
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "Disposition-Notification-To"
},
"value": {
"Text": " <dwsauder@example.com>\r\n"
},
"offset_start": 141,
"offset_end": 166
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_start": 175,
"offset_end": 223
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 1 (Highest)\r\n"
},
"offset_start": 234,
"offset_end": 248
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 6,
"second": 18,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 253,
"offset_end": 287
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"offset_start": 290,
"offset_end": 373
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_start": 378,
"offset_end": 415
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_start": 423,
"offset_end": 468
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 481,
"offset_end": 487
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
],
[
"format",
"flowed"
]
]
}
},
"offset_start": 500,
"offset_end": 550
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 576,
"offset_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
}
]
}
-101
View File
@@ -1,101 +0,0 @@
Message-Id: <4.2.0.58.20000519010441.00a8d140@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
Disposition-Notification-To: <dwsauder@example.com>
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 1 (Highest)
Date: Fri, 19 May 2000 01:06:18 -0400
To: =?iso-8859-1?Q?Jürgen?= =?iso-8859-1?Q?_Schmürgen?=
<jschmuergen@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Frösche?=
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach ein=
=20
Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,=20
der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der=
=20
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=20
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte=20
eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie aufs=
schnellste=20
untertauchten.
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ein=
=20
wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere,=20
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)"
]
}
},
"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>"
}
],
"text_body": [
{
"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"
}
]
}
+21
View File
@@ -0,0 +1,21 @@
Message-Id: <4.2.0.58.20000519010842.00a8c7f0@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 1 (Highest)
Date: Fri, 19 May 2000 01:10:27 -0400
To: Heinz Müller <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: Die Hasen und die Frösche
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
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."
+157
View File
@@ -0,0 +1,157 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519010842.00a8c7f0@pop.example.com"
},
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 1 (Highest)\r\n"
},
"offset_start": 181,
"offset_end": 195
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 10,
"second": 27,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 200,
"offset_end": 234
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz M�ller",
"address": "mueller@example.com"
}
},
"offset_start": 237,
"offset_end": 274
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_start": 279,
"offset_end": 316
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Fr�sche"
},
"offset_start": 324,
"offset_end": 352
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 365,
"offset_end": 371
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 384,
"offset_end": 419
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "8bit"
},
"offset_start": 445,
"offset_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
}
]
}
-82
View File
@@ -1,82 +0,0 @@
Message-Id: <4.2.0.58.20000519010842.00a8c7f0@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 1 (Highest)
Date: Fri, 19 May 2000 01:10:27 -0400
To: Heinz Müller <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: Die Hasen und die Frösche
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
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."
---- 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)"
]
}
},
"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>"
}
],
"text_body": [
{
"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"
}
]
}
+29
View File
@@ -0,0 +1,29 @@
Message-Id: <4.2.0.58.20000519001217.00a85b60@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
Date: Fri, 19 May 2000 00:17:39 -0400
To: =?iso-8859-1?Q?J=FCrgen?= =?iso-8859-1?Q?_Schm=FCrgen?=
<jschmuergen@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?=
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =E4rger als der=
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch 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
+147
View File
@@ -0,0 +1,147 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519001217.00a85b60@pop.example.com"
},
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 17,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 175,
"offset_end": 209
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"offset_start": 212,
"offset_end": 299
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_start": 304,
"offset_end": 341
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_start": 349,
"offset_end": 396
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 409,
"offset_end": 415
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 428,
"offset_end": 463
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 489,
"offset_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
}
]
}
-87
View File
@@ -1,87 +0,0 @@
Message-Id: <4.2.0.58.20000519001217.00a85b60@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
Date: Fri, 19 May 2000 00:17:39 -0400
To: =?iso-8859-1?Q?J=FCrgen?= =?iso-8859-1?Q?_Schm=FCrgen?=
<jschmuergen@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?=
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =E4rger als der=
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch 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": 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)"
]
}
},
"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>"
}
],
"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\n"
}
]
}
+30
View File
@@ -0,0 +1,30 @@
From: "Doug Sauder" <doug@example.com>
To: =?Windows-1252?Q?Heinz_M=FCller?= <mueller@example.com>
Subject: =?Windows-1252?Q?Die_Hasen_und_die_Fr=F6sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:30:20 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGCEKECHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Windows-1252"
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=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =
=E4rger als der Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; =
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt =
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF =
sie aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch =
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
+177
View File
@@ -0,0 +1,177 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_start": 43,
"offset_end": 101
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_start": 109,
"offset_end": 185
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 30,
"second": 20,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 190,
"offset_end": 224
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKECHAA.doug@example.com"
},
"offset_start": 235,
"offset_end": 285
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 298,
"offset_end": 304
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"Windows-1252"
]
]
}
},
"offset_start": 317,
"offset_end": 356
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 382,
"offset_end": 401
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_start": 412,
"offset_end": 425
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 443,
"offset_end": 452
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_start": 461,
"offset_end": 514
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 525,
"offset_end": 534
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_start": 544,
"offset_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
}
]
}
-97
View File
@@ -1,97 +0,0 @@
From: "Doug Sauder" <doug@example.com>
To: =?Windows-1252?Q?Heinz_M=FCller?= <mueller@example.com>
Subject: =?Windows-1252?Q?Die_Hasen_und_die_Fr=F6sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:30:20 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGCEKECHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Windows-1252"
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=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =
=E4rger als der Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; =
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt =
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF =
sie aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch =
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)"
]
}
},
"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>"
}
],
"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"
}
]
}
+31
View File
@@ -0,0 +1,31 @@
From: "Doug Sauder" <doug@example.com>
To: =?iso-8859-1?B?SvxyZ2VuIFNjaG38cmdlbg==?= <schmuergen@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:13:51 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGEEKCCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
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ö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."
+177
View File
@@ -0,0 +1,177 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"offset_start": 43,
"offset_end": 112
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_start": 120,
"offset_end": 194
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 13,
"second": 51,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 199,
"offset_end": 233
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGEEKCCHAA.doug@example.com"
},
"offset_start": 244,
"offset_end": 294
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 307,
"offset_end": 313
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 326,
"offset_end": 363
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "8bit"
},
"offset_start": 389,
"offset_end": 396
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_start": 407,
"offset_end": 420
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 438,
"offset_end": 447
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_start": 456,
"offset_end": 509
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 520,
"offset_end": 529
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_start": 539,
"offset_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
}
]
}
-98
View File
@@ -1,98 +0,0 @@
From: "Doug Sauder" <doug@example.com>
To: =?iso-8859-1?B?SvxyZ2VuIFNjaG38cmdlbg==?= <schmuergen@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:13:51 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGEEKCCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
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ö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."
---- 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"
]
}
},
"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>"
}
],
"text_body": [
{
"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"
}
]
}
+72
View File
@@ -0,0 +1,72 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:38:28 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGCEKFCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0005_01BFC037.799BEF60"
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
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01BFC037.799BEF60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The Hare and the Tortoise=20
=20
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. =20
=20
Slow but steady wins the race. =20
------=_NextPart_000_0005_01BFC037.799BEF60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><BR>The Hare and the Tortoise =
<BR>&nbsp;<BR>A HARE=20
one day ridiculed the short feet and slow pace of the Tortoise, who =
replied,=20
laughing:&nbsp; "Though you be swift as the wind, I will beat you in a=20
race."&nbsp; The Hare, believing her assertion to be simply impossible, =
assented=20
to the proposal; and they agreed that the Fox should choose the course =
and fix=20
the goal.&nbsp; On the day appointed for the race the two started=20
together.&nbsp; The Tortoise never for a moment stopped, but went on =
with a slow=20
but steady pace straight to the end of the course.&nbsp; The Hare, lying =
down by=20
the wayside, fell fast asleep.&nbsp; At last waking up, and moving as =
fast as he=20
could, he saw the Tortoise had reached the goal, and was comfortably =
dozing=20
after her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the =
race.&nbsp;=20
<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_0005_01BFC037.799BEF60--
+250
View File
@@ -0,0 +1,250 @@
{
"html_body": [
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"offset_start": 43,
"offset_end": 76
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Microsoft Outlook 00"
},
"offset_start": 84,
"offset_end": 125
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 38,
"second": 28,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_start": 130,
"offset_end": 164
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKFCHAA.doug@example.com"
},
"offset_start": 175,
"offset_end": 225
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 238,
"offset_end": 244
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"----=_NextPart_000_0005_01BFC037.799BEF60"
]
]
}
},
"offset_start": 257,
"offset_end": 337
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_start": 348,
"offset_end": 361
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 379,
"offset_end": 388
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_start": 397,
"offset_end": 450
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_start": 461,
"offset_end": 470
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_start": 480,
"offset_end": 528
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 530,
"offset_end": 2903
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 636,
"offset_end": 673
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 699,
"offset_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": 1521
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 1581,
"offset_end": 1617
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 1643,
"offset_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": 2854
}
]
}
-158
View File
@@ -1,158 +0,0 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:38:28 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGCEKFCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0005_01BFC037.799BEF60"
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
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01BFC037.799BEF60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The Hare and the Tortoise=20
=20
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. =20
=20
Slow but steady wins the race. =20
------=_NextPart_000_0005_01BFC037.799BEF60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><BR>The Hare and the Tortoise =
<BR>&nbsp;<BR>A HARE=20
one day ridiculed the short feet and slow pace of the Tortoise, who =
replied,=20
laughing:&nbsp; "Though you be swift as the wind, I will beat you in a=20
race."&nbsp; The Hare, believing her assertion to be simply impossible, =
assented=20
to the proposal; and they agreed that the Fox should choose the course =
and fix=20
the goal.&nbsp; On the day appointed for the race the two started=20
together.&nbsp; The Tortoise never for a moment stopped, but went on =
with a slow=20
but steady pace straight to the end of the course.&nbsp; The Hare, lying =
down by=20
the wayside, fell fast asleep.&nbsp; At last waking up, and moving as =
fast as he=20
could, he saw the Tortoise had reached the goal, and was comfortably =
dozing=20
after her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the =
race.&nbsp;=20
<BR></FONT></DIV></BODY></HTML>
------=_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"
]
}
},
"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"
}
],
"text_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"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"
}
]
}
+198
View File
@@ -0,0 +1,198 @@
Message-Id: <4.2.0.58.20000519003556.00a918e0@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 2 (High)
Date: Fri, 19 May 2000 00:36:58 -0400
To: Heinz =?iso-8859-1?Q?Müller?= <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Frösche?=
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="=====================_715392540==_"
--=====================_715392540==_
Content-Type: multipart/related;
type="multipart/alternative";
boundary="=====================_715392540==_.REL"
--=====================_715392540==_.REL
Content-Type: multipart/alternative;
boundary="=====================_715392550==_.ALT"
--=====================_715392550==_.ALT
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =E4rger als der=
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch 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
2aa3ed95.png2aa3edd1.png
--=====================_715392550==_.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<font face=3D"Arial, Helvetica" size=3D5 color=3D"#0000FF"><b>Die Hasen und =
die
Fr=F6sche<br>
<br>
</font></b><font face=3D"Arial, Helvetica">Die Hasen klagten einst =FCber
ihre mi=DFliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in
steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,
ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der Tod selbst.
Auf, la=DFt uns ein f=FCr allemal sterben.&quot; <br>
<br>
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie au=
fs
schnellste untertauchten. <br>
<br>
&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das
Ers=E4ufen noch ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr
seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als
wir.&quot; <br>
<br>
</font><img src=3D"cid:4.2.0.58.20000519003556.00a918e0@pop.example.com.2"=
width=3D27 height=3D27 alt=3D"2aa3ed95.png"><img=
src=3D"cid:4.2.0.58.20000519003556.00a918e0@pop.example.com.3" width=3D27=
height=3D27 alt=3D"2aa3edd1.png"></html>
--=====================_715392550==_.ALT--
--=====================_715392540==_.REL
Content-Type: image/png; name="2aa3ed95.png"
Content-ID: <4.2.0.58.20000519003556.00a918e0@pop.example.com.2>
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="2aa3ed95.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
--=====================_715392540==_.REL
Content-Type: image/png; name="2aa3edd1.png"
Content-ID: <4.2.0.58.20000519003556.00a918e0@pop.example.com.3>
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="2aa3edd1.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
--=====================_715392540==_.REL--
--=====================_715392540==_
Content-Type: image/png; name="blueball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="blueball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
--=====================_715392540==_
Content-Type: image/png; name="greenball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="greenball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAAAEAAAGAAAIQAA
CAAAMQAAQgAAUgAAWgAASgAIYwAIcwAIewAQjAAIawAAOQAAYwAQlAAQnAAhpQAQpQAhrQBCvRhj
xjFjxjlSxiEpzgAYvQAQrQAYrQAhvQCU1mOt1nuE1lJK3hgh1gAYxgAYtQAAKQBCzhDO55Te563G
55SU52NS5yEh3gAYzgBS3iGc52vW75y974yE71JC7xCt73ul3nNa7ykh5wAY1gAx5wBS7yFr7zlK
7xgp5wAp7wAx7wAIhAAQtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAp1fnZAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAFtSURBVHicddJtV8IgFAdwD2zIgMEE1+NcqdsoK+m5tCyz7/+ZiLmHsyzvq53zO/cy
+N9ery1bVe9PWQA9z4MQ+H8Yoj7GASZ95IHfaBGmLOSchyIgyOu22mgQSjUcDuNYcoGjLiLK1cHh
0fHJaTKKOcMItgYxT89OzsfjyTTLC8UF0c2ZNmKquJhczq6ub+YmSVUYRF59GeDastu7+9nD41Nm
kiJ2jc2J3kAWZ9Pr55fH18XSmRuKUTXUaqHy7O19tfr4NFle/w3YDrWRUIlZrL/W86XJkyJVG9Ea
EjIx2XyZmZJGioeUaL+2AY8TY8omR6nkLKhu70zjUKVJXsp3quS2DVSJWNh3zzJKCyexI0ZxBP3a
fE0ElyqOlZJyw8r3BE2SFiJCyxA434SCkg65RhdeQBljQtCg39LWrA90RDDG1EWrYUO23hMANUKR
Rl61E529cR++D2G5LK002dr/qrcfu9u0V3bxn/XdhR/NYeeN0ggsLAAAACV0RVh0Q29tbWVudABj
bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
--=====================_715392540==_--
+535 -291
View File
@@ -1,254 +1,372 @@
Message-Id: <4.2.0.58.20000519003903.00a859b0@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 2 (High)
Date: Fri, 19 May 2000 00:39:05 -0400
To: Heinz =?iso-8859-1?Q?M�ller?= <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr�sche?=
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="=====================_715515186==_"
--=====================_715515186==_
Content-Type: multipart/related;
type="text/plain";
boundary="=====================_715515186==_.REL"
--=====================_715515186==_.REL
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =E4rger als der=
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch 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
2aa5e03a.png2aa5e044.png
--=====================_715515186==_.REL
Content-Type: image/png; name="2aa5e03a.png"
Content-ID: <4.2.0.58.20000519003903.00a859b0@pop.example.com.2>
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="2aa5e03a.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
--=====================_715515186==_.REL
Content-Type: image/png; name="2aa5e044.png"
Content-ID: <4.2.0.58.20000519003903.00a859b0@pop.example.com.3>
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="2aa5e044.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
--=====================_715515186==_.REL--
--=====================_715515186==_
Content-Type: image/png; name="blueball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="blueball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
--=====================_715515186==_
Content-Type: image/png; name="greenball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="greenball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAAAEAAAGAAAIQAA
CAAAMQAAQgAAUgAAWgAASgAIYwAIcwAIewAQjAAIawAAOQAAYwAQlAAQnAAhpQAQpQAhrQBCvRhj
xjFjxjlSxiEpzgAYvQAQrQAYrQAhvQCU1mOt1nuE1lJK3hgh1gAYxgAYtQAAKQBCzhDO55Te563G
55SU52NS5yEh3gAYzgBS3iGc52vW75y974yE71JC7xCt73ul3nNa7ykh5wAY1gAx5wBS7yFr7zlK
7xgp5wAp7wAx7wAIhAAQtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAp1fnZAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAFtSURBVHicddJtV8IgFAdwD2zIgMEE1+NcqdsoK+m5tCyz7/+ZiLmHsyzvq53zO/cy
+N9ery1bVe9PWQA9z4MQ+H8Yoj7GASZ95IHfaBGmLOSchyIgyOu22mgQSjUcDuNYcoGjLiLK1cHh
0fHJaTKKOcMItgYxT89OzsfjyTTLC8UF0c2ZNmKquJhczq6ub+YmSVUYRF59GeDastu7+9nD41Nm
kiJ2jc2J3kAWZ9Pr55fH18XSmRuKUTXUaqHy7O19tfr4NFle/w3YDrWRUIlZrL/W86XJkyJVG9Ea
EjIx2XyZmZJGioeUaL+2AY8TY8omR6nkLKhu70zjUKVJXsp3quS2DVSJWNh3zzJKCyexI0ZxBP3a
fE0ElyqOlZJyw8r3BE2SFiJCyxA434SCkg65RhdeQBljQtCg39LWrA90RDDG1EWrYUO23hMANUKR
Rl61E529cR++D2G5LK002dr/qrcfu9u0V3bxn/XdhR/NYeeN0ggsLAAAACV0RVh0Q29tbWVudABj
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)"
]
}
},
"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>"
}
4
],
"text_body": [
{
"header": {
"content_transfer_encoding": "quoted-printable",
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "iso-8859-1"
}
}
},
"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"
}
3
],
"attachments": [
5,
6,
7,
8
],
"parts": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa5e03a.png"
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com"
},
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 2 (High)\r\n"
},
"offset_start": 181,
"offset_end": 192
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 36,
"second": 58,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"content_id": "4.2.0.58.20000519003903.00a859b0@pop.example.com.2",
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "2aa5e03a.png"
}
}
"offset_start": 197,
"offset_end": 231
},
"contents": [
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_start": 234,
"offset_end": 288
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_start": 293,
"offset_end": 330
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_start": 338,
"offset_end": 383
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 396,
"offset_end": 402
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"=====================_715392540==_"
]
]
}
},
"offset_start": 415,
"offset_end": 482
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
7,
8
]
},
"offset_header": 0,
"offset_body": 484,
"offset_end": 11502
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "related",
"attributes": [
[
"type",
"multipart/alternative"
],
[
"boundary",
"=====================_715392540==_.REL"
]
]
}
},
"offset_start": 535,
"offset_end": 640
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
5,
6
]
},
"offset_header": 522,
"offset_body": 642,
"offset_end": 7504
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"=====================_715392550==_.ALT"
]
]
}
},
"offset_start": 697,
"offset_end": 774
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
3,
4
]
},
"offset_header": 684,
"offset_body": 776,
"offset_end": 3160
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 831,
"offset_end": 866
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 892,
"offset_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": 1746
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_start": 1803,
"offset_end": 1837
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_start": 1863,
"offset_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": 3114
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"2aa3ed95.png"
]
]
}
},
"offset_start": 3217,
"offset_end": 3250
},
{
"name": {
"Rfc": "content_id"
},
"value": {
"Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com.2"
},
"offset_start": 3261,
"offset_end": 3316
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 3342,
"offset_end": 3351
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": [
[
"filename",
"2aa3ed95.png"
]
]
}
},
"offset_start": 3371,
"offset_end": 3405
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -1575,28 +1693,75 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 3204,
"offset_body": 3407,
"offset_end": 5221
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "inline",
"attributes": {
"filename": "2aa5e044.png"
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"2aa3edd1.png"
]
]
}
},
"content_id": "4.2.0.58.20000519003903.00a859b0@pop.example.com.3",
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "2aa5e044.png"
}
}
"offset_start": 5278,
"offset_end": 5311
},
"contents": [
{
"name": {
"Rfc": "content_id"
},
"value": {
"Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com.3"
},
"offset_start": 5322,
"offset_end": 5377
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 5403,
"offset_end": 5412
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": [
[
"filename",
"2aa3edd1.png"
]
]
}
},
"offset_start": 5432,
"offset_end": 5466
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -3051,27 +3216,65 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 5265,
"offset_body": 5468,
"offset_end": 7458
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"blueball.png"
]
]
}
},
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "blueball.png"
}
}
"offset_start": 7557,
"offset_end": 7590
},
"contents": [
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 7616,
"offset_end": 7625
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"blueball.png"
]
]
}
},
"offset_start": 7645,
"offset_end": 7683
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -4398,27 +4601,65 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 7544,
"offset_body": 7685,
"offset_end": 9499
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"greenball.png"
]
]
}
},
"content_transfer_encoding": "base64",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "greenball.png"
}
}
"offset_start": 9552,
"offset_end": 9586
},
"contents": [
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_start": 9612,
"offset_end": 9621
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"greenball.png"
]
]
}
},
"offset_start": 9641,
"offset_end": 9680
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
137,
80,
78,
@@ -5718,7 +5959,10 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
96,
130
]
}
},
"offset_header": 9539,
"offset_body": 9682,
"offset_end": 11458
}
]
}
+95
View File
@@ -0,0 +1,95 @@
Message-Id: <4.2.0.58.20000519005150.00a85230@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
Date: Fri, 19 May 2000 00:53:25 -0400
To: =?iso-8859-1?Q?Jürgen?= =?iso-8859-1?Q?_Schmürgen?=
<jschmuergen@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Frösche?=
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="=====================_716373961==_"
--=====================_716373961==_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =E4rger als der=
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch 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
--=====================_716373961==_
Content-Type: application/mac-binhex40; name="blueball.png"
Content-Disposition: attachment; filename="blueball.png"
(This file must be converted with BinHex 4.0)
:$'*XG@9LB@aX,R"ZC`"#58j"E@4[F`!!!!!&,3!!!!"'dSP36NF0#KS+!!!!$8P
)4&)!!!!E!!!!'`J$!!!!ZJS%C`!!!`"36&4&rrrr!!!)!!!3!!!B!!!!!!JT!""
#!""+!!Ja!""5##&c##Pl##Q%##&V!"KD!!Jj##&M%$QF'%+P'%+Y'%+e%$QP%$'
8!"K5%$'-+9+e1@2'1@21+9V1'%V1'%,1'%+p3Q['Hjc@R,hHM,AHBj6R-@[H)9,
H'%V@'%,'%$'P!!!KcZI[jqr[R-E[8S6[+9VR%$QY5R[1VFlHTFl[@Sc[%$'F@S6
@VGERcZr[M,h[5R[['$QP'%V'M,hRYHI[P,h[!!!T@ScRFkA[Djc[##Q--@2[+9V
[##&l!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!`6)093!!!!&d8Nj6!%$Qf'B!!!!
@G%9BG&0[CR4hBA*P!'GTCM*`EQFJ-Li`,M%pAVjS!!!"L%P%394iR(A5E9HE-"J
'i"*1J#B38T1'c!P-T`8LfUU,fka[fhcjrlmSHp*@l,((QbqFFjdl)H3CMBB%+%3
SF+1G"$L+)9'#`iq-ai5Q%*+a+%(Ek(*1*hY##M&9+5Q5d!hUNNb,,rYI$mUUPP-
0L!E%61pp1cckIR`bDeVCk5`bEhX'-ChX(jlfTfIRmkCX&iS`[#QkK'YaFGRhrG@
2H929`P+@JhN-)M+4ecrlrYI[QeP6eN+"K@X,BlUm[Ekl[hr`Y9BZhXdp&PU8"hr
qrV[aZp@Ldi5[c)dFCNqLRFfIAaT2FQV6,%i'5jGeeB"83!ZV+BrpGhTl,+L9E9P
@YcA38QR#r2P@CQ+LTRAG3NQ+$SM$NKX,FjDUT445,MUVp'Y@4'De*&L!Lba9YZZ
XY5VeK0FeIiJ`"p4++Ce5`SXS'3L+*Kpc3LPp*Cb2JGBVVX`KNmF&ij`cZ(HcD@e
q0Q#54j!!(#B#EC2(!"Q$M3RIjHeZr@Z!i"R!E3h&EVDRk92jL,[MZ`2r!448c0L
CD3kr!!!!*A4&@(4$EfeYC@jd!'0XDA!bCfPQ)(BZ-#if)'*j)&PfCA-J8'PRG@9
d0R-l[!!!!!"*48j%VN*JJYqd!!!!:
--=====================_716373961==_
Content-Type: application/mac-binhex40; name="HasenundFrösche.txt"
Content-Disposition: attachment; filename="HasenundFrösche.txt"
(This file must be converted with BinHex 4.0)
:%dKKFf9ZG@jN4R,fFf0SC5jdH(3!9%9B9(4dH(3!!!!!!Z-!!!!!4Pj%D@8J5'&
cC@iJG@jN)'4TC5"'F[CcBfKP$3e%D@8J5'&cC@iJDfaKCh4PEL"PD@jcG#$mBQ9
b)'PSFQ8JE@RIE'PMD'8J6'&RC6XJ)RGTFL"XC@*PEL)X)(0`FQ&MD#"PD@iJ8Q9
NEQ9b,#!LD@iJFh4PG'9b)%CeFQ0SG#"fEh)J6@9ZFf0SC@iJG@jN)&4TCA*PEL`
JC@PZC5"#CA9dC5"NCA)J5(9ZC'8X)'4PFL""C'aPFL`JDQ%JCQ&cG#"KE'aPFL"
5BA9LG'PPFQ8K)&9ZFf9bC5"cG'9dC5""EQGcG#"TFh3Jj(*RCA)JB@ac)'4PFL"
8Ef3JFf9XBR0d,L""G@BX)'aKhh3JG@jc)'9TEL"Qr()JB@aXC@eKE#"cG'9bBQ9
Z,L)J$3e*EL"PD@jPE5"ZB@KPEL"8C@PMD#"hEfaXG'9Z)(0TC5"cD@0S)'jeEL"
PFR2NG@CPEMXJFfPP)'9TE(4PEL"TD'dJHR8l)'&XE'9TEL"NBA-JBAAICA*[FQ4
PER4XD@0SC5"(CA6fFf8JG@jN)'PSFQ8JGh9ZC'9bBQ&bC5"(CA0dB@ad)'9bFf0
SFQ9MDh4P)'9TEQ8J6@9ZCf8J4R,fFf0SC5`JC'PP)'&Y)&9QCA)JFf(IC@iX)(0
[)(0PD()X)'4Khb"cD@8JBA9QFb"cBfKZC@aXFh4P)(9ZG'9bG'&eBfKdC@iZ)!d
0)NKKE(3L,#"bD@9Q)'jeEL"PBQ9Z)'4TCA0PFL"6F(*PBfKPFL`J)RGTFL"hEfa
XC@iJC'&c)%9bFq4eCQ9Z)'j[BfJJC@PZ)(GPEQPR)'&eCR0MD'PPBQ9Z,#"NC@j
Z)'&eBfJJG@jc)'EmFQ0SG'9Z,#"hD@8JD@Kb)(0PD(3X)'9TEQPRC5"8D@9bC5`
JGf9XBfKP)'&XFfmJGfpSE#"ZEf0S)(9ZCfcmBfYXD@0SCA)JFf9TEL"Yr(0cC@i
JB@ac)(GTFLiL)!d09'8!!!:
--=====================_716373961==_--
File diff suppressed because it is too large Load Diff
+102
View File
@@ -0,0 +1,102 @@
Message-Id: <4.2.0.58.20000519004755.00a86100@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
Date: Fri, 19 May 2000 00:50:08 -0400
To: Jürgen Schmürgen <jschmuergen@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: The Hare and the Tortoise
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="=====================_716177458==_"
--=====================_716177458==_
Content-Type: text/plain; charset="us-ascii"
The Hare and the Tortoise
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.
Slow but steady wins the race.
--=====================_716177458==_
Content-Type: image/png; name="greenball.png"
Content-Transfer-Encoding: x-uuencode
Content-Disposition: attachment; filename="greenball.png"
begin 600 greenball.png
MB5!.1PT*&@H````-24A$4@```!L````;"`,```"Z"@1G```#`%!,5$7___\`
M````$```&```(0``"```,0``0@``4@``6@``2@`(8P`(<P`(>P`0C``(:P``
M.0``8P`0E``0G``AI0`0I0`AK0!"O1ACQC%CQCE2QB$IS@`8O0`0K0`8K0`A
MO0"4UF.MUGN$UE)*WA@AU@`8Q@`8M0``*0!"SA#.YY3>YZW&YY24YV-2YR$A
MW@`8S@!2WB&<YVO6[YR][XR$[U)"[Q"M[WNEWG-:[RDAYP`8U@`QYP!2[R%K
M[SE*[Q@IYP`I[P`Q[P`(A``0M0``````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````````````````````````````````````````I
MU?G9`````7123E,`0.;89@```!9T15AT4V]F='=A<F4`9VEF,G!N9R`R+C`N
M,3U>OF@```%M241!5'B<==)M5\(@%`=P#VS(@,$$U^-<J=LH*^FYM"RS[_^9
MB+F'LRSOJYWS._<R^-]>KRU;5>]/60`]SX,0^'\8HC[&`29]Y('?:!&F+.2<
MAR(@R.NVVF@02C4<#N-8<H&C+B+*U<'AT?'):3**.<,(M@8Q3\].SL?CR33+
M"\4%T<V9-F*JN)A<SJZN;^8F25481%Y]&>#:LMN[^]G#XU-FDB)VC<V)WD`6
M9]/KYY?'U\72F1N*4374:J'R[.U]M?KX-%E>_PW8#K614(E9K+_6\Z7)DR)5
M&]$:$C(QV7R9F9)&BH>4:+^V`8\38\HF1ZGD+*AN[TSC4*5)7LIWJN2V#52)
M6-AWSS)*"R>Q(T9Q!/W:?$T$ERJ.E9)RP\KW!$V2%B)"RQ`XWX2"D@ZY1A=>
M0!EC0M"@W]+6K`]T1##&U$6K84.VWA,`-4*11EZU$YV]<1^^#V&Y+*TTV=K_
MJK<?N]NT5W;QG_7=A1_-8>>-T@@L+````"5T15AT0V]M;65N=`!C;&EP,F=I
F9B!V+C`N-B!B>2!9=F5S(%!I9W5E=#9S.[P`````245.1*Y"8((`
`
end
--=====================_716177458==_
Content-Type: image/png; name="blueball.png"
Content-Transfer-Encoding: x-uuencode
Content-Disposition: attachment; filename="blueball.png"
begin 600 blueball.png
MB5!.1PT*&@H````-24A$4@```!L````;"`,```"Z"@1G```#`%!,5$7___\`
M``@``!```!@`````""D`$$(`$$H`"#$`$%(((7,(*7L(*80((6L`&%H`"#D(
M(6,0.9P80J480JT80K40.:40,90`&%(0,8PI4K4Y8\8Y8\XI6LX82LX80LX8
M0KU":\9[G-:<O=Z,M=YCE.<Q:]XA4MX82M880L80,:4``"'.Y^_G[^^<QN]2
MA.\I6N<0.:U*>\ZMSMZESN]:C.\0,9Q:A-:MUN?.[^^,O>]*>^\8.:482L:,
MO>>UY^^4O>\``"E:C.=SI>]KG.\(*8PQ8^\I6N\((7L`````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````````````````#!
M,@U5`````7123E,`0.;89@```!9T15AT4V]F='=A<F4`9VEF,G!N9R`R+C`N
M,3U>OF@```&(241!5'B<==)M5YLP&`;@$DZ`)A!2DX;,"4RG!2+:JHO;K&_;
M?/G_ORA[TE;LL<>;+YQSG3LAY!F-A@0H1"APHYT$.(HA48+#CXS'A*80DK$H
M0=OH<DXG>T(*,54I*9+0#>J23(LO^U\/RJJ64PV(!L1,[WT[//I^?#)K6MGI
M+#)O>P8QG>P?GO:G9^?SIFP7BC"\*;J$:W%QV??]U8]Y4]7"4I:#>0PB,I'7
M/_O^U^^;65/60H&%:PMCNKR]OKN_?_"U5B[>S3T66I0'?_[^N_&[U:+3A*_,
MC1QF3Z*=S9]?&D]R:M,L3@9+EW75@%1`"ZLIC_UW>GLLJ)5M65:W-=!2:<+\
M^59F8J*F==U"28H.B,.2&PMSEJJE%%(N.JOT:U9$9K4D6("++%6VZZRU*O6$
MUS5_B#`'U$HIG5+"BR@9"(HF'W-"*7TEG(^!UBNNS"&3QP7CG#.X=[-I;7XV
M8))'D!PF`FV3QP`9@XT)W^7M;OUK@.`9P&T-Q6ZVI^E3^8B[X[L#_P$45,S8
MF6D.OP```"5T15AT0V]M;65N=`!C;&EP,F=I9B!V+C`N-B!B>2!9=F5S(%!I
49W5E=#9S.[P`````245.1*Y"8((`
`
end
--=====================_716177458==_--
+276 -198
View File
@@ -1,190 +1,229 @@
Message-Id: <4.2.0.58.20000519004755.00a86100@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
Date: Fri, 19 May 2000 00:50:08 -0400
To: Jürgen Schmürgen <jschmuergen@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: The Hare and the Tortoise
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="=====================_716177458==_"
--=====================_716177458==_
Content-Type: text/plain; charset="us-ascii"
The Hare and the Tortoise
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.
Slow but steady wins the race.
--=====================_716177458==_
Content-Type: image/png; name="greenball.png"
Content-Transfer-Encoding: x-uuencode
Content-Disposition: attachment; filename="greenball.png"
begin 600 greenball.png
MB5!.1PT*&@H````-24A$4@```!L````;"`,```"Z"@1G```#`%!,5$7___\`
M````$```&```(0``"```,0``0@``4@``6@``2@`(8P`(<P`(>P`0C``(:P``
M.0``8P`0E``0G``AI0`0I0`AK0!"O1ACQC%CQCE2QB$IS@`8O0`0K0`8K0`A
MO0"4UF.MUGN$UE)*WA@AU@`8Q@`8M0``*0!"SA#.YY3>YZW&YY24YV-2YR$A
MW@`8S@!2WB&<YVO6[YR][XR$[U)"[Q"M[WNEWG-:[RDAYP`8U@`QYP!2[R%K
M[SE*[Q@IYP`I[P`Q[P`(A``0M0``````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````````````````````````````````````````I
MU?G9`````7123E,`0.;89@```!9T15AT4V]F='=A<F4`9VEF,G!N9R`R+C`N
M,3U>OF@```%M241!5'B<==)M5\(@%`=P#VS(@,$$U^-<J=LH*^FYM"RS[_^9
MB+F'LRSOJYWS._<R^-]>KRU;5>]/60`]SX,0^'\8HC[&`29]Y('?:!&F+.2<
MAR(@R.NVVF@02C4<#N-8<H&C+B+*U<'AT?'):3**.<,(M@8Q3\].SL?CR33+
M"\4%T<V9-F*JN)A<SJZN;^8F25481%Y]&>#:LMN[^]G#XU-FDB)VC<V)WD`6
M9]/KYY?'U\72F1N*4374:J'R[.U]M?KX-%E>_PW8#K614(E9K+_6\Z7)DR)5
M&]$:$C(QV7R9F9)&BH>4:+^V`8\38\HF1ZGD+*AN[TSC4*5)7LIWJN2V#52)
M6-AWSS)*"R>Q(T9Q!/W:?$T$ERJ.E9)RP\KW!$V2%B)"RQ`XWX2"D@ZY1A=>
M0!EC0M"@W]+6K`]T1##&U$6K84.VWA,`-4*11EZU$YV]<1^^#V&Y+*TTV=K_
MJK<?N]NT5W;QG_7=A1_-8>>-T@@L+````"5T15AT0V]M;65N=`!C;&EP,F=I
F9B!V+C`N-B!B>2!9=F5S(%!I9W5E=#9S.[P`````245.1*Y"8((`
`
end
--=====================_716177458==_
Content-Type: image/png; name="blueball.png"
Content-Transfer-Encoding: x-uuencode
Content-Disposition: attachment; filename="blueball.png"
begin 600 blueball.png
MB5!.1PT*&@H````-24A$4@```!L````;"`,```"Z"@1G```#`%!,5$7___\`
M``@``!```!@`````""D`$$(`$$H`"#$`$%(((7,(*7L(*80((6L`&%H`"#D(
M(6,0.9P80J480JT80K40.:40,90`&%(0,8PI4K4Y8\8Y8\XI6LX82LX80LX8
M0KU":\9[G-:<O=Z,M=YCE.<Q:]XA4MX82M880L80,:4``"'.Y^_G[^^<QN]2
MA.\I6N<0.:U*>\ZMSMZESN]:C.\0,9Q:A-:MUN?.[^^,O>]*>^\8.:482L:,
MO>>UY^^4O>\``"E:C.=SI>]KG.\(*8PQ8^\I6N\((7L`````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````````````````#!
M,@U5`````7123E,`0.;89@```!9T15AT4V]F='=A<F4`9VEF,G!N9R`R+C`N
M,3U>OF@```&(241!5'B<==)M5YLP&`;@$DZ`)A!2DX;,"4RG!2+:JHO;K&_;
M?/G_ORA[TE;LL<>;+YQSG3LAY!F-A@0H1"APHYT$.(HA48+#CXS'A*80DK$H
M0=OH<DXG>T(*,54I*9+0#>J23(LO^U\/RJJ64PV(!L1,[WT[//I^?#)K6MGI
M+#)O>P8QG>P?GO:G9^?SIFP7BC"\*;J$:W%QV??]U8]Y4]7"4I:#>0PB,I'7
M/_O^U^^;65/60H&%:PMCNKR]OKN_?_"U5B[>S3T66I0'?_[^N_&[U:+3A*_,
MC1QF3Z*=S9]?&D]R:M,L3@9+EW75@%1`"ZLIC_UW>GLLJ)5M65:W-=!2:<+\
M^59F8J*F==U"28H.B,.2&PMSEJJE%%(N.JOT:U9$9K4D6("++%6VZZRU*O6$
MUS5_B#`'U$HIG5+"BR@9"(HF'W-"*7TEG(^!UBNNS"&3QP7CG#.X=[-I;7XV
M8))'D!PF`FV3QP`9@XT)W^7M;OUK@.`9P&T-Q6ZVI^E3^8B[X[L#_P$45,S8
MF6D.OP```"5T15AT0V]M;65N=`!C;&EP,F=I9B!V+C`N-B!B>2!9=F5S(%!I
49W5E=#9S.[P`````245.1*Y"8((`
`
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"
]
}
},
"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": [
{
"header": {
"content_type": {
"c_type": "text",
"c_subtype": "plain",
"attributes": {
"charset": "us-ascii"
}
}
},
"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"
}
1
],
"attachments": [
2,
3
],
"parts": [
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "greenball.png"
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519004755.00a86100@pop.example.com"
},
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 50,
"second": 8,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"content_transfer_encoding": "x-uuencode",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "greenball.png"
}
}
"offset_start": 175,
"offset_end": 209
},
"contents": [
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "jschmuergen@example.com"
}
},
"offset_start": 212,
"offset_end": 257
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_start": 262,
"offset_end": 299
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "The Hare and the Tortoise"
},
"offset_start": 307,
"offset_end": 335
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_start": 348,
"offset_end": 354
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"=====================_716177458==_"
]
]
}
},
"offset_start": 367,
"offset_end": 434
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 436,
"offset_end": 5448
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_start": 487,
"offset_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": 1286
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"greenball.png"
]
]
}
},
"offset_start": 1339,
"offset_end": 1373
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "x-uuencode"
},
"offset_start": 1399,
"offset_end": 1412
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"greenball.png"
]
]
}
},
"offset_start": 1432,
"offset_end": 1471
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
13,
10,
98,
@@ -2038,30 +2077,67 @@ end
110,
100,
13,
10,
13
10
]
}
},
"offset_header": 1326,
"offset_body": 1473,
"offset_end": 3327
},
{
"Binary": {
"header": {
"content_disposition": {
"c_type": "attachment",
"attributes": {
"filename": "blueball.png"
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "png",
"attributes": [
[
"name",
"blueball.png"
]
]
}
},
"content_transfer_encoding": "x-uuencode",
"content_type": {
"c_type": "image",
"c_subtype": "png",
"attributes": {
"name": "blueball.png"
}
}
"offset_start": 3380,
"offset_end": 3413
},
"contents": [
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "x-uuencode"
},
"offset_start": 3439,
"offset_end": 3452
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"blueball.png"
]
]
}
},
"offset_start": 3472,
"offset_end": 3510
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
13,
10,
98,
@@ -3953,10 +4029,12 @@ end
110,
100,
13,
10,
13
10
]
}
},
"offset_header": 3367,
"offset_body": 3512,
"offset_end": 5404
}
]
}
+138
View File
@@ -0,0 +1,138 @@
Message-Id: <4.2.0.58.20000519003143.00a8d550@pop.example.com>
X-Sender: dwsauder@pop.example.com (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
X-Priority: 2 (High)
Date: Fri, 19 May 2000 00:33:01 -0400
To: Heinz =?iso-8859-1?Q?Müller?= <mueller@example.com>
From: Doug Sauder <dwsauder@example.com>
Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Frösche?=
Mime-Version: 1.0
Content-Type: multipart/related;
type="multipart/alternative";
boundary="=====================_715157131==_.REL"
--=====================_715157131==_.REL
Content-Type: multipart/alternative;
boundary="=====================_715157141==_.ALT"
--=====================_715157141==_.ALT
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
blueball.png
Die Hasen und die Fr=F6sche
Die Hasen klagten einst =FCber ihre mi=DFliche 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 =E4rger als der=
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;=
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt=
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
aufs schnellste untertauchten.=20
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch 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
redball.png
--=====================_715157141==_.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<img src=3D"cid:4.2.0.58.20000519003143.00a8d550@pop.example.com.0" width=3D27=
height=3D27 alt=3D"blueball.png"><br>
<br>
<font face=3D"Arial, Helvetica" size=3D5 color=3D"#0000FF"><b>Die Hasen und =
die
Fr=F6sche<br>
<br>
</font></b><font face=3D"Arial, Helvetica">Die Hasen klagten einst =FCber
ihre mi=DFliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in
steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,
ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der Tod selbst.
Auf, la=DFt uns ein f=FCr allemal sterben.&quot; <br>
<br>
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie au=
fs
schnellste untertauchten. <br>
<br>
&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das
Ers=E4ufen noch ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr
seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als
wir.&quot; <br>
<br>
<img src=3D"cid:4.2.0.58.20000519003143.00a8d550@pop.example.com.1" width=3D27=
height=3D27 alt=3D"redball.png"></font></html>
--=====================_715157141==_.ALT--
--=====================_715157131==_.REL
Content-Type: image/png; name="blueball.png"
Content-ID: <4.2.0.58.20000519003143.00a8d550@pop.example.com.0>
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="blueball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgAAAAA
CCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQMZQAGFIQ
MYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYYQsYQMaUAACHO
5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9Ke+8YOaUYSsaMvee1
5++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAADBMg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAGISURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbssceb
L5xznTsh5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18P
yqqWUw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/MjRxm
T6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1CSYoOiMOS
GwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIomH3NCKX0lnI+B
1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0NxW62p+lT+Yi747sD
/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZz
O7wAAAAASUVORK5CYII=
--=====================_715157131==_.REL
Content-Type: image/png; name="redball.png"
Content-ID: <4.2.0.58.20000519003143.00a8d550@pop.example.com.1>
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="redball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
--=====================_715157131==_.REL--
File diff suppressed because it is too large Load Diff
-3045
View File
File diff suppressed because it is too large Load Diff
+144
View File
@@ -0,0 +1,144 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:42:10 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGGEKFCHAA.doug@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0008_01BFC037.FDD8EE90"
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
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01BFC037.FDD8EE90
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0009_01BFC037.FDD8EE90"
------=_NextPart_001_0009_01BFC037.FDD8EE90
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The Hare and the Tortoise=20
=20
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. =20
=20
Slow but steady wins the race. =20
------=_NextPart_001_0009_01BFC037.FDD8EE90
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
<BODY>
<DIV><BR><FONT face=3DArial size=3D2>The Hare and the Tortoise =
<BR>&nbsp;<BR>A HARE=20
one day ridiculed the short feet and slow pace of the Tortoise, who =
replied,=20
laughing:&nbsp; "Though you be swift as the wind, I will beat you in a=20
race."&nbsp; The Hare, believing her assertion to be simply impossible, =
assented=20
to the proposal; and they agreed that the Fox should choose the course =
and fix=20
the goal.&nbsp; On the day appointed for the race the two started=20
together.&nbsp; The Tortoise never for a moment stopped, but went on =
with a slow=20
but steady pace straight to the end of the course.&nbsp; The Hare, lying =
down by=20
the wayside, fell fast asleep.&nbsp; At last waking up, and moving as =
fast as he=20
could, he saw the Tortoise had reached the goal, and was comfortably =
dozing=20
after her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the =
race.&nbsp;=20
<BR></FONT></DIV></BODY></HTML>
------=_NextPart_001_0009_01BFC037.FDD8EE90--
------=_NextPart_000_0008_01BFC037.FDD8EE90
Content-Type: image/png;
name="greenball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="greenball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAAAEAAAGAAAIQAA
CAAAMQAAQgAAUgAAWgAASgAIYwAIcwAIewAQjAAIawAAOQAAYwAQlAAQnAAhpQAQpQAhrQBCvRhj
xjFjxjlSxiEpzgAYvQAQrQAYrQAhvQCU1mOt1nuE1lJK3hgh1gAYxgAYtQAAKQBCzhDO55Te563G
55SU52NS5yEh3gAYzgBS3iGc52vW75y974yE71JC7xCt73ul3nNa7ykh5wAY1gAx5wBS7yFr7zlK
7xgp5wAp7wAx7wAIhAAQtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAp1fnZAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAFtSURBVHicddJtV8IgFAdwD2zIgMEE1+NcqdsoK+m5tCyz7/+ZiLmHsyzvq53zO/cy
+N9ery1bVe9PWQA9z4MQ+H8Yoj7GASZ95IHfaBGmLOSchyIgyOu22mgQSjUcDuNYcoGjLiLK1cHh
0fHJaTKKOcMItgYxT89OzsfjyTTLC8UF0c2ZNmKquJhczq6ub+YmSVUYRF59GeDastu7+9nD41Nm
kiJ2jc2J3kAWZ9Pr55fH18XSmRuKUTXUaqHy7O19tfr4NFle/w3YDrWRUIlZrL/W86XJkyJVG9Ea
EjIx2XyZmZJGioeUaL+2AY8TY8omR6nkLKhu70zjUKVJXsp3quS2DVSJWNh3zzJKCyexI0ZxBP3a
fE0ElyqOlZJyw8r3BE2SFiJCyxA434SCkg65RhdeQBljQtCg39LWrA90RDDG1EWrYUO23hMANUKR
Rl61E529cR++D2G5LK002dr/qrcfu9u0V3bxn/XdhR/NYeeN0ggsLAAAACV0RVh0Q29tbWVudABj
bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
------=_NextPart_000_0008_01BFC037.FDD8EE90
Content-Type: image/png;
name="redball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="redball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_0008_01BFC037.FDD8EE90--

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