├── .github └── workflows │ └── rust.yml ├── .gitignore ├── CHANGELOG.md ├── Cargo.toml ├── LICENSES ├── Apache-2.0.txt └── MIT.txt ├── README.md ├── examples ├── custom_parser.rs ├── mailbox_iterate_maildir.rs ├── mailbox_parse_mbox.rs ├── message_parse.rs └── message_write_attachments.rs ├── flamegraph.sh ├── fuzz ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── fuzz_targets │ └── mail_parser.rs ├── resources ├── address.json ├── content_type.json ├── date.json ├── eml │ ├── legacy │ │ ├── 000.crlf.json │ │ ├── 000.eml │ │ ├── 000.json │ │ ├── 001.crlf.json │ │ ├── 001.eml │ │ ├── 001.json │ │ ├── 002.crlf.json │ │ ├── 002.eml │ │ ├── 002.json │ │ ├── 003.crlf.json │ │ ├── 003.eml │ │ ├── 003.json │ │ ├── 004.crlf.json │ │ ├── 004.eml │ │ ├── 004.json │ │ ├── 005.crlf.json │ │ ├── 005.eml │ │ ├── 005.json │ │ ├── 006.crlf.json │ │ ├── 006.eml │ │ ├── 006.json │ │ ├── 007.crlf.json │ │ ├── 007.eml │ │ ├── 007.json │ │ ├── 008.crlf.json │ │ ├── 008.eml │ │ ├── 008.json │ │ ├── 009.crlf.json │ │ ├── 009.eml │ │ ├── 009.json │ │ ├── 010.crlf.json │ │ ├── 010.eml │ │ ├── 010.json │ │ ├── 011.crlf.json │ │ ├── 011.eml │ │ ├── 011.json │ │ ├── 012.crlf.json │ │ ├── 012.eml │ │ ├── 012.json │ │ ├── 013.crlf.json │ │ ├── 013.eml │ │ ├── 013.json │ │ ├── 014.crlf.json │ │ ├── 014.eml │ │ ├── 014.json │ │ ├── 015.crlf.json │ │ ├── 015.eml │ │ ├── 015.json │ │ ├── 016.crlf.json │ │ ├── 016.eml │ │ ├── 016.json │ │ ├── 017.crlf.json │ │ ├── 017.eml │ │ ├── 017.json │ │ ├── 018.crlf.json │ │ ├── 018.eml │ │ ├── 018.json │ │ ├── 019.crlf.json │ │ ├── 019.eml │ │ ├── 019.json │ │ ├── 020.crlf.json │ │ ├── 020.eml │ │ ├── 020.json │ │ ├── 021.crlf.json │ │ ├── 021.eml │ │ ├── 021.json │ │ ├── 022.crlf.json │ │ ├── 022.eml │ │ ├── 022.json │ │ ├── 023.crlf.json │ │ ├── 023.eml │ │ ├── 023.json │ │ ├── 024.crlf.json │ │ ├── 024.eml │ │ ├── 024.json │ │ ├── 025.crlf.json │ │ ├── 025.eml │ │ ├── 025.json │ │ ├── 026.crlf.json │ │ ├── 026.eml │ │ ├── 026.json │ │ ├── 027.crlf.json │ │ ├── 027.eml │ │ ├── 027.json │ │ ├── 028.crlf.json │ │ ├── 028.eml │ │ ├── 028.json │ │ ├── 029.crlf.json │ │ ├── 029.eml │ │ ├── 029.json │ │ ├── 030.crlf.json │ │ ├── 030.eml │ │ ├── 030.json │ │ ├── 031.crlf.json │ │ ├── 031.eml │ │ ├── 031.json │ │ ├── 032.crlf.json │ │ ├── 032.eml │ │ ├── 032.json │ │ ├── 033.crlf.json │ │ ├── 033.eml │ │ ├── 033.json │ │ ├── 034.crlf.json │ │ ├── 034.eml │ │ ├── 034.json │ │ ├── 035.crlf.json │ │ ├── 035.eml │ │ ├── 035.json │ │ ├── 036.crlf.json │ │ ├── 036.eml │ │ ├── 036.json │ │ ├── 037.crlf.json │ │ ├── 037.eml │ │ ├── 037.json │ │ ├── 038.crlf.json │ │ ├── 038.eml │ │ ├── 038.json │ │ ├── 039.crlf.json │ │ ├── 039.eml │ │ ├── 039.json │ │ ├── 040.crlf.json │ │ ├── 040.eml │ │ ├── 040.json │ │ ├── 041.crlf.json │ │ ├── 041.eml │ │ ├── 041.json │ │ ├── 042.crlf.json │ │ ├── 042.eml │ │ ├── 042.json │ │ ├── 043.crlf.json │ │ ├── 043.eml │ │ ├── 043.json │ │ ├── 044.crlf.json │ │ ├── 044.eml │ │ ├── 044.json │ │ ├── 045.crlf.json │ │ ├── 045.eml │ │ ├── 045.json │ │ ├── 046.crlf.json │ │ ├── 046.eml │ │ ├── 046.json │ │ ├── 047.crlf.json │ │ ├── 047.eml │ │ ├── 047.json │ │ ├── 048.crlf.json │ │ ├── 048.eml │ │ ├── 048.json │ │ ├── 049.crlf.json │ │ ├── 049.eml │ │ ├── 049.json │ │ ├── 050.crlf.json │ │ ├── 050.eml │ │ ├── 050.json │ │ ├── 051.crlf.json │ │ ├── 051.eml │ │ ├── 051.json │ │ ├── 052.crlf.json │ │ ├── 052.eml │ │ ├── 052.json │ │ ├── 053.crlf.json │ │ ├── 053.eml │ │ ├── 053.json │ │ └── COPYING │ ├── malformed │ │ ├── 000.crlf.json │ │ ├── 000.eml │ │ ├── 000.json │ │ ├── 001.crlf.json │ │ ├── 001.eml │ │ ├── 001.json │ │ ├── 002.crlf.json │ │ ├── 002.eml │ │ ├── 002.json │ │ ├── 003.crlf.json │ │ ├── 003.eml │ │ ├── 003.json │ │ ├── 004.crlf.json │ │ ├── 004.eml │ │ ├── 004.json │ │ ├── 005.crlf.json │ │ ├── 005.eml │ │ ├── 005.json │ │ ├── 006.crlf.json │ │ ├── 006.eml │ │ ├── 006.json │ │ ├── 007.crlf.json │ │ ├── 007.eml │ │ ├── 007.json │ │ ├── 008.crlf.json │ │ ├── 008.eml │ │ ├── 008.json │ │ ├── 009.crlf.json │ │ ├── 009.eml │ │ ├── 009.json │ │ ├── 010.crlf.json │ │ ├── 010.eml │ │ ├── 010.json │ │ ├── 011.crlf.json │ │ ├── 011.eml │ │ ├── 011.json │ │ ├── 012.crlf.json │ │ ├── 012.eml │ │ ├── 012.json │ │ ├── 013.crlf.json │ │ ├── 013.eml │ │ ├── 013.json │ │ ├── 014.crlf.json │ │ ├── 014.eml │ │ ├── 014.json │ │ ├── 015.crlf.json │ │ ├── 015.eml │ │ ├── 015.json │ │ ├── 016.crlf.json │ │ ├── 016.eml │ │ ├── 016.json │ │ ├── 017.crlf.json │ │ ├── 017.eml │ │ ├── 017.json │ │ ├── 018.crlf.json │ │ ├── 018.eml │ │ ├── 018.json │ │ └── COPYING │ ├── rfc │ │ ├── 000.crlf.json │ │ ├── 000.eml │ │ ├── 000.json │ │ ├── 001.crlf.json │ │ ├── 001.eml │ │ ├── 001.json │ │ ├── 002.crlf.json │ │ ├── 002.eml │ │ ├── 002.json │ │ ├── 003.crlf.json │ │ ├── 003.eml │ │ ├── 003.json │ │ ├── 004.crlf.json │ │ ├── 004.eml │ │ ├── 004.json │ │ ├── 005.crlf.json │ │ ├── 005.eml │ │ ├── 005.json │ │ ├── 006.crlf.json │ │ ├── 006.eml │ │ ├── 006.json │ │ ├── 007.crlf.json │ │ ├── 007.eml │ │ ├── 007.json │ │ ├── 008.crlf.json │ │ ├── 008.eml │ │ ├── 008.json │ │ ├── 009.crlf.json │ │ ├── 009.eml │ │ └── 009.json │ └── thirdparty │ │ ├── 000.crlf.json │ │ ├── 000.eml │ │ ├── 000.json │ │ ├── 001.crlf.json │ │ ├── 001.eml │ │ ├── 001.json │ │ ├── 002.crlf.json │ │ ├── 002.eml │ │ ├── 002.json │ │ ├── 003.crlf.json │ │ ├── 003.eml │ │ ├── 003.json │ │ ├── 004.crlf.json │ │ ├── 004.eml │ │ ├── 004.json │ │ ├── 005.crlf.json │ │ ├── 005.eml │ │ ├── 005.json │ │ ├── 006.crlf.json │ │ ├── 006.eml │ │ ├── 006.json │ │ ├── 007.crlf.json │ │ ├── 007.eml │ │ ├── 007.json │ │ ├── 008.crlf.json │ │ ├── 008.eml │ │ ├── 008.json │ │ ├── 009.crlf.json │ │ ├── 009.eml │ │ ├── 009.json │ │ ├── 010.crlf.json │ │ ├── 010.eml │ │ ├── 010.json │ │ ├── 011.crlf.json │ │ ├── 011.eml │ │ ├── 011.json │ │ ├── 012.crlf.json │ │ ├── 012.eml │ │ ├── 012.json │ │ ├── 013.crlf.json │ │ ├── 013.eml │ │ ├── 013.json │ │ └── COPYING ├── id.json ├── list.json ├── maildir │ ├── .My Folder.Nested Folder │ │ ├── cur │ │ │ └── 1276533073.M242911P3632.kurkku;2,FP │ │ └── new │ │ │ └── 1035478339.27041_118.foo.org,S=1000,W=1030;2,RDF, │ ├── .My Folder │ │ ├── cur │ │ │ └── 1035478339.27041_118.foo.org,S=1000,W=1030;2,TDR │ │ └── new │ │ │ └── 1276528487.M364837P9451.kurkku,S=1355,W=1394;2, │ ├── cur │ │ └── 1491941793.M41850P8566V0000000000000015I0000000004F3030E_0.mx1.example.com,S=10956;2,STln │ └── new │ │ └── 1234567890.M20046P2137.mailserver,S=4542,W=4642;2,Sb ├── received.json └── unstructured.json ├── src ├── core │ ├── address.rs │ ├── body.rs │ ├── builder.rs │ ├── header.rs │ ├── message.rs │ ├── mod.rs │ └── rkyv.rs ├── decoders │ ├── base64.rs │ ├── charsets │ │ ├── map.rs │ │ ├── mod.rs │ │ ├── multi_byte.rs │ │ ├── single_byte.rs │ │ └── utf.rs │ ├── encoded_word.rs │ ├── hex.rs │ ├── html.rs │ ├── mod.rs │ └── quoted_printable.rs ├── lib.rs ├── mailbox │ ├── maildir.rs │ ├── mbox.rs │ └── mod.rs └── parsers │ ├── fields │ ├── address.rs │ ├── content_type.rs │ ├── date.rs │ ├── id.rs │ ├── list.rs │ ├── mod.rs │ ├── raw.rs │ ├── received.rs │ ├── thread.rs │ └── unstructured.rs │ ├── header.rs │ ├── message.rs │ ├── mime.rs │ ├── mod.rs │ └── preview.rs └── tests └── integration_test.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: "CI" 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Build 20 | run: cargo build --verbose 21 | - name: Run tests 22 | run: cargo test --verbose 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /test 3 | perf.* 4 | *.svg 5 | Cargo.lock 6 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mail-parser" 3 | description = "Fast and robust e-mail parsing library for Rust" 4 | version = "0.11.0" 5 | edition = "2021" 6 | authors = [ "Stalwart Labs "] 7 | license = "Apache-2.0 OR MIT" 8 | repository = "https://github.com/stalwartlabs/mail-parser" 9 | homepage = "https://github.com/stalwartlabs/mail-parser" 10 | keywords = ["email", "mail", "parser", "parse", "mime"] 11 | categories = ["email", "parser-implementations"] 12 | readme = "README.md" 13 | resolver = "2" 14 | 15 | [dependencies] 16 | hashify = { version = "0.2" } 17 | encoding_rs = { version = "0.8", optional = true } 18 | serde = { version = "1.0", features = ["derive"], optional = true } 19 | rkyv = { version = "0.8", optional = true } 20 | 21 | [dev-dependencies] 22 | mail-parser = { path = ".", features = ["serde", "full_encoding"] } 23 | serde = { version = "1.0", features = ["derive"] } 24 | serde_json = "1.0" 25 | bincode = "1.3.3" 26 | chrono = "0.4" 27 | 28 | [features] 29 | default = ["full_encoding"] 30 | full_encoding = ["encoding_rs"] 31 | serde = ["dep:serde"] 32 | rkyv = ["dep:rkyv"] 33 | 34 | [profile.bench] 35 | debug = true 36 | 37 | [lib] 38 | doctest = false 39 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /examples/custom_parser.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use mail_parser::{HeaderName, MessageParser}; 8 | 9 | const MESSAGE: &str = r#"From: Art Vandelay (Vandelay Industries) 10 | To: "Colleagues": "James Smythe" ; Friends: 11 | jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= ; 12 | Date: Sat, 20 Nov 2021 14:22:01 -0800 13 | Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?= 14 | Content-Type: multipart/mixed; boundary="festivus"; 15 | 16 | --festivus 17 | Content-Type: text/html; charset="us-ascii" 18 | Content-Transfer-Encoding: base64 19 | 20 | PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle 21 | HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm 22 | cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8 23 | gJiN4MjYzQTs8L3A+PC9odG1sPg== 24 | --festivus 25 | Content-Type: message/rfc822 26 | 27 | From: "Cosmo Kramer" 28 | Subject: Exporting my book about coffee tables 29 | Content-Type: multipart/mixed; boundary="giddyup"; 30 | 31 | --giddyup 32 | Content-Type: text/plain; charset="utf-16" 33 | Content-Transfer-Encoding: quoted-printable 34 | 35 | =FF=FE=0C!5=D8"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8"=DD =005=D8"= 36 | =DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD = 37 | =005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8"= 38 | =DD5=D8=1E=DD5=D80=DD5=D8"=DD!=00 39 | --giddyup 40 | Content-Type: image/gif; name*1="about "; name*0="Book "; 41 | name*2*=utf-8''%e2%98%95 tables.gif 42 | Content-Transfer-Encoding: Base64 43 | Content-Disposition: attachment 44 | 45 | R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 46 | --giddyup-- 47 | --festivus-- 48 | "#; 49 | 50 | fn main() { 51 | // Parse only the message headers 52 | let _headers = MessageParser::new() 53 | .parse_headers(MESSAGE) 54 | .unwrap() 55 | .headers(); 56 | 57 | // Parse only the message body, ignoring all headers (except MIME headers, which are required to parse the body) 58 | let _message = MessageParser::new() 59 | .with_mime_headers() 60 | .default_header_ignore() 61 | .parse(MESSAGE) 62 | .unwrap(); 63 | 64 | // Parse only To, From, Date, and Subject headers. All other headers are parsed as raw. 65 | let _message = MessageParser::new() 66 | .with_mime_headers() 67 | .header_text(HeaderName::Subject) 68 | .header_address(HeaderName::From) 69 | .header_address(HeaderName::To) 70 | .header_date(HeaderName::Date) 71 | .default_header_raw() 72 | .parse(MESSAGE) 73 | .unwrap(); 74 | } 75 | -------------------------------------------------------------------------------- /examples/mailbox_iterate_maildir.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use std::path::PathBuf; 8 | 9 | use mail_parser::mailbox::maildir::FolderIterator; 10 | 11 | fn main() { 12 | // Iterates a Maildir++ structure printing the results to stdout. 13 | for folder in FolderIterator::new( 14 | PathBuf::from(env!("CARGO_MANIFEST_DIR")) 15 | .join("resources") 16 | .join("maildir"), 17 | ".".into(), 18 | ) 19 | .unwrap() 20 | { 21 | let folder = folder.unwrap(); 22 | println!("------\nMailbox: {:?}", folder.name().unwrap_or("INBOX")); 23 | 24 | for message in folder { 25 | let message = message.unwrap(); 26 | println!( 27 | "Message with internal date {}, flags {:?} and content {:?}.", 28 | message.internal_date(), 29 | message.flags(), 30 | String::from_utf8_lossy(message.contents()) 31 | ); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /examples/mailbox_parse_mbox.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use mail_parser::{mailbox::mbox::MessageIterator, MessageParser}; 8 | 9 | fn main() { 10 | // Reads an MBox mailbox from stdin and prints each message as JSON. 11 | for raw_message in MessageIterator::new(std::io::stdin().lock()) { 12 | let raw_message = raw_message.unwrap(); 13 | let message = MessageParser::default() 14 | .parse(raw_message.contents()) 15 | .unwrap(); 16 | 17 | println!("{}", serde_json::to_string(&message).unwrap()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/message_write_attachments.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use mail_parser::*; 8 | 9 | fn main() { 10 | let input = br#"From: Art Vandelay (Vandelay Industries) 11 | To: "Colleagues": "James Smythe" ; Friends: 12 | jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= ; 13 | Date: Sat, 20 Nov 2021 14:22:01 -0800 14 | Subject: Why not both importing AND exporting? =?utf-8?b?4pi6?= 15 | Content-Type: multipart/mixed; boundary="festivus"; 16 | 17 | --festivus 18 | Content-Type: text/html; charset="us-ascii" 19 | Content-Transfer-Encoding: base64 20 | 21 | PGh0bWw+PHA+SSB3YXMgdGhpbmtpbmcgYWJvdXQgcXVpdHRpbmcgdGhlICZsZHF1bztle 22 | HBvcnRpbmcmcmRxdW87IHRvIGZvY3VzIGp1c3Qgb24gdGhlICZsZHF1bztpbXBvcnRpbm 23 | cmcmRxdW87LDwvcD48cD5idXQgdGhlbiBJIHRob3VnaHQsIHdoeSBub3QgZG8gYm90aD8 24 | gJiN4MjYzQTs8L3A+PC9odG1sPg== 25 | --festivus 26 | Content-Type: message/rfc822; name="Exporting my book about coffee tables.eml" 27 | Content-Disposition: inline; filename="Exporting my book about coffee tables.eml" 28 | Content-Transfer-Encoding: 7bit 29 | 30 | From: "Cosmo Kramer" 31 | Subject: Exporting my book about coffee tables 32 | Content-Type: multipart/mixed; boundary="giddyup"; 33 | 34 | --giddyup 35 | Content-Type: text/plain; charset="utf-16" 36 | Content-Transfer-Encoding: quoted-printable 37 | 38 | =FF=FE=0C!5=D8"=DD5=D8)=DD5=D8-=DD =005=D8*=DD5=D8"=DD =005=D8"= 39 | =DD5=D85=DD5=D8-=DD5=D8,=DD5=D8/=DD5=D81=DD =005=D8*=DD5=D86=DD = 40 | =005=D8=1F=DD5=D8,=DD5=D8,=DD5=D8(=DD =005=D8-=DD5=D8)=DD5=D8"= 41 | =DD5=D8=1E=DD5=D80=DD5=D8"=DD!=00 42 | --giddyup 43 | Content-Type: image/gif; name*1="about "; name*0="Book "; 44 | name*2*=utf-8''%e2%98%95 tables.gif 45 | Content-Transfer-Encoding: Base64 46 | Content-Disposition: attachment 47 | 48 | R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 49 | --giddyup-- 50 | --festivus-- 51 | "#; 52 | 53 | write_attachments(&MessageParser::default().parse(input).unwrap()); 54 | } 55 | 56 | fn write_attachments(message: &Message) { 57 | for attachment in message.attachments() { 58 | if !attachment.is_message() { 59 | std::fs::write( 60 | attachment.attachment_name().unwrap_or("Untitled"), 61 | attachment.contents(), 62 | ) 63 | .unwrap(); 64 | } else { 65 | write_attachments(attachment.message().unwrap()); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /flamegraph.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | perf record -F max --call-graph dwarf target/release/mail-parser 4 | perf script | inferno-collapse-perf | inferno-flamegraph > flamegraph.svg 5 | -------------------------------------------------------------------------------- /fuzz/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | corpus 3 | artifacts 4 | -------------------------------------------------------------------------------- /fuzz/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "arbitrary" 7 | version = "1.0.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "577b08a4acd7b99869f863c50011b01eb73424ccc798ecd996f2e24817adfca7" 10 | 11 | [[package]] 12 | name = "cc" 13 | version = "1.0.71" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" 16 | 17 | [[package]] 18 | name = "cfg-if" 19 | version = "1.0.0" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 22 | 23 | [[package]] 24 | name = "encoding_rs" 25 | version = "0.8.29" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746" 28 | dependencies = [ 29 | "cfg-if", 30 | ] 31 | 32 | [[package]] 33 | name = "hashify" 34 | version = "0.2.6" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "f208758247e68e239acaa059e72e4ce1f30f2a4b6523f19c1b923d25b7e9cceb" 37 | dependencies = [ 38 | "proc-macro2", 39 | "quote", 40 | "syn", 41 | ] 42 | 43 | [[package]] 44 | name = "libfuzzer-sys" 45 | version = "0.4.2" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "36a9a84a6e8b55dfefb04235e55edb2b9a2a18488fcae777a6bdaa6f06f1deb3" 48 | dependencies = [ 49 | "arbitrary", 50 | "cc", 51 | "once_cell", 52 | ] 53 | 54 | [[package]] 55 | name = "mail-parser" 56 | version = "0.10.2" 57 | dependencies = [ 58 | "encoding_rs", 59 | "hashify", 60 | ] 61 | 62 | [[package]] 63 | name = "mail-parser-fuzz" 64 | version = "0.0.0" 65 | dependencies = [ 66 | "libfuzzer-sys", 67 | "mail-parser", 68 | ] 69 | 70 | [[package]] 71 | name = "once_cell" 72 | version = "1.8.0" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" 75 | 76 | [[package]] 77 | name = "proc-macro2" 78 | version = "1.0.93" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" 81 | dependencies = [ 82 | "unicode-ident", 83 | ] 84 | 85 | [[package]] 86 | name = "quote" 87 | version = "1.0.38" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" 90 | dependencies = [ 91 | "proc-macro2", 92 | ] 93 | 94 | [[package]] 95 | name = "syn" 96 | version = "2.0.98" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" 99 | dependencies = [ 100 | "proc-macro2", 101 | "quote", 102 | "unicode-ident", 103 | ] 104 | 105 | [[package]] 106 | name = "unicode-ident" 107 | version = "1.0.17" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" 110 | -------------------------------------------------------------------------------- /fuzz/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mail-parser-fuzz" 3 | version = "0.0.0" 4 | authors = ["Automatically generated"] 5 | publish = false 6 | edition = "2018" 7 | 8 | [package.metadata] 9 | cargo-fuzz = true 10 | 11 | [dependencies] 12 | libfuzzer-sys = "0.4" 13 | 14 | [dependencies.mail-parser] 15 | path = ".." 16 | 17 | # Prevent this from interfering with workspaces 18 | [workspace] 19 | members = ["."] 20 | 21 | [[bin]] 22 | name = "mail_parser" 23 | path = "fuzz_targets/mail_parser.rs" 24 | test = false 25 | doc = false 26 | -------------------------------------------------------------------------------- /fuzz/fuzz_targets/mail_parser.rs: -------------------------------------------------------------------------------- 1 | #![no_main] 2 | use libfuzzer_sys::fuzz_target; 3 | 4 | use mail_parser::{ 5 | decoders::{ 6 | base64::base64_decode, 7 | charsets::map::charset_decoder, 8 | hex::decode_hex, 9 | html::{add_html_token, html_to_text, text_to_html}, 10 | quoted_printable::quoted_printable_decode, 11 | }, 12 | parsers::{ 13 | fields::thread::{thread_name, trim_trailing_fwd}, 14 | MessageStream, 15 | }, 16 | Message, MessageParser, 17 | }; 18 | 19 | static RFC822_ALPHABET: &[u8] = b"0123456789abcdefghijklm:=- \r\n"; 20 | 21 | fuzz_target!(|data: &[u8]| { 22 | for data_ in [ 23 | std::borrow::Cow::from(data), 24 | std::borrow::Cow::from(into_alphabet(data, RFC822_ALPHABET)), 25 | ] { 26 | let data = data_.as_ref(); 27 | 28 | // Fuzz every parsing function 29 | MessageStream::new(data).parse_date(); 30 | MessageStream::new(data).parse_address(); 31 | MessageStream::new(data).parse_id(); 32 | MessageStream::new(data).parse_comma_separared(); 33 | MessageStream::new(data).parse_and_ignore(); 34 | MessageStream::new(data).parse_raw(); 35 | MessageStream::new(data).parse_unstructured(); 36 | MessageStream::new(data).parse_content_type(); 37 | MessageStream::new(data).parse_headers(&MessageParser::default(), &mut Vec::new()); 38 | MessageStream::new(data).parse_header_name(); 39 | MessageStream::new(data).decode_rfc2047(); 40 | 41 | MessageStream::new(data).seek_next_part(b"\n"); 42 | MessageStream::new(data).mime_part(b"\n"); 43 | MessageStream::new(data).seek_part_end(b"\n"[..].into()); 44 | MessageStream::new(data).skip_crlf(); 45 | MessageStream::new(data).is_multipart_end(); 46 | 47 | base64_decode(data); 48 | MessageStream::new(data).decode_base64_word(); 49 | MessageStream::new(data).decode_base64_mime(b"\n"); 50 | quoted_printable_decode(data); 51 | MessageStream::new(data).decode_quoted_printable_word(); 52 | MessageStream::new(data).decode_quoted_printable_mime(b"\n"); 53 | 54 | // Fuzz text functions 55 | let mut html_str = String::with_capacity(data.len()); 56 | let str_data = String::from_utf8_lossy(data); 57 | add_html_token(&mut html_str, str_data.as_ref().as_bytes(), false); 58 | html_to_text(&str_data); 59 | text_to_html(&str_data); 60 | thread_name(&str_data); 61 | trim_trailing_fwd(&str_data); 62 | 63 | // Fuzz decoding functions 64 | decode_hex(data); 65 | charset_decoder(data); 66 | 67 | // Fuzz the entire library 68 | MessageParser::default().parse(data); 69 | } 70 | }); 71 | 72 | fn into_alphabet(data: &[u8], alphabet: &[u8]) -> Vec { 73 | data.iter() 74 | .map(|&byte| alphabet[byte as usize % alphabet.len()]) 75 | .collect() 76 | } 77 | -------------------------------------------------------------------------------- /resources/eml/legacy/000.eml: -------------------------------------------------------------------------------- 1 | From: "Doug Sauder" 2 | To: "Joe Blow" 3 | Subject: Test message from Microsoft Outlook 00 4 | Date: Wed, 17 May 2000 19:35:05 -0400 5 | Message-ID: 6 | MIME-Version: 1.0 7 | Content-Type: image/png; 8 | name="redball.png" 9 | Content-Transfer-Encoding: base64 10 | Content-Disposition: attachment; 11 | filename="redball.png" 12 | X-Priority: 3 (Normal) 13 | X-MSMail-Priority: Normal 14 | X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) 15 | Importance: Normal 16 | X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 17 | 18 | iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa 19 | AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0 20 | AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM 21 | AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm 22 | f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB 23 | AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2 24 | AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH 25 | AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC 26 | AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe 27 | AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs 28 | AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV 29 | AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM 30 | AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 31 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 32 | AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu 33 | MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK 34 | iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ 35 | 29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW 36 | SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+ 37 | d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q 38 | m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV 39 | tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw 40 | HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5 41 | QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd 42 | tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5 43 | IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== 44 | -------------------------------------------------------------------------------- /resources/eml/legacy/001.eml: -------------------------------------------------------------------------------- 1 | From: "Doug Sauder" 2 | To: "Joe Blow" , 3 | =?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= 4 | Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?= 5 | Date: Wed, 17 May 2000 19:18:39 -0400 6 | Message-ID: 7 | MIME-Version: 1.0 8 | Content-Type: text/plain; 9 | charset="utf-7" 10 | Content-Transfer-Encoding: quoted-printable 11 | X-Priority: 3 (Normal) 12 | X-MSMail-Priority: Normal 13 | X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) 14 | Importance: Normal 15 | X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 16 | 17 | Die Hasen und die Fr+APY-sche 18 | 19 | Die Hasen klagten einst +APw-ber ihre mi+AN8-liche Lage+ADs- +ACI-wir = 20 | leben+ACI-, sprach ein Redner, +ACI-in steter Furcht vor Menschen und = 21 | Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere+ACE- = 22 | Unsere stete Angst ist +AOQ-rger als der Tod selbst. Auf, la+AN8-t uns = 23 | ein f+APw-r allemal sterben.+ACI-=20 24 | 25 | In einem nahen Teich wollten sie sich nun ers+AOQ-ufen+ADs- sie eilten = 26 | ihm zu+ADs- allein das au+AN8-erordentliche Get+APY-se und ihre = 27 | wunderbare Gestalt erschreckte eine Menge Fr+APY-sche, die am Ufer = 28 | sa+AN8-en, so sehr, da+AN8- sie aufs schnellste untertauchten.=20 29 | 30 | +ACI-Halt+ACI-, rief nun eben dieser Sprecher, +ACI-wir wollen das = 31 | Ers+AOQ-ufen noch ein wenig aufschieben, denn auch uns f+APw-rchten, wie = 32 | ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein = 33 | m+APw-ssen als wir.+ACI-=20 34 | 35 | -------------------------------------------------------------------------------- /resources/eml/legacy/002.eml: -------------------------------------------------------------------------------- 1 | Message-Id: <4.2.0.58.20000519003052.00a89c40@pop.example.com> 2 | X-Sender: dwsauder@pop.example.com (Unverified) 3 | X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 4 | X-Priority: 2 (High) 5 | Date: Fri, 19 May 2000 00:31:00 -0400 6 | To: Heinz =?iso-8859-1?Q?M=FCller?= 7 | From: Doug Sauder 8 | Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?= 9 | Mime-Version: 1.0 10 | Content-Type: text/html; charset="iso-8859-1" 11 | Content-Transfer-Encoding: quoted-printable 12 | 13 | 14 | Die Hasen und = 15 | die 16 | Fr=F6sche
17 |
18 |
Die Hasen klagten einst =FCber 19 | ihre mi=DFliche Lage; "wir leben", sprach ein Redner, "in 20 | steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, 21 | ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der Tod selbst. 22 | Auf, la=DFt uns ein f=FCr allemal sterben."
23 |
24 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; 25 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt 26 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie au= 27 | fs 28 | schnellste untertauchten.
29 |
30 | "Halt", rief nun eben dieser Sprecher, "wir wollen das 31 | Ers=E4ufen noch ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr 32 | seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als 33 | wir."
34 |
35 |
36 | 37 | -------------------------------------------------------------------------------- /resources/eml/legacy/003.eml: -------------------------------------------------------------------------------- 1 | Message-Id: <4.2.0.58.20000519002557.00a88870@pop.example.com> 2 | X-Sender: dwsauder@pop.example.com (Unverified) 3 | X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 4 | X-Priority: 2 (High) 5 | Date: Fri, 19 May 2000 00:29:55 -0400 6 | To: Heinz =?iso-8859-1?Q?M=FCller?= 7 | From: Doug Sauder 8 | Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?= 9 | Mime-Version: 1.0 10 | Content-Type: multipart/alternative; 11 | boundary="=====================_714967308==_.ALT" 12 | 13 | --=====================_714967308==_.ALT 14 | Content-Type: text/plain; charset="iso-8859-1" 15 | Content-Transfer-Encoding: quoted-printable 16 | 17 | Die Hasen und die Fr=F6sche 18 | 19 | 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,= 21 | der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der= 22 | Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20 23 | 24 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= 25 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt= 26 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie= 27 | aufs schnellste untertauchten.=20 28 | 29 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ein= 30 | wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere,= 31 | welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 32 | 33 | 34 | --=====================_714967308==_.ALT 35 | Content-Type: text/html; charset="iso-8859-1" 36 | Content-Transfer-Encoding: quoted-printable 37 | 38 | 39 | Die Hasen und = 40 | die 41 | Fr=F6sche
42 |
43 |
Die Hasen klagten einst =FCber 44 | ihre mi=DFliche Lage; "wir leben", sprach ein Redner, "in 45 | steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, 46 | ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der Tod selbst. 47 | Auf, la=DFt uns ein f=FCr allemal sterben."
48 |
49 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; 50 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt 51 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie au= 52 | fs 53 | schnellste untertauchten.
54 |
55 | "Halt", rief nun eben dieser Sprecher, "wir wollen das 56 | Ers=E4ufen noch ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr 57 | seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als 58 | wir."
59 |
60 |
61 | 62 | --=====================_714967308==_.ALT-- 63 | 64 | -------------------------------------------------------------------------------- /resources/eml/legacy/004.eml: -------------------------------------------------------------------------------- 1 | Message-Id: <4.2.0.58.20000519011207.00a8cd70@pop.example.com> 2 | X-Sender: dwsauder@pop.example.com (Unverified) 3 | X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 4 | X-Priority: 5 (Lowest) 5 | Date: Fri, 19 May 2000 01:13:19 -0400 6 | To: Joe Blow 7 | From: Doug Sauder 8 | Subject: The Hare and the Tortoise 9 | Mime-Version: 1.0 10 | Content-Type: text/plain; charset="us-ascii" 11 | 12 | 13 | The Hare and the Tortoise 14 | 15 | 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. 16 | 17 | Slow but steady wins the race. 18 | 19 | -------------------------------------------------------------------------------- /resources/eml/legacy/005.eml: -------------------------------------------------------------------------------- 1 | From: "Doug Sauder" 2 | To: =?utf-7?Q?Heinz_M+APw-ller?= 3 | Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?= 4 | Date: Wed, 17 May 2000 19:20:24 -0400 5 | Message-ID: 6 | MIME-Version: 1.0 7 | Content-Type: text/plain; 8 | charset="utf-7" 9 | Content-Transfer-Encoding: quoted-printable 10 | X-Priority: 3 (Normal) 11 | X-MSMail-Priority: Normal 12 | X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) 13 | Importance: Normal 14 | X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 15 | 16 | Die Hasen und die Fr+APY-sche 17 | 18 | Die Hasen klagten einst +APw-ber ihre mi+AN8-liche Lage+ADs- +ACI-wir = 19 | leben+ACI-, sprach ein Redner, +ACI-in steter Furcht vor Menschen und = 20 | Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere+ACE- = 21 | Unsere stete Angst ist +AOQ-rger als der Tod selbst. Auf, la+AN8-t uns = 22 | ein f+APw-r allemal sterben.+ACI-=20 23 | 24 | In einem nahen Teich wollten sie sich nun ers+AOQ-ufen+ADs- sie eilten = 25 | ihm zu+ADs- allein das au+AN8-erordentliche Get+APY-se und ihre = 26 | wunderbare Gestalt erschreckte eine Menge Fr+APY-sche, die am Ufer = 27 | sa+AN8-en, so sehr, da+AN8- sie aufs schnellste untertauchten.=20 28 | 29 | +ACI-Halt+ACI-, rief nun eben dieser Sprecher, +ACI-wir wollen das = 30 | Ers+AOQ-ufen noch ein wenig aufschieben, denn auch uns f+APw-rchten, wie = 31 | ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein = 32 | m+APw-ssen als wir.+ACI-=20 33 | -------------------------------------------------------------------------------- /resources/eml/legacy/007.eml: -------------------------------------------------------------------------------- 1 | From: "Doug Sauder" 2 | To: =?iso-8859-1?B?SvxyZ2VuIFNjaG38cmdlbg==?= 3 | Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche_=28Microsoft_Outlook_00=29?= 4 | Date: Wed, 17 May 2000 19:15:35 -0400 5 | Message-ID: 6 | MIME-Version: 1.0 7 | Content-Type: text/plain; 8 | charset="iso-8859-1" 9 | Content-Transfer-Encoding: quoted-printable 10 | X-Priority: 3 (Normal) 11 | X-MSMail-Priority: Normal 12 | X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) 13 | Importance: Normal 14 | X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 15 | 16 | Die Hasen und die Fr=F6sche 17 | 18 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach = 19 | ein Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der = 20 | Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist = 21 | =E4rger als der Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20 22 | 23 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; = 24 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt = 25 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF = 26 | sie aufs schnellste untertauchten.=20 27 | 28 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch = 29 | ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige = 30 | Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 31 | 32 | -------------------------------------------------------------------------------- /resources/eml/legacy/009.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/009.eml -------------------------------------------------------------------------------- /resources/eml/legacy/010.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/010.eml -------------------------------------------------------------------------------- /resources/eml/legacy/011.eml: -------------------------------------------------------------------------------- 1 | Message-Id: <4.2.0.58.20000519001217.00a85b60@pop.example.com> 2 | X-Sender: dwsauder@pop.example.com (Unverified) 3 | X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 4 | Date: Fri, 19 May 2000 00:17:39 -0400 5 | To: =?iso-8859-1?Q?J=FCrgen?= =?iso-8859-1?Q?_Schm=FCrgen?= 6 | 7 | From: Doug Sauder 8 | Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?= 9 | Mime-Version: 1.0 10 | Content-Type: text/plain; charset="iso-8859-1" 11 | Content-Transfer-Encoding: quoted-printable 12 | 13 | Die Hasen und die Fr=F6sche 14 | 15 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach ein= 16 | Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,= 17 | der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der= 18 | Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20 19 | 20 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= 21 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt= 22 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie= 23 | aufs schnellste untertauchten.=20 24 | 25 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ein= 26 | wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere,= 27 | welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 28 | 29 | 30 | -------------------------------------------------------------------------------- /resources/eml/legacy/012.eml: -------------------------------------------------------------------------------- 1 | From: "Doug Sauder" 2 | To: =?Windows-1252?Q?Heinz_M=FCller?= 3 | Subject: =?Windows-1252?Q?Die_Hasen_und_die_Fr=F6sche_=28Microsoft_Outlook_00=29?= 4 | Date: Wed, 17 May 2000 19:30:20 -0400 5 | Message-ID: 6 | MIME-Version: 1.0 7 | Content-Type: text/plain; 8 | charset="Windows-1252" 9 | Content-Transfer-Encoding: quoted-printable 10 | X-Priority: 3 (Normal) 11 | X-MSMail-Priority: Normal 12 | X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) 13 | Importance: Normal 14 | X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 15 | 16 | Die Hasen und die Fr=F6sche 17 | 18 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach = 19 | ein Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der = 20 | Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist = 21 | =E4rger als der Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20 22 | 23 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; = 24 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt = 25 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF = 26 | sie aufs schnellste untertauchten.=20 27 | 28 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch = 29 | ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige = 30 | Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 31 | -------------------------------------------------------------------------------- /resources/eml/legacy/013.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/013.eml -------------------------------------------------------------------------------- /resources/eml/legacy/014.eml: -------------------------------------------------------------------------------- 1 | From: "Doug Sauder" 2 | To: "Joe Blow" 3 | Subject: Test message from Microsoft Outlook 00 4 | Date: Wed, 17 May 2000 19:38:28 -0400 5 | Message-ID: 6 | MIME-Version: 1.0 7 | Content-Type: multipart/alternative; 8 | boundary="----=_NextPart_000_0005_01BFC037.799BEF60" 9 | X-Priority: 3 (Normal) 10 | X-MSMail-Priority: Normal 11 | X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) 12 | Importance: Normal 13 | X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 14 | 15 | This is a multi-part message in MIME format. 16 | 17 | ------=_NextPart_000_0005_01BFC037.799BEF60 18 | Content-Type: text/plain; 19 | charset="iso-8859-1" 20 | Content-Transfer-Encoding: quoted-printable 21 | 22 | 23 | The Hare and the Tortoise=20 24 | =20 25 | A HARE one day ridiculed the short feet and slow pace of the Tortoise, = 26 | who replied, laughing: "Though you be swift as the wind, I will beat = 27 | you in a race." The Hare, believing her assertion to be simply = 28 | impossible, assented to the proposal; and they agreed that the Fox = 29 | should choose the course and fix the goal. On the day appointed for the = 30 | race the two started together. The Tortoise never for a moment stopped, = 31 | but went on with a slow but steady pace straight to the end of the = 32 | course. The Hare, lying down by the wayside, fell fast asleep. At last = 33 | waking up, and moving as fast as he could, he saw the Tortoise had = 34 | reached the goal, and was comfortably dozing after her fatigue. =20 35 | =20 36 | Slow but steady wins the race. =20 37 | 38 | 39 | ------=_NextPart_000_0005_01BFC037.799BEF60 40 | Content-Type: text/html; 41 | charset="iso-8859-1" 42 | Content-Transfer-Encoding: quoted-printable 43 | 44 | 45 | 46 | 48 | 49 | 50 |

The Hare and the Tortoise = 51 |
 
A HARE=20 52 | one day ridiculed the short feet and slow pace of the Tortoise, who = 53 | replied,=20 54 | laughing:  "Though you be swift as the wind, I will beat you in a=20 55 | race."  The Hare, believing her assertion to be simply impossible, = 56 | assented=20 57 | to the proposal; and they agreed that the Fox should choose the course = 58 | and fix=20 59 | the goal.  On the day appointed for the race the two started=20 60 | together.  The Tortoise never for a moment stopped, but went on = 61 | with a slow=20 62 | but steady pace straight to the end of the course.  The Hare, lying = 63 | down by=20 64 | the wayside, fell fast asleep.  At last waking up, and moving as = 65 | fast as he=20 66 | could, he saw the Tortoise had reached the goal, and was comfortably = 67 | dozing=20 68 | after her fatigue. 
 
Slow but steady wins the = 69 | race. =20 70 |
71 | 72 | ------=_NextPart_000_0005_01BFC037.799BEF60-- 73 | -------------------------------------------------------------------------------- /resources/eml/legacy/015.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/015.eml -------------------------------------------------------------------------------- /resources/eml/legacy/016.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/016.eml -------------------------------------------------------------------------------- /resources/eml/legacy/017.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/017.eml -------------------------------------------------------------------------------- /resources/eml/legacy/018.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/018.eml -------------------------------------------------------------------------------- /resources/eml/legacy/020.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/020.eml -------------------------------------------------------------------------------- /resources/eml/legacy/022.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/022.eml -------------------------------------------------------------------------------- /resources/eml/legacy/023.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/023.eml -------------------------------------------------------------------------------- /resources/eml/legacy/024.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/024.eml -------------------------------------------------------------------------------- /resources/eml/legacy/025.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/025.eml -------------------------------------------------------------------------------- /resources/eml/legacy/026.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/026.eml -------------------------------------------------------------------------------- /resources/eml/legacy/027.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/027.eml -------------------------------------------------------------------------------- /resources/eml/legacy/029.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <392362D8.B650789F@example.com> 2 | Date: Wed, 17 May 2000 23:26:16 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: Joe Blow 8 | Subject: Test message from Netscape Communicator 4.7 9 | X-Priority: 1 (Highest) 10 | Content-Type: text/plain; charset=us-ascii 11 | Content-Transfer-Encoding: 7bit 12 | 13 | 14 | The Hare and the Tortoise 15 | 16 | A HARE one day ridiculed the short feet and slow pace of the Tortoise, 17 | who replied, laughing: "Though you be swift as the wind, I will beat 18 | you in a race." The Hare, believing her assertion to be simply 19 | impossible, assented to the proposal; and they agreed that the Fox 20 | should choose the course and fix the goal. On the day appointed for the 21 | race the two started together. The Tortoise never for a moment stopped, 22 | but went on with a slow but steady pace straight to the end of the 23 | course. The Hare, lying down by the wayside, fell fast asleep. At last 24 | waking up, and moving as fast as he could, he saw the Tortoise had 25 | reached the goal, and was comfortably dozing after her fatigue. 26 | 27 | Slow but steady wins the race. 28 | -------------------------------------------------------------------------------- /resources/eml/legacy/033.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <392363E1.2AC47AB3@example.com> 2 | Date: Wed, 17 May 2000 23:30:41 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: Joe Blow 8 | Subject: Test message from Netscape Communicator 4.7 9 | X-Priority: 5 (Lowest) 10 | Content-Type: text/plain; charset=UTF-8 11 | Content-Transfer-Encoding: quoted-printable 12 | 13 | Die Hasen und die Fr=F6sche 14 | 15 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach = 16 | ein 17 | Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, 18 | der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als de= 19 | r 20 | Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben." = 21 | 22 | 23 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; 24 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt 25 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie= 26 | aufs 27 | schnellste untertauchten. = 28 | 29 | 30 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ei= 31 | n 32 | wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere, 33 | welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." 34 | -------------------------------------------------------------------------------- /resources/eml/legacy/034.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <39236497.12FA2A89@example.com> 2 | Date: Wed, 17 May 2000 23:33:43 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: "Heinz M+APw-ller" 8 | Subject: Die Hasen und die Fr+APY-sche 9 | Content-Type: text/plain; charset=UTF-7 10 | Content-Transfer-Encoding: 7bit 11 | 12 | Die Hasen und die Fr+XKM-he 13 | 14 | Die Hasen klagten einst +uGU-r ihre mi+B6w-iche Lage; "wir leben", sprach ein 15 | Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, 16 | der Adler, ja fast aller Raubtiere! Unsere stete Angst ist +PGc-er als der 17 | Tod selbst. Auf, la+B7Q- uns ein f+vCA-allemal sterben." 18 | 19 | In einem nahen Teich wollten sie sich nun ers+PSY-en; sie eilten ihm zu; 20 | allein das au+B6U-rordentliche Get+XKU- und ihre wunderbare Gestalt 21 | erschreckte eine Menge Fr+XKM-he, die am Ufer sa+B6U-n, so sehr, da+B2A-sie aufs 22 | schnellste untertauchten. 23 | 24 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers+PSY-en noch ein 25 | wenig aufschieben, denn auch uns f+vGM-hten, wie ihr seht, einige Tiere, 26 | welche also wohl noch ungl+uKs-licher sein m+vLM-en als wir." 27 | -------------------------------------------------------------------------------- /resources/eml/legacy/036.eml: -------------------------------------------------------------------------------- 1 | Date: Fri, 19 May 2000 10:18:03 -0400 (EDT) 2 | From: Doug Sauder 3 | To: =?iso-8859-1?Q?J=FCrgen_Schm=FCrgen?= 4 | Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?= 5 | Message-ID: 6 | MIME-Version: 1.0 7 | Content-Type: TEXT/PLAIN; charset=iso-8859-1 8 | Content-Transfer-Encoding: QUOTED-PRINTABLE 9 | 10 | Die Hasen und die Fr=F6sche 11 | 12 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach ei= 13 | n Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, = 14 | der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als der = 15 | Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."=20 16 | 17 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; al= 18 | lein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt erschreckt= 19 | e eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie aufs schnel= 20 | lste untertauchten.=20 21 | 22 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ein = 23 | wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere, we= 24 | lche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 25 | 26 | 27 | -------------------------------------------------------------------------------- /resources/eml/legacy/037.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <392366A7.21929EA7@example.com> 2 | Date: Wed, 17 May 2000 23:42:31 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: Joe Blow 8 | Subject: Test message from Netscape Communicator 4.7 9 | Content-Type: multipart/mixed; 10 | boundary="------------E7889DDF0F75D34163841C59" 11 | 12 | This is a multi-part message in MIME format. 13 | --------------E7889DDF0F75D34163841C59 14 | Content-Type: text/plain; charset=us-ascii 15 | Content-Transfer-Encoding: 7bit 16 | 17 | 18 | --------------E7889DDF0F75D34163841C59 19 | Content-Type: image/png; 20 | name="blueball.png" 21 | Content-Transfer-Encoding: base64 22 | Content-Disposition: inline; 23 | filename="blueball.png" 24 | 25 | iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgA 26 | AAAACCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQ 27 | MZQAGFIQMYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYY 28 | QsYQMaUAACHO5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9K 29 | e+8YOaUYSsaMvee15++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAA 30 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 31 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 32 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 33 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 34 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 35 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 36 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 37 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 38 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 39 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADB 40 | Mg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAuMT1evmgAAAGI 41 | SURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbsscebL5xznTsh 42 | 5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18PyqqW 43 | Uw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC 44 | UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/M 45 | jRxmT6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1C 46 | SYoOiMOSGwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIom 47 | H3NCKX0lnI+B1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0N 48 | xW62p+lT+Yi747sD/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBi 49 | eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= 50 | --------------E7889DDF0F75D34163841C59-- 51 | 52 | -------------------------------------------------------------------------------- /resources/eml/legacy/038.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <3923625B.59F0C3AC@example.com> 2 | Date: Wed, 17 May 2000 23:24:11 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: Joe Blow 8 | Subject: Test message from Netscape Communicator 4.7 9 | Content-Type: text/plain; charset=us-ascii 10 | Content-Transfer-Encoding: 7bit 11 | 12 | 13 | The Hare and the Tortoise 14 | 15 | 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. 16 | 17 | Slow but steady wins the race. 18 | -------------------------------------------------------------------------------- /resources/eml/legacy/040.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <39236653.CAA8A090@example.com> 2 | Date: Wed, 17 May 2000 23:41:07 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: =?iso-8859-1?Q?J=FCrgen=20Schm=FCrgen?= 8 | Subject: Die Hasen und die =?iso-8859-1?Q?Fr=F6sche?= 9 | Content-Type: text/plain; charset=iso-8859-1 10 | Content-Transfer-Encoding: quoted-printable 11 | 12 | Die Hasen und die Fr=F6sche 13 | 14 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach = 15 | ein Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hun= 16 | de, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger al= 17 | s der Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben." = 18 | 19 | 20 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; = 21 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt erschr= 22 | eckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie aufs = 23 | schnellste untertauchten. = 24 | 25 | 26 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ei= 27 | n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= 28 | , welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." 29 | -------------------------------------------------------------------------------- /resources/eml/legacy/041.eml: -------------------------------------------------------------------------------- 1 | Date: Fri, 19 May 2000 10:23:16 -0400 (EDT) 2 | From: Doug Sauder 3 | To: =?iso-8859-1?Q?Heinz_M=FCller?= 4 | Subject: PNG graphic 5 | Message-ID: 6 | MIME-Version: 1.0 7 | Content-Type: MULTIPART/MIXED; BOUNDARY="-1463757054-170444605-958746196=:8452" 8 | 9 | This message is in MIME format. The first part should be readable text, 10 | while the remaining parts are likely unreadable without MIME-aware tools. 11 | Send mail to mime@docserver.cac.washington.edu for more info. 12 | 13 | ---1463757054-170444605-958746196=:8452 14 | Content-Type: TEXT/PLAIN; charset=US-ASCII 15 | 16 | 17 | ---1463757054-170444605-958746196=:8452 18 | Content-Type: APPLICATION/octet-stream; name="redball.png" 19 | Content-Transfer-Encoding: BASE64 20 | Content-ID: 21 | Content-Description: red ball 22 | Content-Disposition: attachment; filename="redball.png" 23 | 24 | iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8A 25 | AAABAAALAAAVAAAaAAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAj 26 | AAAWAAAmAABhAAB7AACGAACHAAB9AAB0AABgAAA5AAAUAAAGAAAnAABLAABv 27 | AACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABMAAB3AACZAAC0 28 | GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHf 29 | hITmf3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5Pl 30 | rKzpmZntZWXvJSXXAADBAACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADL 31 | ICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2AAB4AABeAABAAAAiAABXAACS 32 | AADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABHAAArAAAP 33 | AACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABP 34 | AAASAAACAABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADI 35 | AADTAADNAACzAACDAABuAAAeAAB+AADAAACkAACNAAB/AABpAABQAAAwAACR 36 | AACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACsAACvAACtAACmAACJAAB6 37 | AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABVAACO 38 | AACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8 39 | AAA6AAAfAAAMAAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 40 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 41 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8 42 | LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu 43 | MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkF 44 | BDlQJf8zC/EIi4iKiUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp 45 | 6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ29ja2Ts4Ojkr6Li4urFDNf53N/Ow 46 | 8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFWSE1LF4A69n9G 47 | ZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2Yn 48 | OAj+d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1 49 | a/acUG5piNz/uXLzVJ2qm6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2T 50 | VjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqVtWXrtu07BJihcsw71+zanRW8 51 | Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZwHBqL//8f 52 | lz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/ 53 | joOyYed5QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms 54 | 1y9evXid7QZacgOxmSxktNzdtSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAA 55 | JXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5IFl2ZXMgUGlndWV0NnM7 56 | vAAAAABJRU5ErkJggg== 57 | ---1463757054-170444605-958746196=:8452-- 58 | -------------------------------------------------------------------------------- /resources/eml/legacy/042.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <3923686C.99FB5E36@example.com> 2 | Date: Wed, 17 May 2000 23:50:04 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: Joe Blow 8 | Subject: Test message from Netscape Communicator 4.7 9 | Content-Type: multipart/mixed; 10 | boundary="------------77060D866A66DC8D0921E051" 11 | 12 | This is a multi-part message in MIME format. 13 | --------------77060D866A66DC8D0921E051 14 | Content-Type: text/plain; charset=us-ascii 15 | Content-Transfer-Encoding: 7bit 16 | 17 | 18 | The Hare and the Tortoise 19 | 20 | A HARE one day ridiculed the short feet and slow pace of the Tortoise, 21 | who replied, laughing: "Though you be swift as the wind, I will beat 22 | you in a race." The Hare, believing her assertion to be simply 23 | impossible, assented to the proposal; and they agreed that the Fox 24 | should choose the course and fix the goal. On the day appointed for the 25 | race the two started together. The Tortoise never for a moment stopped, 26 | but went on with a slow but steady pace straight to the end of the 27 | course. The Hare, lying down by the wayside, fell fast asleep. At last 28 | waking up, and moving as fast as he could, he saw the Tortoise had 29 | reached the goal, and was comfortably dozing after her fatigue. 30 | 31 | Slow but steady wins the race. 32 | --------------77060D866A66DC8D0921E051 33 | Content-Type: text/plain; charset=us-ascii; 34 | name="farmerandstork.txt" 35 | Content-Transfer-Encoding: 7bit 36 | Content-Disposition: inline; 37 | filename="farmerandstork.txt" 38 | 39 | 40 | The Farmer and the Stork 41 | 42 | A FARMER placed nets on his newly-sown plowlands and caught a 43 | number of Cranes, which came to pick up his seed. With them he 44 | trapped a Stork that had fractured his leg in the net and was 45 | earnestly beseeching the Farmer to spare his life. "Pray save 46 | me, Master," he said, "and let me go free this once. My broken 47 | limb should excite your pity. Besides, I am no Crane, I am a 48 | Stork, a bird of excellent character; and see how I love and 49 | slave for my father and mother. Look too, at my feathers-- 50 | they are not the least like those of a Crane." The Farmer 51 | laughed aloud and said, "It may be all as you say, I only know 52 | this: I have taken you with these robbers, the Cranes, and you 53 | must die in their company." 54 | 55 | Birds of a feather flock together. 56 | 57 | --------------77060D866A66DC8D0921E051-- 58 | 59 | -------------------------------------------------------------------------------- /resources/eml/legacy/043.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <392359CF.DFF4527@example.com> 2 | Date: Wed, 17 May 2000 22:47:43 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: Heinz =?iso-8859-1?Q?M=FCller?= 8 | Subject: Die Hasen und die =?iso-8859-1?Q?Fr=F6sche?= (Netscape Communicator 4.7) 9 | Content-Type: multipart/alternative; 10 | boundary="------------9D454F23DA86BCD63FA3805F" 11 | 12 | 13 | --------------9D454F23DA86BCD63FA3805F 14 | Content-Type: text/plain; charset=iso-8859-1 15 | Content-Transfer-Encoding: quoted-printable 16 | 17 | Die Hasen und die Fr=F6sche 18 | 19 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach = 20 | ein 21 | Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, 22 | der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als de= 23 | r 24 | Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben." 25 | 26 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; 27 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt 28 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie= 29 | aufs 30 | schnellste untertauchten. 31 | 32 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ei= 33 | n 34 | wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere, 35 | welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." 36 | 37 | 38 | 39 | --------------9D454F23DA86BCD63FA3805F 40 | Content-Type: text/html; charset=us-ascii 41 | Content-Transfer-Encoding: 7bit 42 | 43 | 44 | 45 | Die Hasen und die Frösche 46 |

Die Hasen klagten einst über ihre mißliche Lage; "wir leben", 47 | sprach ein Redner, "in steter Furcht vor Menschen und Tieren, eine Beute 48 | der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger 49 | als der Tod selbst. Auf, laßt uns ein für allemal sterben." 50 |

In einem nahen Teich wollten sie sich nun ersäufen; sie eilten 51 | ihm zu; allein das außerordentliche Getöse und ihre wunderbare 52 | Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so 53 | sehr, daß sie aufs schnellste untertauchten. 54 |

"Halt", rief nun eben dieser Sprecher, "wir wollen das Ersäufen 55 | noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, 56 | einige Tiere, welche also wohl noch unglücklicher sein müssen 57 | als wir." 58 |
  59 |
  60 | 61 | --------------9D454F23DA86BCD63FA3805F-- 62 | -------------------------------------------------------------------------------- /resources/eml/legacy/045.eml: -------------------------------------------------------------------------------- 1 | Date: Fri, 19 May 2000 10:26:12 -0400 (EDT) 2 | From: Doug Sauder 3 | To: Joe Blow , 4 | =?iso-8859-1?Q?Heinz_M=FCller?= 5 | Subject: =?iso-8859-1?Q?Die_Hasen_und_die_Fr=F6sche?= 6 | Message-ID: 7 | MIME-Version: 1.0 8 | Content-Type: MULTIPART/MIXED; BOUNDARY="-1463757054-891160829-958746372=:8452" 9 | 10 | This message is in MIME format. The first part should be readable text, 11 | while the remaining parts are likely unreadable without MIME-aware tools. 12 | Send mail to mime@docserver.cac.washington.edu for more info. 13 | 14 | ---1463757054-891160829-958746372=:8452 15 | Content-Type: TEXT/PLAIN; charset=US-ASCII 16 | 17 | 18 | ---1463757054-891160829-958746372=:8452 19 | Content-Type: TEXT/PLAIN; charset=iso-8859-1; name*="iso-8859-1''HasenundFr%F6sche.txt" 20 | Content-Transfer-Encoding: BASE64 21 | Content-ID: 22 | Content-Description: Short story in German 23 | Content-Disposition: attachment; filename*="iso-8859-1''HasenundFr%F6sche.txt" 24 | 25 | RGllIEhhc2VuIHVuZCBkaWUgRnL2c2NoZQ0NCg0NCkRpZSBIYXNlbiBrbGFn 26 | dGVuIGVpbnN0IPxiZXIgaWhyZSBtad9saWNoZSBMYWdlOyAid2lyIGxlYmVu 27 | Iiwgc3ByYWNoIGVpbiBSZWRuZXIsICJpbiBzdGV0ZXIgRnVyY2h0IHZvciBN 28 | ZW5zY2hlbiB1bmQgVGllcmVuLCBlaW5lIEJldXRlIGRlciBIdW5kZSwgZGVy 29 | IEFkbGVyLCBqYSBmYXN0IGFsbGVyIFJhdWJ0aWVyZSEgVW5zZXJlIHN0ZXRl 30 | IEFuZ3N0IGlzdCDkcmdlciBhbHMgZGVyIFRvZCBzZWxic3QuIEF1ZiwgbGHf 31 | dCB1bnMgZWluIGb8ciBhbGxlbWFsIHN0ZXJiZW4uIiANDQoNDQpJbiBlaW5l 32 | bSBuYWhlbiBUZWljaCB3b2xsdGVuIHNpZSBzaWNoIG51biBlcnPkdWZlbjsg 33 | c2llIGVpbHRlbiBpaG0genU7IGFsbGVpbiBkYXMgYXXfZXJvcmRlbnRsaWNo 34 | ZSBHZXT2c2UgdW5kIGlocmUgd3VuZGVyYmFyZSBHZXN0YWx0IGVyc2NocmVj 35 | a3RlIGVpbmUgTWVuZ2UgRnL2c2NoZSwgZGllIGFtIFVmZXIgc2HfZW4sIHNv 36 | IHNlaHIsIGRh3yBzaWUgYXVmcyBzY2huZWxsc3RlIHVudGVydGF1Y2h0ZW4u 37 | IA0NCg0NCiJIYWx0IiwgcmllZiBudW4gZWJlbiBkaWVzZXIgU3ByZWNoZXIs 38 | ICJ3aXIgd29sbGVuIGRhcyBFcnPkdWZlbiBub2NoIGVpbiB3ZW5pZyBhdWZz 39 | Y2hpZWJlbiwgZGVubiBhdWNoIHVucyBm/HJjaHRlbiwgd2llIGlociBzZWh0 40 | LCBlaW5pZ2UgVGllcmUsIHdlbGNoZSBhbHNvIHdvaGwgbm9jaCB1bmds/GNr 41 | bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo= 42 | ---1463757054-891160829-958746372=:8452-- 43 | -------------------------------------------------------------------------------- /resources/eml/legacy/046.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <3923561C.B7078DEF@example.com> 2 | Date: Wed, 17 May 2000 22:31:57 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: =?iso-8859-1?Q?J=FCrgen=20Schm=FCrgen?= 8 | Subject: Die Hasen und die =?iso-8859-1?Q?Fr=F6sche?= (Netscape Communicator 4.7) 9 | Content-Type: text/plain; charset=iso-8859-1 10 | Content-Transfer-Encoding: quoted-printable 11 | 12 | Die Hasen und die Fr=F6sche 13 | 14 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach = 15 | ein 16 | Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, 17 | der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als de= 18 | r 19 | Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben." 20 | 21 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; 22 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt 23 | erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie= 24 | aufs 25 | schnellste untertauchten. 26 | 27 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ei= 28 | n 29 | wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere, 30 | welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." 31 | 32 | 33 | -------------------------------------------------------------------------------- /resources/eml/legacy/047.eml: -------------------------------------------------------------------------------- 1 | Message-ID: <392367BC.3D075C95@example.com> 2 | Date: Wed, 17 May 2000 23:47:08 -0400 3 | From: Doug Sauder 4 | X-Mailer: Mozilla 4.7 [en] (WinNT; I) 5 | X-Accept-Language: en 6 | MIME-Version: 1.0 7 | To: Joe Blow 8 | Subject: Test message from Netscape Communicator 4.7 9 | Content-Type: multipart/mixed; 10 | boundary="------------CA611088711119FBDB3473B4" 11 | 12 | This is a multi-part message in MIME format. 13 | --------------CA611088711119FBDB3473B4 14 | Content-Type: text/plain; charset=us-ascii 15 | Content-Transfer-Encoding: 7bit 16 | 17 | 18 | The Hare and the Tortoise 19 | 20 | A HARE one day ridiculed the short feet and slow pace of the Tortoise, 21 | who replied, laughing: "Though you be swift as the wind, I will beat 22 | you in a race." The Hare, believing her assertion to be simply 23 | impossible, assented to the proposal; and they agreed that the Fox 24 | should choose the course and fix the goal. On the day appointed for the 25 | race the two started together. The Tortoise never for a moment stopped, 26 | but went on with a slow but steady pace straight to the end of the 27 | course. The Hare, lying down by the wayside, fell fast asleep. At last 28 | waking up, and moving as fast as he could, he saw the Tortoise had 29 | reached the goal, and was comfortably dozing after her fatigue. 30 | 31 | Slow but steady wins the race. 32 | --------------CA611088711119FBDB3473B4 33 | Content-Type: text/plain; charset=iso-8859-1; 34 | name="=?iso-8859-1?Q?HasenundFr=F6sche=2Etxt?=" 35 | Content-Transfer-Encoding: quoted-printable 36 | Content-Disposition: inline; 37 | filename="=?iso-8859-1?Q?HasenundFr=F6sche=2Etxt?=" 38 | 39 | Die Hasen und die Fr=F6sche 40 | 41 | Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach = 42 | ein Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hun= 43 | de, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger al= 44 | s der Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben." = 45 | 46 | 47 | In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu; = 48 | allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt erschr= 49 | eckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie aufs = 50 | schnellste untertauchten. = 51 | 52 | 53 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ei= 54 | n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= 55 | , welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." = 56 | 57 | 58 | 59 | --------------CA611088711119FBDB3473B4-- 60 | 61 | -------------------------------------------------------------------------------- /resources/eml/legacy/050.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/050.eml -------------------------------------------------------------------------------- /resources/eml/legacy/051.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/051.eml -------------------------------------------------------------------------------- /resources/eml/legacy/052.eml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalwartlabs/mail-parser/c5d47b5b8e50fd930719f95ed274347bae745fd8/resources/eml/legacy/052.eml -------------------------------------------------------------------------------- /resources/eml/legacy/053.eml: -------------------------------------------------------------------------------- 1 | From: "Doug Sauder" 2 | To: =?utf-8?Q?Heinz_M=C3=BCller?= 3 | Subject: =?utf-8?Q?Die_Hasen_und_die_Fr=C3=B6sche_=28Microsoft_Outlook_00=29?= 4 | Date: Wed, 17 May 2000 19:27:04 -0400 5 | Message-ID: 6 | MIME-Version: 1.0 7 | Content-Type: text/plain; 8 | charset="utf-8" 9 | Content-Transfer-Encoding: quoted-printable 10 | X-Priority: 3 (Normal) 11 | X-MSMail-Priority: Normal 12 | X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) 13 | Importance: Normal 14 | X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 15 | 16 | Die Hasen und die Fr=C3=B6sche 17 | 18 | Die Hasen klagten einst =C3=BCber ihre mi=C3=9Fliche Lage; "wir leben", = 19 | sprach ein Redner, "in steter Furcht vor Menschen und Tieren, eine Beute = 20 | der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist = 21 | =C3=A4rger als der Tod selbst. Auf, la=C3=9Ft uns ein f=C3=BCr allemal = 22 | sterben."=20 23 | 24 | In einem nahen Teich wollten sie sich nun ers=C3=A4ufen; sie eilten ihm = 25 | zu; allein das au=C3=9Ferordentliche Get=C3=B6se und ihre wunderbare = 26 | Gestalt erschreckte eine Menge Fr=C3=B6sche, die am Ufer sa=C3=9Fen, so = 27 | sehr, da=C3=9F sie aufs schnellste untertauchten.=20 28 | 29 | "Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=C3=A4ufen = 30 | noch ein wenig aufschieben, denn auch uns f=C3=BCrchten, wie ihr seht, = 31 | einige Tiere, welche also wohl noch ungl=C3=BCcklicher sein m=C3=BCssen = 32 | als wir."=20 33 | -------------------------------------------------------------------------------- /resources/eml/legacy/COPYING: -------------------------------------------------------------------------------- 1 | These test files are Copyright © 2010 Hunny Software, Inc. 2 | Samples obtained from http://www.hunnysoft.com/mime/samples/samples.zip 3 | Details at https://www.hunnysoft.com/mime/samples/index.html 4 | 5 | readme.txt 6 | ----- 7 | 8 | The files in this directory that match the pattern m*.txt are sample 9 | messages in MIME format from common email Mail User Agents (MUAs). 10 | 11 | I created these samples mainly for the purpose of testing my own MIME 12 | implementation, particularly for testing the decoding of encoded text 13 | in the headers (RFC 2047) and for the extraction of attachments (not 14 | covered by any standard). 15 | 16 | I used four different MUAs to create the messages. You can determine which 17 | MUA was used by looking at the file name. The breakdown is: 18 | 19 | m0*.txt -- Microsoft Outlook 00 20 | m1*.txt -- Netscape Communicator 4.7 21 | m2*.txt -- Qualcomm Eudora 4.2 22 | m3*.txt -- PINE (Linux) 23 | 24 | Of course, you can also look at the headers of the message to determine the 25 | MUA. 26 | 27 | If you want to contribute to this collection of samples, please do send 28 | your contributions. I will evaluate the contributions for inclusion in 29 | this collection. The evaluation criteria will include: 30 | 31 | * Is the MUA a mainstream MUA (not some obscure, rare MUA)? 32 | 33 | * Are the messages short? 34 | 35 | * Are the messages useful for testing? 36 | 37 | * Are the messages genuine? Messages that have been through a relaying 38 | SMTP server might have been modified. This might not disqualify a 39 | sample message, as it probably still has value for interoperability 40 | testing. 41 | 42 | When you send messages, please zip them or tar them, so that they won't be 43 | changed as they pass through the mail system. If I include your messages, 44 | I will put your name on a list of contributors, unless you prefer otherwise. 45 | 46 | I am also considering creating a separate collection of messages designed 47 | to stress test MIME implementations. So, if you have any good examples of 48 | bad messages (but not bad examples of good messages :-), feel free to send 49 | them. 50 | 51 | Not all the messages are correct to the MIME standard. However, since 52 | these messages are from popular MUAs, they can be useful for 53 | interoperability testing. Please, if you are creating messages, read and 54 | understand the standards documents, rather than imitate what you see in 55 | these messages! 56 | 57 | I have included the files that were used for creating the attachments, 58 | so you can test that you have successfully decoded the attachments. 59 | 60 | I have also included a simple Java program that I used for creating these 61 | samples. This program, SmtpServer.java, is a simple SMTP server that will 62 | receive the message directly from you MUA. This is important, because if 63 | you just route the message through your normal SMTP server, the server 64 | might make changes to the message. For example, it seems to be common for 65 | some servers to convert quoted-printable encoded text to 8-bit text.[1] 66 | This SMTP server program records the entire SMTP client/server dialog, 67 | which is great if you are trying to debug your mail system, but it also 68 | means that you will have to edit the output of the program to get just 69 | the email message. 70 | 71 | The URL for this collection of messages is 72 | 73 | 74 | 75 | 76 | 77 | 78 | ---------------------------------------------------- 79 | 80 | [1] I don't like the fact that this happens, but that's life. I guess the 81 | MTA thinks that since it can handle 8-bit text, that quoted-printable 82 | encoding is not necessary. However, quoted-printable also makes long lines 83 | into short lines, which is something other than converting to 8-bit 84 | characters. In general, I think end-to-end transparency is a good thing; 85 | anything that interferes with transparency should be avoided. 86 | -------------------------------------------------------------------------------- /resources/eml/malformed/000.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [], 5 | "parts": [ 6 | { 7 | "headers": [ 8 | { 9 | "name": "content_type", 10 | "value": { 11 | "ContentType": { 12 | "c_type": "multipart", 13 | "c_subtype": "mixed", 14 | "attributes": [ 15 | { 16 | "name": "boundary", 17 | "value": ":foo" 18 | } 19 | ] 20 | } 21 | }, 22 | "offset_field": 0, 23 | "offset_start": 13, 24 | "offset_end": 48 25 | } 26 | ], 27 | "is_encoding_problem": false, 28 | "body": { 29 | "Multipart": [] 30 | }, 31 | "offset_header": 0, 32 | "offset_body": 50, 33 | "offset_end": 169 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /resources/eml/malformed/000.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary=":foo" 2 | 3 | --:foo 4 | --:foo 5 | Content-Type: text/plain 6 | --:foo 7 | Content-Type: text/plain 8 | --:foo 9 | Content-Type: text/html 10 | --:foo-- 11 | -------------------------------------------------------------------------------- /resources/eml/malformed/000.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [], 5 | "parts": [ 6 | { 7 | "headers": [ 8 | { 9 | "name": "content_type", 10 | "value": { 11 | "ContentType": { 12 | "c_type": "multipart", 13 | "c_subtype": "mixed", 14 | "attributes": [ 15 | { 16 | "name": "boundary", 17 | "value": ":foo" 18 | } 19 | ] 20 | } 21 | }, 22 | "offset_field": 0, 23 | "offset_start": 13, 24 | "offset_end": 47 25 | } 26 | ], 27 | "is_encoding_problem": false, 28 | "body": { 29 | "Multipart": [] 30 | }, 31 | "offset_header": 0, 32 | "offset_body": 48, 33 | "offset_end": 160 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /resources/eml/malformed/001.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [ 9 | 3 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "ab" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 46 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1 37 | ] 38 | }, 39 | "offset_header": 0, 40 | "offset_body": 48, 41 | "offset_end": 142 42 | }, 43 | { 44 | "headers": [ 45 | { 46 | "name": "content_type", 47 | "value": { 48 | "ContentType": { 49 | "c_type": "multipart", 50 | "c_subtype": "mixed", 51 | "attributes": [ 52 | { 53 | "name": "boundary", 54 | "value": "a" 55 | } 56 | ] 57 | } 58 | }, 59 | "offset_field": 54, 60 | "offset_start": 67, 61 | "offset_end": 99 62 | } 63 | ], 64 | "is_encoding_problem": false, 65 | "body": { 66 | "Multipart": [ 67 | 2, 68 | 3 69 | ] 70 | }, 71 | "offset_header": 54, 72 | "offset_body": 101, 73 | "offset_end": 142 74 | }, 75 | { 76 | "headers": [ 77 | { 78 | "name": "content_type", 79 | "value": { 80 | "ContentType": { 81 | "c_type": "text", 82 | "c_subtype": "plain", 83 | "attributes": null 84 | } 85 | }, 86 | "offset_field": 107, 87 | "offset_start": 120, 88 | "offset_end": 133 89 | } 90 | ], 91 | "is_encoding_problem": false, 92 | "body": { 93 | "Text": "" 94 | }, 95 | "offset_header": 104, 96 | "offset_body": 135, 97 | "offset_end": 135 98 | }, 99 | { 100 | "headers": [], 101 | "is_encoding_problem": true, 102 | "body": { 103 | "Text": "" 104 | }, 105 | "offset_header": 140, 106 | "offset_body": 142, 107 | "offset_end": 142 108 | } 109 | ] 110 | } -------------------------------------------------------------------------------- /resources/eml/malformed/001.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="ab" 2 | 3 | --ab 4 | Content-Type: multipart/mixed; boundary="a" 5 | 6 | --ab 7 | Content-Type: text/plain 8 | 9 | --a 10 | 11 | -------------------------------------------------------------------------------- /resources/eml/malformed/001.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [ 9 | 3 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "ab" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 45 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1 37 | ] 38 | }, 39 | "offset_header": 0, 40 | "offset_body": 46, 41 | "offset_end": 132 42 | }, 43 | { 44 | "headers": [ 45 | { 46 | "name": "content_type", 47 | "value": { 48 | "ContentType": { 49 | "c_type": "multipart", 50 | "c_subtype": "mixed", 51 | "attributes": [ 52 | { 53 | "name": "boundary", 54 | "value": "a" 55 | } 56 | ] 57 | } 58 | }, 59 | "offset_field": 51, 60 | "offset_start": 64, 61 | "offset_end": 95 62 | } 63 | ], 64 | "is_encoding_problem": false, 65 | "body": { 66 | "Multipart": [ 67 | 2, 68 | 3 69 | ] 70 | }, 71 | "offset_header": 51, 72 | "offset_body": 96, 73 | "offset_end": 132 74 | }, 75 | { 76 | "headers": [ 77 | { 78 | "name": "content_type", 79 | "value": { 80 | "ContentType": { 81 | "c_type": "text", 82 | "c_subtype": "plain", 83 | "attributes": null 84 | } 85 | }, 86 | "offset_field": 101, 87 | "offset_start": 114, 88 | "offset_end": 126 89 | } 90 | ], 91 | "is_encoding_problem": false, 92 | "body": { 93 | "Text": "" 94 | }, 95 | "offset_header": 99, 96 | "offset_body": 127, 97 | "offset_end": 127 98 | }, 99 | { 100 | "headers": [], 101 | "is_encoding_problem": true, 102 | "body": { 103 | "Text": "" 104 | }, 105 | "offset_header": 131, 106 | "offset_body": 132, 107 | "offset_end": 132 108 | } 109 | ] 110 | } -------------------------------------------------------------------------------- /resources/eml/malformed/002.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 0 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "multipart", 15 | "c_subtype": "mixed", 16 | "attributes": [ 17 | { 18 | "name": "boundary", 19 | "value": "ab" 20 | } 21 | ] 22 | } 23 | }, 24 | "offset_field": 0, 25 | "offset_start": 13, 26 | "offset_end": 46 27 | } 28 | ], 29 | "is_encoding_problem": false, 30 | "body": { 31 | "Text": "body\r\n" 32 | }, 33 | "offset_header": 0, 34 | "offset_body": 48, 35 | "offset_end": 54 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /resources/eml/malformed/002.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="ab" 2 | 3 | body 4 | -------------------------------------------------------------------------------- /resources/eml/malformed/002.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 0 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "multipart", 15 | "c_subtype": "mixed", 16 | "attributes": [ 17 | { 18 | "name": "boundary", 19 | "value": "ab" 20 | } 21 | ] 22 | } 23 | }, 24 | "offset_field": 0, 25 | "offset_start": 13, 26 | "offset_end": 45 27 | } 28 | ], 29 | "is_encoding_problem": false, 30 | "body": { 31 | "Text": "body\n" 32 | }, 33 | "offset_header": 0, 34 | "offset_body": 46, 35 | "offset_end": 51 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /resources/eml/malformed/003.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 2 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "multipart", 15 | "c_subtype": "mixed", 16 | "attributes": [ 17 | { 18 | "name": "boundary", 19 | "value": "a" 20 | } 21 | ] 22 | } 23 | }, 24 | "offset_field": 0, 25 | "offset_start": 13, 26 | "offset_end": 45 27 | } 28 | ], 29 | "is_encoding_problem": false, 30 | "body": { 31 | "Multipart": [ 32 | 1 33 | ] 34 | }, 35 | "offset_header": 0, 36 | "offset_body": 47, 37 | "offset_end": 138 38 | }, 39 | { 40 | "headers": [ 41 | { 42 | "name": "content_type", 43 | "value": { 44 | "ContentType": { 45 | "c_type": "multipart", 46 | "c_subtype": "mixed", 47 | "attributes": [ 48 | { 49 | "name": "boundary", 50 | "value": "a" 51 | } 52 | ] 53 | } 54 | }, 55 | "offset_field": 52, 56 | "offset_start": 65, 57 | "offset_end": 97 58 | } 59 | ], 60 | "is_encoding_problem": false, 61 | "body": { 62 | "Multipart": [ 63 | 2 64 | ] 65 | }, 66 | "offset_header": 52, 67 | "offset_body": 99, 68 | "offset_end": 138 69 | }, 70 | { 71 | "headers": [ 72 | { 73 | "name": "content_type", 74 | "value": { 75 | "ContentType": { 76 | "c_type": "text", 77 | "c_subtype": "plain", 78 | "attributes": null 79 | } 80 | }, 81 | "offset_field": 104, 82 | "offset_start": 117, 83 | "offset_end": 130 84 | } 85 | ], 86 | "is_encoding_problem": true, 87 | "body": { 88 | "Text": "body\r\n" 89 | }, 90 | "offset_header": 104, 91 | "offset_body": 132, 92 | "offset_end": 138 93 | } 94 | ] 95 | } -------------------------------------------------------------------------------- /resources/eml/malformed/003.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="a" 2 | 3 | --a 4 | Content-Type: multipart/mixed; boundary="a" 5 | 6 | --a 7 | Content-Type: text/plain 8 | 9 | body 10 | -------------------------------------------------------------------------------- /resources/eml/malformed/003.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 2 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "multipart", 15 | "c_subtype": "mixed", 16 | "attributes": [ 17 | { 18 | "name": "boundary", 19 | "value": "a" 20 | } 21 | ] 22 | } 23 | }, 24 | "offset_field": 0, 25 | "offset_start": 13, 26 | "offset_end": 44 27 | } 28 | ], 29 | "is_encoding_problem": false, 30 | "body": { 31 | "Multipart": [ 32 | 1 33 | ] 34 | }, 35 | "offset_header": 0, 36 | "offset_body": 45, 37 | "offset_end": 129 38 | }, 39 | { 40 | "headers": [ 41 | { 42 | "name": "content_type", 43 | "value": { 44 | "ContentType": { 45 | "c_type": "multipart", 46 | "c_subtype": "mixed", 47 | "attributes": [ 48 | { 49 | "name": "boundary", 50 | "value": "a" 51 | } 52 | ] 53 | } 54 | }, 55 | "offset_field": 49, 56 | "offset_start": 62, 57 | "offset_end": 93 58 | } 59 | ], 60 | "is_encoding_problem": false, 61 | "body": { 62 | "Multipart": [ 63 | 2 64 | ] 65 | }, 66 | "offset_header": 49, 67 | "offset_body": 94, 68 | "offset_end": 129 69 | }, 70 | { 71 | "headers": [ 72 | { 73 | "name": "content_type", 74 | "value": { 75 | "ContentType": { 76 | "c_type": "text", 77 | "c_subtype": "plain", 78 | "attributes": null 79 | } 80 | }, 81 | "offset_field": 98, 82 | "offset_start": 111, 83 | "offset_end": 123 84 | } 85 | ], 86 | "is_encoding_problem": true, 87 | "body": { 88 | "Text": "body\n" 89 | }, 90 | "offset_header": 98, 91 | "offset_body": 124, 92 | "offset_end": 129 93 | } 94 | ] 95 | } -------------------------------------------------------------------------------- /resources/eml/malformed/004.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 2 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "multipart", 15 | "c_subtype": "mixed", 16 | "attributes": [ 17 | { 18 | "name": "boundary", 19 | "value": "a" 20 | } 21 | ] 22 | } 23 | }, 24 | "offset_field": 0, 25 | "offset_start": 13, 26 | "offset_end": 45 27 | } 28 | ], 29 | "is_encoding_problem": false, 30 | "body": { 31 | "Multipart": [ 32 | 1 33 | ] 34 | }, 35 | "offset_header": 0, 36 | "offset_body": 47, 37 | "offset_end": 140 38 | }, 39 | { 40 | "headers": [ 41 | { 42 | "name": "content_type", 43 | "value": { 44 | "ContentType": { 45 | "c_type": "multipart", 46 | "c_subtype": "mixed", 47 | "attributes": [ 48 | { 49 | "name": "boundary", 50 | "value": "a" 51 | } 52 | ] 53 | } 54 | }, 55 | "offset_field": 53, 56 | "offset_start": 66, 57 | "offset_end": 98 58 | } 59 | ], 60 | "is_encoding_problem": false, 61 | "body": { 62 | "Multipart": [ 63 | 2 64 | ] 65 | }, 66 | "offset_header": 50, 67 | "offset_body": 100, 68 | "offset_end": 140 69 | }, 70 | { 71 | "headers": [ 72 | { 73 | "name": "content_type", 74 | "value": { 75 | "ContentType": { 76 | "c_type": "text", 77 | "c_subtype": "plain", 78 | "attributes": null 79 | } 80 | }, 81 | "offset_field": 106, 82 | "offset_start": 119, 83 | "offset_end": 132 84 | } 85 | ], 86 | "is_encoding_problem": true, 87 | "body": { 88 | "Text": "body\r\n" 89 | }, 90 | "offset_header": 103, 91 | "offset_body": 134, 92 | "offset_end": 140 93 | } 94 | ] 95 | } -------------------------------------------------------------------------------- /resources/eml/malformed/004.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="a" 2 | 3 | --ab 4 | Content-Type: multipart/mixed; boundary="a" 5 | 6 | --ac 7 | Content-Type: text/plain 8 | 9 | body 10 | -------------------------------------------------------------------------------- /resources/eml/malformed/004.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 2 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "multipart", 15 | "c_subtype": "mixed", 16 | "attributes": [ 17 | { 18 | "name": "boundary", 19 | "value": "a" 20 | } 21 | ] 22 | } 23 | }, 24 | "offset_field": 0, 25 | "offset_start": 13, 26 | "offset_end": 44 27 | } 28 | ], 29 | "is_encoding_problem": false, 30 | "body": { 31 | "Multipart": [ 32 | 1 33 | ] 34 | }, 35 | "offset_header": 0, 36 | "offset_body": 45, 37 | "offset_end": 131 38 | }, 39 | { 40 | "headers": [ 41 | { 42 | "name": "content_type", 43 | "value": { 44 | "ContentType": { 45 | "c_type": "multipart", 46 | "c_subtype": "mixed", 47 | "attributes": [ 48 | { 49 | "name": "boundary", 50 | "value": "a" 51 | } 52 | ] 53 | } 54 | }, 55 | "offset_field": 50, 56 | "offset_start": 63, 57 | "offset_end": 94 58 | } 59 | ], 60 | "is_encoding_problem": false, 61 | "body": { 62 | "Multipart": [ 63 | 2 64 | ] 65 | }, 66 | "offset_header": 48, 67 | "offset_body": 95, 68 | "offset_end": 131 69 | }, 70 | { 71 | "headers": [ 72 | { 73 | "name": "content_type", 74 | "value": { 75 | "ContentType": { 76 | "c_type": "text", 77 | "c_subtype": "plain", 78 | "attributes": null 79 | } 80 | }, 81 | "offset_field": 100, 82 | "offset_start": 113, 83 | "offset_end": 125 84 | } 85 | ], 86 | "is_encoding_problem": true, 87 | "body": { 88 | "Text": "body\n" 89 | }, 90 | "offset_header": 98, 91 | "offset_body": 126, 92 | "offset_end": 131 93 | } 94 | ] 95 | } -------------------------------------------------------------------------------- /resources/eml/malformed/005.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [], 9 | "parts": [ 10 | { 11 | "headers": [ 12 | { 13 | "name": "content_type", 14 | "value": { 15 | "ContentType": { 16 | "c_type": "multipart", 17 | "c_subtype": "mixed", 18 | "attributes": [ 19 | { 20 | "name": "boundary", 21 | "value": "a--" 22 | } 23 | ] 24 | } 25 | }, 26 | "offset_field": 0, 27 | "offset_start": 13, 28 | "offset_end": 47 29 | } 30 | ], 31 | "is_encoding_problem": false, 32 | "body": { 33 | "Multipart": [ 34 | 1 35 | ] 36 | }, 37 | "offset_header": 0, 38 | "offset_body": 49, 39 | "offset_end": 202 40 | }, 41 | { 42 | "headers": [ 43 | { 44 | "name": "content_type", 45 | "value": { 46 | "ContentType": { 47 | "c_type": "multipart", 48 | "c_subtype": "mixed", 49 | "attributes": [ 50 | { 51 | "name": "boundary", 52 | "value": "a----" 53 | } 54 | ] 55 | } 56 | }, 57 | "offset_field": 56, 58 | "offset_start": 69, 59 | "offset_end": 105 60 | } 61 | ], 62 | "is_encoding_problem": false, 63 | "body": { 64 | "Multipart": [ 65 | 2 66 | ] 67 | }, 68 | "offset_header": 56, 69 | "offset_body": 107, 70 | "offset_end": 193 71 | }, 72 | { 73 | "headers": [ 74 | { 75 | "name": "content_type", 76 | "value": { 77 | "ContentType": { 78 | "c_type": "text", 79 | "c_subtype": "plain", 80 | "attributes": null 81 | } 82 | }, 83 | "offset_field": 116, 84 | "offset_start": 129, 85 | "offset_end": 142 86 | } 87 | ], 88 | "is_encoding_problem": false, 89 | "body": { 90 | "Text": "body" 91 | }, 92 | "offset_header": 116, 93 | "offset_body": 144, 94 | "offset_end": 148 95 | } 96 | ] 97 | } -------------------------------------------------------------------------------- /resources/eml/malformed/005.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="a--" 2 | 3 | --a-- 4 | Content-Type: multipart/mixed; boundary="a----" 5 | 6 | --a---- 7 | Content-Type: text/plain 8 | 9 | body 10 | --a------ 11 | Content-Type: text/html 12 | 13 | body2 14 | --a---- -------------------------------------------------------------------------------- /resources/eml/malformed/005.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [], 9 | "parts": [ 10 | { 11 | "headers": [ 12 | { 13 | "name": "content_type", 14 | "value": { 15 | "ContentType": { 16 | "c_type": "multipart", 17 | "c_subtype": "mixed", 18 | "attributes": [ 19 | { 20 | "name": "boundary", 21 | "value": "a--" 22 | } 23 | ] 24 | } 25 | }, 26 | "offset_field": 0, 27 | "offset_start": 13, 28 | "offset_end": 46 29 | } 30 | ], 31 | "is_encoding_problem": false, 32 | "body": { 33 | "Multipart": [ 34 | 1 35 | ] 36 | }, 37 | "offset_header": 0, 38 | "offset_body": 47, 39 | "offset_end": 189 40 | }, 41 | { 42 | "headers": [ 43 | { 44 | "name": "content_type", 45 | "value": { 46 | "ContentType": { 47 | "c_type": "multipart", 48 | "c_subtype": "mixed", 49 | "attributes": [ 50 | { 51 | "name": "boundary", 52 | "value": "a----" 53 | } 54 | ] 55 | } 56 | }, 57 | "offset_field": 53, 58 | "offset_start": 66, 59 | "offset_end": 101 60 | } 61 | ], 62 | "is_encoding_problem": false, 63 | "body": { 64 | "Multipart": [ 65 | 2 66 | ] 67 | }, 68 | "offset_header": 53, 69 | "offset_body": 102, 70 | "offset_end": 181 71 | }, 72 | { 73 | "headers": [ 74 | { 75 | "name": "content_type", 76 | "value": { 77 | "ContentType": { 78 | "c_type": "text", 79 | "c_subtype": "plain", 80 | "attributes": null 81 | } 82 | }, 83 | "offset_field": 110, 84 | "offset_start": 123, 85 | "offset_end": 135 86 | } 87 | ], 88 | "is_encoding_problem": false, 89 | "body": { 90 | "Text": "body" 91 | }, 92 | "offset_header": 110, 93 | "offset_body": 136, 94 | "offset_end": 140 95 | } 96 | ] 97 | } -------------------------------------------------------------------------------- /resources/eml/malformed/006.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 2 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "multipart", 15 | "c_subtype": "mixed", 16 | "attributes": [ 17 | { 18 | "name": "boundary", 19 | "value": "a" 20 | } 21 | ] 22 | } 23 | }, 24 | "offset_field": 0, 25 | "offset_start": 13, 26 | "offset_end": 45 27 | } 28 | ], 29 | "is_encoding_problem": false, 30 | "body": { 31 | "Multipart": [ 32 | 1 33 | ] 34 | }, 35 | "offset_header": 0, 36 | "offset_body": 47, 37 | "offset_end": 140 38 | }, 39 | { 40 | "headers": [ 41 | { 42 | "name": "content_type", 43 | "value": { 44 | "ContentType": { 45 | "c_type": "multipart", 46 | "c_subtype": "mixed", 47 | "attributes": [ 48 | { 49 | "name": "boundary", 50 | "value": "ab" 51 | } 52 | ] 53 | } 54 | }, 55 | "offset_field": 52, 56 | "offset_start": 65, 57 | "offset_end": 98 58 | } 59 | ], 60 | "is_encoding_problem": false, 61 | "body": { 62 | "Multipart": [ 63 | 2 64 | ] 65 | }, 66 | "offset_header": 52, 67 | "offset_body": 100, 68 | "offset_end": 140 69 | }, 70 | { 71 | "headers": [ 72 | { 73 | "name": "content_type", 74 | "value": { 75 | "ContentType": { 76 | "c_type": "text", 77 | "c_subtype": "plain", 78 | "attributes": null 79 | } 80 | }, 81 | "offset_field": 106, 82 | "offset_start": 119, 83 | "offset_end": 132 84 | } 85 | ], 86 | "is_encoding_problem": true, 87 | "body": { 88 | "Text": "body\r\n" 89 | }, 90 | "offset_header": 106, 91 | "offset_body": 134, 92 | "offset_end": 140 93 | } 94 | ] 95 | } -------------------------------------------------------------------------------- /resources/eml/malformed/006.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="a" 2 | 3 | --a 4 | Content-Type: multipart/mixed; boundary="ab" 5 | 6 | --ab 7 | Content-Type: text/plain 8 | 9 | body 10 | -------------------------------------------------------------------------------- /resources/eml/malformed/006.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 2 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "multipart", 15 | "c_subtype": "mixed", 16 | "attributes": [ 17 | { 18 | "name": "boundary", 19 | "value": "a" 20 | } 21 | ] 22 | } 23 | }, 24 | "offset_field": 0, 25 | "offset_start": 13, 26 | "offset_end": 44 27 | } 28 | ], 29 | "is_encoding_problem": false, 30 | "body": { 31 | "Multipart": [ 32 | 1 33 | ] 34 | }, 35 | "offset_header": 0, 36 | "offset_body": 45, 37 | "offset_end": 131 38 | }, 39 | { 40 | "headers": [ 41 | { 42 | "name": "content_type", 43 | "value": { 44 | "ContentType": { 45 | "c_type": "multipart", 46 | "c_subtype": "mixed", 47 | "attributes": [ 48 | { 49 | "name": "boundary", 50 | "value": "ab" 51 | } 52 | ] 53 | } 54 | }, 55 | "offset_field": 49, 56 | "offset_start": 62, 57 | "offset_end": 94 58 | } 59 | ], 60 | "is_encoding_problem": false, 61 | "body": { 62 | "Multipart": [ 63 | 2 64 | ] 65 | }, 66 | "offset_header": 49, 67 | "offset_body": 95, 68 | "offset_end": 131 69 | }, 70 | { 71 | "headers": [ 72 | { 73 | "name": "content_type", 74 | "value": { 75 | "ContentType": { 76 | "c_type": "text", 77 | "c_subtype": "plain", 78 | "attributes": null 79 | } 80 | }, 81 | "offset_field": 100, 82 | "offset_start": 113, 83 | "offset_end": 125 84 | } 85 | ], 86 | "is_encoding_problem": true, 87 | "body": { 88 | "Text": "body\n" 89 | }, 90 | "offset_header": 100, 91 | "offset_body": 126, 92 | "offset_end": 131 93 | } 94 | ] 95 | } -------------------------------------------------------------------------------- /resources/eml/malformed/007.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1 4 | ], 5 | "text_body": [ 6 | 1 7 | ], 8 | "attachments": [ 9 | 2 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "a" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 45 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1, 37 | 2 38 | ] 39 | }, 40 | "offset_header": 0, 41 | "offset_body": 47, 42 | "offset_end": 168 43 | }, 44 | { 45 | "headers": [ 46 | { 47 | "name": "content_type", 48 | "value": { 49 | "ContentType": { 50 | "c_type": "multipart", 51 | "c_subtype": "mixed", 52 | "attributes": [ 53 | { 54 | "name": "boundary", 55 | "value": "ab" 56 | } 57 | ] 58 | } 59 | }, 60 | "offset_field": 52, 61 | "offset_start": 65, 62 | "offset_end": 98 63 | }, 64 | { 65 | "name": "mime_version", 66 | "value": { 67 | "Text": "1.0" 68 | }, 69 | "offset_field": 98, 70 | "offset_start": 111, 71 | "offset_end": 117 72 | }, 73 | { 74 | "name": "content_type", 75 | "value": { 76 | "ContentType": { 77 | "c_type": "text", 78 | "c_subtype": "plain", 79 | "attributes": null 80 | } 81 | }, 82 | "offset_field": 123, 83 | "offset_start": 136, 84 | "offset_end": 149 85 | } 86 | ], 87 | "is_encoding_problem": false, 88 | "body": { 89 | "Text": "" 90 | }, 91 | "offset_header": 52, 92 | "offset_body": 151, 93 | "offset_end": 151 94 | }, 95 | { 96 | "headers": [], 97 | "is_encoding_problem": true, 98 | "body": { 99 | "Text": "" 100 | }, 101 | "offset_header": 154, 102 | "offset_body": 168, 103 | "offset_end": 168 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /resources/eml/malformed/007.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="a" 2 | 3 | --a 4 | Content-Type: multipart/mixed; boundary="ab" 5 | MIME-Version: 1.0 6 | --ab 7 | Content-Type: text/plain 8 | 9 | --ab-- 10 | --a-- 11 | 12 | -------------------------------------------------------------------------------- /resources/eml/malformed/007.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1 4 | ], 5 | "text_body": [ 6 | 1 7 | ], 8 | "attachments": [ 9 | 2 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "a" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 44 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1, 37 | 2 38 | ] 39 | }, 40 | "offset_header": 0, 41 | "offset_body": 45, 42 | "offset_end": 157 43 | }, 44 | { 45 | "headers": [ 46 | { 47 | "name": "content_type", 48 | "value": { 49 | "ContentType": { 50 | "c_type": "multipart", 51 | "c_subtype": "mixed", 52 | "attributes": [ 53 | { 54 | "name": "boundary", 55 | "value": "ab" 56 | } 57 | ] 58 | } 59 | }, 60 | "offset_field": 49, 61 | "offset_start": 62, 62 | "offset_end": 94 63 | }, 64 | { 65 | "name": "mime_version", 66 | "value": { 67 | "Text": "1.0" 68 | }, 69 | "offset_field": 94, 70 | "offset_start": 107, 71 | "offset_end": 112 72 | }, 73 | { 74 | "name": "content_type", 75 | "value": { 76 | "ContentType": { 77 | "c_type": "text", 78 | "c_subtype": "plain", 79 | "attributes": null 80 | } 81 | }, 82 | "offset_field": 117, 83 | "offset_start": 130, 84 | "offset_end": 142 85 | } 86 | ], 87 | "is_encoding_problem": false, 88 | "body": { 89 | "Text": "" 90 | }, 91 | "offset_header": 49, 92 | "offset_body": 143, 93 | "offset_end": 143 94 | }, 95 | { 96 | "headers": [], 97 | "is_encoding_problem": true, 98 | "body": { 99 | "Text": "" 100 | }, 101 | "offset_header": 146, 102 | "offset_body": 157, 103 | "offset_end": 157 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /resources/eml/malformed/008.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [ 9 | 3 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "ab" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 46 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1 37 | ] 38 | }, 39 | "offset_header": 0, 40 | "offset_body": 48, 41 | "offset_end": 180 42 | }, 43 | { 44 | "headers": [ 45 | { 46 | "name": "content_type", 47 | "value": { 48 | "ContentType": { 49 | "c_type": "multipart", 50 | "c_subtype": "mixed", 51 | "attributes": [ 52 | { 53 | "name": "boundary", 54 | "value": "a" 55 | } 56 | ] 57 | } 58 | }, 59 | "offset_field": 54, 60 | "offset_start": 67, 61 | "offset_end": 99 62 | } 63 | ], 64 | "is_encoding_problem": false, 65 | "body": { 66 | "Multipart": [ 67 | 2, 68 | 3 69 | ] 70 | }, 71 | "offset_header": 54, 72 | "offset_body": 101, 73 | "offset_end": 180 74 | }, 75 | { 76 | "headers": [ 77 | { 78 | "name": "content_type", 79 | "value": { 80 | "ContentType": { 81 | "c_type": "text", 82 | "c_subtype": "plain", 83 | "attributes": null 84 | } 85 | }, 86 | "offset_field": 106, 87 | "offset_start": 119, 88 | "offset_end": 132 89 | } 90 | ], 91 | "is_encoding_problem": false, 92 | "body": { 93 | "Text": "body" 94 | }, 95 | "offset_header": 106, 96 | "offset_body": 134, 97 | "offset_end": 138 98 | }, 99 | { 100 | "headers": [ 101 | { 102 | "name": "content_type", 103 | "value": { 104 | "ContentType": { 105 | "c_type": "text", 106 | "c_subtype": "html", 107 | "attributes": null 108 | } 109 | }, 110 | "offset_field": 146, 111 | "offset_start": 159, 112 | "offset_end": 171 113 | } 114 | ], 115 | "is_encoding_problem": true, 116 | "body": { 117 | "Text": "body2\r\n" 118 | }, 119 | "offset_header": 143, 120 | "offset_body": 173, 121 | "offset_end": 180 122 | } 123 | ] 124 | } -------------------------------------------------------------------------------- /resources/eml/malformed/008.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="ab" 2 | 3 | --ab 4 | Content-Type: multipart/mixed; boundary="a" 5 | 6 | --a 7 | Content-Type: text/plain 8 | 9 | body 10 | --ab 11 | Content-Type: text/html 12 | 13 | body2 14 | -------------------------------------------------------------------------------- /resources/eml/malformed/008.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [ 9 | 3 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "ab" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 45 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1 37 | ] 38 | }, 39 | "offset_header": 0, 40 | "offset_body": 46, 41 | "offset_end": 167 42 | }, 43 | { 44 | "headers": [ 45 | { 46 | "name": "content_type", 47 | "value": { 48 | "ContentType": { 49 | "c_type": "multipart", 50 | "c_subtype": "mixed", 51 | "attributes": [ 52 | { 53 | "name": "boundary", 54 | "value": "a" 55 | } 56 | ] 57 | } 58 | }, 59 | "offset_field": 51, 60 | "offset_start": 64, 61 | "offset_end": 95 62 | } 63 | ], 64 | "is_encoding_problem": false, 65 | "body": { 66 | "Multipart": [ 67 | 2, 68 | 3 69 | ] 70 | }, 71 | "offset_header": 51, 72 | "offset_body": 96, 73 | "offset_end": 167 74 | }, 75 | { 76 | "headers": [ 77 | { 78 | "name": "content_type", 79 | "value": { 80 | "ContentType": { 81 | "c_type": "text", 82 | "c_subtype": "plain", 83 | "attributes": null 84 | } 85 | }, 86 | "offset_field": 100, 87 | "offset_start": 113, 88 | "offset_end": 125 89 | } 90 | ], 91 | "is_encoding_problem": false, 92 | "body": { 93 | "Text": "body" 94 | }, 95 | "offset_header": 100, 96 | "offset_body": 126, 97 | "offset_end": 130 98 | }, 99 | { 100 | "headers": [ 101 | { 102 | "name": "content_type", 103 | "value": { 104 | "ContentType": { 105 | "c_type": "text", 106 | "c_subtype": "html", 107 | "attributes": null 108 | } 109 | }, 110 | "offset_field": 136, 111 | "offset_start": 149, 112 | "offset_end": 160 113 | } 114 | ], 115 | "is_encoding_problem": true, 116 | "body": { 117 | "Text": "body2\n" 118 | }, 119 | "offset_header": 134, 120 | "offset_body": 161, 121 | "offset_end": 167 122 | } 123 | ] 124 | } -------------------------------------------------------------------------------- /resources/eml/malformed/009.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [ 9 | 3 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "1" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 45 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1 37 | ] 38 | }, 39 | "offset_header": 0, 40 | "offset_body": 47, 41 | "offset_end": 210 42 | }, 43 | { 44 | "headers": [ 45 | { 46 | "name": "content_type", 47 | "value": { 48 | "ContentType": { 49 | "c_type": "multipart", 50 | "c_subtype": "mixed", 51 | "attributes": [ 52 | { 53 | "name": "boundary", 54 | "value": "2" 55 | } 56 | ] 57 | } 58 | }, 59 | "offset_field": 52, 60 | "offset_start": 65, 61 | "offset_end": 97 62 | } 63 | ], 64 | "is_encoding_problem": false, 65 | "body": { 66 | "Multipart": [ 67 | 2, 68 | 3 69 | ] 70 | }, 71 | "offset_header": 52, 72 | "offset_body": 99, 73 | "offset_end": 210 74 | }, 75 | { 76 | "headers": [ 77 | { 78 | "name": "content_type", 79 | "value": { 80 | "ContentType": { 81 | "c_type": "text", 82 | "c_subtype": "plain", 83 | "attributes": null 84 | } 85 | }, 86 | "offset_field": 104, 87 | "offset_start": 117, 88 | "offset_end": 130 89 | } 90 | ], 91 | "is_encoding_problem": false, 92 | "body": { 93 | "Text": "1" 94 | }, 95 | "offset_header": 104, 96 | "offset_body": 132, 97 | "offset_end": 133 98 | }, 99 | { 100 | "headers": [ 101 | { 102 | "name": "content_type", 103 | "value": { 104 | "ContentType": { 105 | "c_type": "text", 106 | "c_subtype": "plain", 107 | "attributes": null 108 | } 109 | }, 110 | "offset_field": 140, 111 | "offset_start": 153, 112 | "offset_end": 166 113 | } 114 | ], 115 | "is_encoding_problem": true, 116 | "body": { 117 | "Text": "22\r\n--1\r\nContent-Type: text/plain\r\n\r\n333\r\n" 118 | }, 119 | "offset_header": 140, 120 | "offset_body": 168, 121 | "offset_end": 210 122 | } 123 | ] 124 | } -------------------------------------------------------------------------------- /resources/eml/malformed/009.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1" 2 | 3 | --1 4 | Content-Type: multipart/mixed; boundary="2" 5 | 6 | --2 7 | Content-Type: text/plain 8 | 9 | 1 10 | --2 11 | Content-Type: text/plain 12 | 13 | 22 14 | --1 15 | Content-Type: text/plain 16 | 17 | 333 18 | -------------------------------------------------------------------------------- /resources/eml/malformed/009.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [ 9 | 3 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "1" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 44 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1 37 | ] 38 | }, 39 | "offset_header": 0, 40 | "offset_body": 45, 41 | "offset_end": 193 42 | }, 43 | { 44 | "headers": [ 45 | { 46 | "name": "content_type", 47 | "value": { 48 | "ContentType": { 49 | "c_type": "multipart", 50 | "c_subtype": "mixed", 51 | "attributes": [ 52 | { 53 | "name": "boundary", 54 | "value": "2" 55 | } 56 | ] 57 | } 58 | }, 59 | "offset_field": 49, 60 | "offset_start": 62, 61 | "offset_end": 93 62 | } 63 | ], 64 | "is_encoding_problem": false, 65 | "body": { 66 | "Multipart": [ 67 | 2, 68 | 3 69 | ] 70 | }, 71 | "offset_header": 49, 72 | "offset_body": 94, 73 | "offset_end": 193 74 | }, 75 | { 76 | "headers": [ 77 | { 78 | "name": "content_type", 79 | "value": { 80 | "ContentType": { 81 | "c_type": "text", 82 | "c_subtype": "plain", 83 | "attributes": null 84 | } 85 | }, 86 | "offset_field": 98, 87 | "offset_start": 111, 88 | "offset_end": 123 89 | } 90 | ], 91 | "is_encoding_problem": false, 92 | "body": { 93 | "Text": "1" 94 | }, 95 | "offset_header": 98, 96 | "offset_body": 124, 97 | "offset_end": 125 98 | }, 99 | { 100 | "headers": [ 101 | { 102 | "name": "content_type", 103 | "value": { 104 | "ContentType": { 105 | "c_type": "text", 106 | "c_subtype": "plain", 107 | "attributes": null 108 | } 109 | }, 110 | "offset_field": 130, 111 | "offset_start": 143, 112 | "offset_end": 155 113 | } 114 | ], 115 | "is_encoding_problem": true, 116 | "body": { 117 | "Text": "22\n--1\nContent-Type: text/plain\n\n333\n" 118 | }, 119 | "offset_header": 130, 120 | "offset_body": 156, 121 | "offset_end": 193 122 | } 123 | ] 124 | } -------------------------------------------------------------------------------- /resources/eml/malformed/010.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 0 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "message", 15 | "c_subtype": "rfc822", 16 | "attributes": null 17 | } 18 | }, 19 | "offset_field": 0, 20 | "offset_start": 13, 21 | "offset_end": 30 22 | } 23 | ], 24 | "is_encoding_problem": false, 25 | "body": { 26 | "Message": { 27 | "html_body": [], 28 | "text_body": [], 29 | "attachments": [ 30 | 0 31 | ], 32 | "parts": [ 33 | { 34 | "headers": [ 35 | { 36 | "name": "content_type", 37 | "value": { 38 | "ContentType": { 39 | "c_type": "message", 40 | "c_subtype": "rfc822", 41 | "attributes": null 42 | } 43 | }, 44 | "offset_field": 32, 45 | "offset_start": 45, 46 | "offset_end": 62 47 | } 48 | ], 49 | "is_encoding_problem": false, 50 | "body": { 51 | "Message": { 52 | "html_body": [ 53 | 0 54 | ], 55 | "text_body": [ 56 | 0 57 | ], 58 | "attachments": [], 59 | "parts": [ 60 | { 61 | "headers": [ 62 | { 63 | "name": "content_type", 64 | "value": { 65 | "ContentType": { 66 | "c_type": "text", 67 | "c_subtype": "plain", 68 | "attributes": null 69 | } 70 | }, 71 | "offset_field": 64, 72 | "offset_start": 77, 73 | "offset_end": 90 74 | } 75 | ], 76 | "is_encoding_problem": false, 77 | "body": { 78 | "Text": "1\r\n" 79 | }, 80 | "offset_header": 64, 81 | "offset_body": 92, 82 | "offset_end": 95 83 | } 84 | ] 85 | } 86 | }, 87 | "offset_header": 32, 88 | "offset_body": 64, 89 | "offset_end": 95 90 | } 91 | ] 92 | } 93 | }, 94 | "offset_header": 0, 95 | "offset_body": 32, 96 | "offset_end": 95 97 | } 98 | ] 99 | } -------------------------------------------------------------------------------- /resources/eml/malformed/010.eml: -------------------------------------------------------------------------------- 1 | Content-Type: message/rfc822 2 | 3 | Content-Type: message/rfc822 4 | 5 | Content-Type: text/plain 6 | 7 | 1 8 | -------------------------------------------------------------------------------- /resources/eml/malformed/010.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [], 3 | "text_body": [], 4 | "attachments": [ 5 | 0 6 | ], 7 | "parts": [ 8 | { 9 | "headers": [ 10 | { 11 | "name": "content_type", 12 | "value": { 13 | "ContentType": { 14 | "c_type": "message", 15 | "c_subtype": "rfc822", 16 | "attributes": null 17 | } 18 | }, 19 | "offset_field": 0, 20 | "offset_start": 13, 21 | "offset_end": 29 22 | } 23 | ], 24 | "is_encoding_problem": false, 25 | "body": { 26 | "Message": { 27 | "html_body": [], 28 | "text_body": [], 29 | "attachments": [ 30 | 0 31 | ], 32 | "parts": [ 33 | { 34 | "headers": [ 35 | { 36 | "name": "content_type", 37 | "value": { 38 | "ContentType": { 39 | "c_type": "message", 40 | "c_subtype": "rfc822", 41 | "attributes": null 42 | } 43 | }, 44 | "offset_field": 30, 45 | "offset_start": 43, 46 | "offset_end": 59 47 | } 48 | ], 49 | "is_encoding_problem": false, 50 | "body": { 51 | "Message": { 52 | "html_body": [ 53 | 0 54 | ], 55 | "text_body": [ 56 | 0 57 | ], 58 | "attachments": [], 59 | "parts": [ 60 | { 61 | "headers": [ 62 | { 63 | "name": "content_type", 64 | "value": { 65 | "ContentType": { 66 | "c_type": "text", 67 | "c_subtype": "plain", 68 | "attributes": null 69 | } 70 | }, 71 | "offset_field": 60, 72 | "offset_start": 73, 73 | "offset_end": 85 74 | } 75 | ], 76 | "is_encoding_problem": false, 77 | "body": { 78 | "Text": "1\n" 79 | }, 80 | "offset_header": 60, 81 | "offset_body": 86, 82 | "offset_end": 88 83 | } 84 | ] 85 | } 86 | }, 87 | "offset_header": 30, 88 | "offset_body": 60, 89 | "offset_end": 88 90 | } 91 | ] 92 | } 93 | }, 94 | "offset_header": 0, 95 | "offset_body": 30, 96 | "offset_end": 88 97 | } 98 | ] 99 | } -------------------------------------------------------------------------------- /resources/eml/malformed/011.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [ 9 | 3 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "1" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 45 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1 37 | ] 38 | }, 39 | "offset_header": 0, 40 | "offset_body": 47, 41 | "offset_end": 210 42 | }, 43 | { 44 | "headers": [ 45 | { 46 | "name": "content_type", 47 | "value": { 48 | "ContentType": { 49 | "c_type": "multipart", 50 | "c_subtype": "mixed", 51 | "attributes": [ 52 | { 53 | "name": "boundary", 54 | "value": "2" 55 | } 56 | ] 57 | } 58 | }, 59 | "offset_field": 52, 60 | "offset_start": 65, 61 | "offset_end": 97 62 | } 63 | ], 64 | "is_encoding_problem": false, 65 | "body": { 66 | "Multipart": [ 67 | 2, 68 | 3 69 | ] 70 | }, 71 | "offset_header": 52, 72 | "offset_body": 99, 73 | "offset_end": 210 74 | }, 75 | { 76 | "headers": [ 77 | { 78 | "name": "content_type", 79 | "value": { 80 | "ContentType": { 81 | "c_type": "text", 82 | "c_subtype": "plain", 83 | "attributes": null 84 | } 85 | }, 86 | "offset_field": 104, 87 | "offset_start": 117, 88 | "offset_end": 130 89 | } 90 | ], 91 | "is_encoding_problem": false, 92 | "body": { 93 | "Text": "1" 94 | }, 95 | "offset_header": 104, 96 | "offset_body": 132, 97 | "offset_end": 133 98 | }, 99 | { 100 | "headers": [ 101 | { 102 | "name": "content_type", 103 | "value": { 104 | "ContentType": { 105 | "c_type": "text", 106 | "c_subtype": "plain", 107 | "attributes": null 108 | } 109 | }, 110 | "offset_field": 140, 111 | "offset_start": 153, 112 | "offset_end": 166 113 | } 114 | ], 115 | "is_encoding_problem": true, 116 | "body": { 117 | "Text": "22\r\n--1\r\nContent-Type: text/plain\r\n\r\n333\r\n" 118 | }, 119 | "offset_header": 140, 120 | "offset_body": 168, 121 | "offset_end": 210 122 | } 123 | ] 124 | } -------------------------------------------------------------------------------- /resources/eml/malformed/011.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1" 2 | 3 | --1 4 | Content-Type: multipart/mixed; boundary="2" 5 | 6 | --2 7 | Content-Type: text/plain 8 | 9 | 1 10 | --2 11 | Content-Type: text/plain 12 | 13 | 22 14 | --1 15 | Content-Type: text/plain 16 | 17 | 333 18 | -------------------------------------------------------------------------------- /resources/eml/malformed/011.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 2 4 | ], 5 | "text_body": [ 6 | 2 7 | ], 8 | "attachments": [ 9 | 3 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "content_type", 16 | "value": { 17 | "ContentType": { 18 | "c_type": "multipart", 19 | "c_subtype": "mixed", 20 | "attributes": [ 21 | { 22 | "name": "boundary", 23 | "value": "1" 24 | } 25 | ] 26 | } 27 | }, 28 | "offset_field": 0, 29 | "offset_start": 13, 30 | "offset_end": 44 31 | } 32 | ], 33 | "is_encoding_problem": false, 34 | "body": { 35 | "Multipart": [ 36 | 1 37 | ] 38 | }, 39 | "offset_header": 0, 40 | "offset_body": 45, 41 | "offset_end": 193 42 | }, 43 | { 44 | "headers": [ 45 | { 46 | "name": "content_type", 47 | "value": { 48 | "ContentType": { 49 | "c_type": "multipart", 50 | "c_subtype": "mixed", 51 | "attributes": [ 52 | { 53 | "name": "boundary", 54 | "value": "2" 55 | } 56 | ] 57 | } 58 | }, 59 | "offset_field": 49, 60 | "offset_start": 62, 61 | "offset_end": 93 62 | } 63 | ], 64 | "is_encoding_problem": false, 65 | "body": { 66 | "Multipart": [ 67 | 2, 68 | 3 69 | ] 70 | }, 71 | "offset_header": 49, 72 | "offset_body": 94, 73 | "offset_end": 193 74 | }, 75 | { 76 | "headers": [ 77 | { 78 | "name": "content_type", 79 | "value": { 80 | "ContentType": { 81 | "c_type": "text", 82 | "c_subtype": "plain", 83 | "attributes": null 84 | } 85 | }, 86 | "offset_field": 98, 87 | "offset_start": 111, 88 | "offset_end": 123 89 | } 90 | ], 91 | "is_encoding_problem": false, 92 | "body": { 93 | "Text": "1" 94 | }, 95 | "offset_header": 98, 96 | "offset_body": 124, 97 | "offset_end": 125 98 | }, 99 | { 100 | "headers": [ 101 | { 102 | "name": "content_type", 103 | "value": { 104 | "ContentType": { 105 | "c_type": "text", 106 | "c_subtype": "plain", 107 | "attributes": null 108 | } 109 | }, 110 | "offset_field": 130, 111 | "offset_start": 143, 112 | "offset_end": 155 113 | } 114 | ], 115 | "is_encoding_problem": true, 116 | "body": { 117 | "Text": "22\n--1\nContent-Type: text/plain\n\n333\n" 118 | }, 119 | "offset_header": 130, 120 | "offset_body": 156, 121 | "offset_end": 193 122 | } 123 | ] 124 | } -------------------------------------------------------------------------------- /resources/eml/malformed/012.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1" 2 | 3 | --1 4 | Content-Type: multipart/mixed; boundary="2" 5 | 6 | --2 7 | Content-Type: message/rfc822 8 | 9 | Content-Type: text/plain 10 | 11 | 1 12 | --2 13 | Content-Type: message/rfc822 14 | 15 | Content-Type: text/plain 16 | 17 | 22 18 | --1 19 | Content-Type: message/rfc822 20 | 21 | Content-Type: text/plain 22 | 23 | 333 24 | -------------------------------------------------------------------------------- /resources/eml/malformed/013.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1" 2 | MIME-Version: 1.0 3 | 4 | --1 5 | Content-Type: text/plain 6 | 7 | hello, world 8 | --1 9 | Content-Type: multipart/mixed; boundary="1" 10 | MIME-Version: 2.0 11 | 12 | --1 13 | Content-Type: text/plain 14 | 15 | hello, world 16 | --1 17 | Content-Type: multipart/mixed; boundary="1" 18 | MIME-Version: abc 19 | 20 | --1 21 | Content-Type: text/plain 22 | 23 | hello, world 24 | --1 25 | Content-Type: multipart/mixed; boundary="1" 26 | MIME-Version: 27 | 28 | --1 29 | Content-Type: text/plain 30 | 31 | hello, world 32 | --1 33 | -------------------------------------------------------------------------------- /resources/eml/malformed/014.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1 4 | ], 5 | "text_body": [ 6 | 1 7 | ], 8 | "attachments": [], 9 | "parts": [ 10 | { 11 | "headers": [ 12 | { 13 | "name": "content_type", 14 | "value": { 15 | "ContentType": { 16 | "c_type": "multipart", 17 | "c_subtype": "mixed", 18 | "attributes": [ 19 | { 20 | "name": "boundary", 21 | "value": "1" 22 | } 23 | ] 24 | } 25 | }, 26 | "offset_field": 0, 27 | "offset_start": 13, 28 | "offset_end": 45 29 | } 30 | ], 31 | "is_encoding_problem": false, 32 | "body": { 33 | "Multipart": [ 34 | 1 35 | ] 36 | }, 37 | "offset_header": 0, 38 | "offset_body": 47, 39 | "offset_end": 99 40 | }, 41 | { 42 | "headers": [ 43 | { 44 | "name": "content_type", 45 | "value": { 46 | "ContentType": { 47 | "c_type": "text", 48 | "c_subtype": "plain", 49 | "attributes": null 50 | } 51 | }, 52 | "offset_field": 52, 53 | "offset_start": 65, 54 | "offset_end": 78 55 | } 56 | ], 57 | "is_encoding_problem": false, 58 | "body": { 59 | "Text": "hello, world" 60 | }, 61 | "offset_header": 52, 62 | "offset_body": 80, 63 | "offset_end": 92 64 | } 65 | ] 66 | } -------------------------------------------------------------------------------- /resources/eml/malformed/014.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1" 2 | 3 | --1 4 | Content-Type: text/plain 5 | 6 | hello, world 7 | --1 8 | -------------------------------------------------------------------------------- /resources/eml/malformed/014.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1 4 | ], 5 | "text_body": [ 6 | 1 7 | ], 8 | "attachments": [], 9 | "parts": [ 10 | { 11 | "headers": [ 12 | { 13 | "name": "content_type", 14 | "value": { 15 | "ContentType": { 16 | "c_type": "multipart", 17 | "c_subtype": "mixed", 18 | "attributes": [ 19 | { 20 | "name": "boundary", 21 | "value": "1" 22 | } 23 | ] 24 | } 25 | }, 26 | "offset_field": 0, 27 | "offset_start": 13, 28 | "offset_end": 44 29 | } 30 | ], 31 | "is_encoding_problem": false, 32 | "body": { 33 | "Multipart": [ 34 | 1 35 | ] 36 | }, 37 | "offset_header": 0, 38 | "offset_body": 45, 39 | "offset_end": 92 40 | }, 41 | { 42 | "headers": [ 43 | { 44 | "name": "content_type", 45 | "value": { 46 | "ContentType": { 47 | "c_type": "text", 48 | "c_subtype": "plain", 49 | "attributes": null 50 | } 51 | }, 52 | "offset_field": 49, 53 | "offset_start": 62, 54 | "offset_end": 74 55 | } 56 | ], 57 | "is_encoding_problem": false, 58 | "body": { 59 | "Text": "hello, world" 60 | }, 61 | "offset_header": 49, 62 | "offset_body": 75, 63 | "offset_end": 87 64 | } 65 | ] 66 | } -------------------------------------------------------------------------------- /resources/eml/malformed/015.eml: -------------------------------------------------------------------------------- 1 | Return-Path: 2 | Subject: Hello world 3 | From: Test User 4 | To: Another User 5 | Message-Id: <1.2.3.4@example> 6 | Mime-Version: 1.0 7 | Date: Sun, 23 May 2007 04:58:08 +0300 8 | Content-Type: multipart/signed; micalg=pgp-sha1; 9 | protocol="application/pgp-signature"; 10 | boundary="=-GNQXLhuj24Pl1aCkk4/d" 11 | 12 | --=-GNQXLhuj24Pl1aCkk4/d 13 | Content-Type: text/plain 14 | Content-Transfer-Encoding: quoted-printable 15 | 16 | There was a day=20 17 | a happy=20day 18 | 19 | --=-GNQXLhuj24Pl1aCkk4/d 20 | Content-Type: application/pgp-signature; name=signature.asc 21 | 22 | invalid 23 | 24 | --=-GNQXLhuj24Pl1aCkk4/d-- 25 | 26 | -------------------------------------------------------------------------------- /resources/eml/malformed/016.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1234567890123456789012345678901234567890123456789012345678901234567890123456789012" 2 | 3 | --1234567890123456789012345678901234567890123456789012345678901234567890123456789012 4 | Content-Type: multipart/mixed; boundary="123456789012345678901234567890123456789012345678901234567890123456789012345678901" 5 | 6 | --123456789012345678901234567890123456789012345678901234567890123456789012345678901 7 | Content-Type: multipart/mixed; boundary="12345678901234567890123456789012345678901234567890123456789012345678901234567890" 8 | 9 | --12345678901234567890123456789012345678901234567890123456789012345678901234567890 10 | Content-Type: text/plain 11 | 12 | 1 13 | --1234567890123456789012345678901234567890123456789012345678901234567890123456789012 14 | Content-Type: text/plain 15 | 16 | 22 17 | --123456789012345678901234567890123456789012345678901234567890123456789012345678901 18 | Content-Type: text/plain 19 | 20 | 333 21 | --12345678901234567890123456789012345678901234567890123456789012345678901234567890 22 | Content-Type: text/plain 23 | 24 | 4444 25 | -------------------------------------------------------------------------------- /resources/eml/malformed/017.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1 4 | ], 5 | "text_body": [ 6 | 1 7 | ], 8 | "attachments": [ 9 | 1 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "subject", 16 | "value": { 17 | "Text": "Hello world" 18 | }, 19 | "offset_field": 0, 20 | "offset_start": 8, 21 | "offset_end": 22 22 | }, 23 | { 24 | "name": "from", 25 | "value": { 26 | "Address": { 27 | "List": [ 28 | { 29 | "name": "Test User", 30 | "address": "test@example.org" 31 | } 32 | ] 33 | } 34 | }, 35 | "offset_field": 22, 36 | "offset_start": 27, 37 | "offset_end": 58 38 | }, 39 | { 40 | "name": "to", 41 | "value": { 42 | "Address": { 43 | "List": [ 44 | { 45 | "name": "Another User", 46 | "address": "test2@example.org" 47 | } 48 | ] 49 | } 50 | }, 51 | "offset_field": 58, 52 | "offset_start": 61, 53 | "offset_end": 96 54 | }, 55 | { 56 | "name": "content_type", 57 | "value": { 58 | "ContentType": { 59 | "c_type": "multipart", 60 | "c_subtype": "mixed", 61 | "attributes": [ 62 | { 63 | "name": "boundary", 64 | "value": "boundary" 65 | } 66 | ] 67 | } 68 | }, 69 | "offset_field": 96, 70 | "offset_start": 109, 71 | "offset_end": 149 72 | } 73 | ], 74 | "is_encoding_problem": false, 75 | "body": { 76 | "Multipart": [ 77 | 1 78 | ] 79 | }, 80 | "offset_header": 0, 81 | "offset_body": 151, 82 | "offset_end": 348 83 | }, 84 | { 85 | "headers": [ 86 | { 87 | "name": "content_type", 88 | "value": { 89 | "ContentType": { 90 | "c_type": "image", 91 | "c_subtype": "png", 92 | "attributes": null 93 | } 94 | }, 95 | "offset_field": 163, 96 | "offset_start": 176, 97 | "offset_end": 188 98 | }, 99 | { 100 | "name": "content_transfer_encoding", 101 | "value": { 102 | "Text": "base64" 103 | }, 104 | "offset_field": 188, 105 | "offset_start": 214, 106 | "offset_end": 223 107 | }, 108 | { 109 | "name": "content_disposition", 110 | "value": "Empty", 111 | "offset_field": 223, 112 | "offset_start": 243, 113 | "offset_end": 280 114 | }, 115 | { 116 | "name": "content_id", 117 | "value": { 118 | "Text": "image001.png@[...]" 119 | }, 120 | "offset_field": 280, 121 | "offset_start": 291, 122 | "offset_end": 314 123 | } 124 | ], 125 | "is_encoding_problem": false, 126 | "body": { 127 | "InlineBinary": [ 128 | 104, 129 | 101, 130 | 108, 131 | 108, 132 | 111, 133 | 32, 134 | 119, 135 | 111, 136 | 114, 137 | 108, 138 | 100, 139 | 10 140 | ] 141 | }, 142 | "offset_header": 163, 143 | "offset_body": 316, 144 | "offset_end": 332 145 | } 146 | ] 147 | } -------------------------------------------------------------------------------- /resources/eml/malformed/017.eml: -------------------------------------------------------------------------------- 1 | Subject: Hello world 2 | From: Test User 3 | To: Another User 4 | Content-Type: multipart/mixed 5 | boundary="boundary" 6 | 7 | --boundary 8 | Content-Type: image/png 9 | Content-Transfer-Encoding: base64 10 | Content-Disposition: ; 11 | filename="image001.png" 12 | Content-ID: 13 | 14 | aGVsbG8gd29ybGQK 15 | --boundary-- 16 | -------------------------------------------------------------------------------- /resources/eml/malformed/017.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1 4 | ], 5 | "text_body": [ 6 | 1 7 | ], 8 | "attachments": [ 9 | 1 10 | ], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "subject", 16 | "value": { 17 | "Text": "Hello world" 18 | }, 19 | "offset_field": 0, 20 | "offset_start": 8, 21 | "offset_end": 21 22 | }, 23 | { 24 | "name": "from", 25 | "value": { 26 | "Address": { 27 | "List": [ 28 | { 29 | "name": "Test User", 30 | "address": "test@example.org" 31 | } 32 | ] 33 | } 34 | }, 35 | "offset_field": 21, 36 | "offset_start": 26, 37 | "offset_end": 56 38 | }, 39 | { 40 | "name": "to", 41 | "value": { 42 | "Address": { 43 | "List": [ 44 | { 45 | "name": "Another User", 46 | "address": "test2@example.org" 47 | } 48 | ] 49 | } 50 | }, 51 | "offset_field": 56, 52 | "offset_start": 59, 53 | "offset_end": 93 54 | }, 55 | { 56 | "name": "content_type", 57 | "value": { 58 | "ContentType": { 59 | "c_type": "multipart", 60 | "c_subtype": "mixed", 61 | "attributes": [ 62 | { 63 | "name": "boundary", 64 | "value": "boundary" 65 | } 66 | ] 67 | } 68 | }, 69 | "offset_field": 93, 70 | "offset_start": 106, 71 | "offset_end": 144 72 | } 73 | ], 74 | "is_encoding_problem": false, 75 | "body": { 76 | "Multipart": [ 77 | 1 78 | ] 79 | }, 80 | "offset_header": 0, 81 | "offset_body": 145, 82 | "offset_end": 333 83 | }, 84 | { 85 | "headers": [ 86 | { 87 | "name": "content_type", 88 | "value": { 89 | "ContentType": { 90 | "c_type": "image", 91 | "c_subtype": "png", 92 | "attributes": null 93 | } 94 | }, 95 | "offset_field": 156, 96 | "offset_start": 169, 97 | "offset_end": 180 98 | }, 99 | { 100 | "name": "content_transfer_encoding", 101 | "value": { 102 | "Text": "base64" 103 | }, 104 | "offset_field": 180, 105 | "offset_start": 206, 106 | "offset_end": 214 107 | }, 108 | { 109 | "name": "content_disposition", 110 | "value": "Empty", 111 | "offset_field": 214, 112 | "offset_start": 234, 113 | "offset_end": 269 114 | }, 115 | { 116 | "name": "content_id", 117 | "value": { 118 | "Text": "image001.png@[...]" 119 | }, 120 | "offset_field": 269, 121 | "offset_start": 280, 122 | "offset_end": 302 123 | } 124 | ], 125 | "is_encoding_problem": false, 126 | "body": { 127 | "InlineBinary": [ 128 | 104, 129 | 101, 130 | 108, 131 | 108, 132 | 111, 133 | 32, 134 | 119, 135 | 111, 136 | 114, 137 | 108, 138 | 100, 139 | 10 140 | ] 141 | }, 142 | "offset_header": 156, 143 | "offset_body": 303, 144 | "offset_end": 319 145 | } 146 | ] 147 | } -------------------------------------------------------------------------------- /resources/eml/malformed/018.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 0 4 | ], 5 | "text_body": [ 6 | 0 7 | ], 8 | "attachments": [], 9 | "parts": [ 10 | { 11 | "headers": [ 12 | { 13 | "name": "content_type", 14 | "value": { 15 | "ContentType": { 16 | "c_type": "text", 17 | "c_subtype": "plain", 18 | "attributes": [ 19 | { 20 | "name": "charset", 21 | "value": "Windows-1252" 22 | } 23 | ] 24 | } 25 | }, 26 | "offset_field": 0, 27 | "offset_start": 13, 28 | "offset_end": 52 29 | }, 30 | { 31 | "name": "content_transfer_encoding", 32 | "value": { 33 | "Text": "quoted-printable" 34 | }, 35 | "offset_field": 52, 36 | "offset_start": 78, 37 | "offset_end": 97 38 | }, 39 | { 40 | "name": "mime_version", 41 | "value": { 42 | "Text": "1.0" 43 | }, 44 | "offset_field": 97, 45 | "offset_start": 110, 46 | "offset_end": 116 47 | } 48 | ], 49 | "is_encoding_problem": true, 50 | "body": { 51 | "Text": "Best\r\nEnviado desde mi BlackBerry=AE de Vodafone=\r\n\r\n\r\n\r\n\r\n\r\n" 52 | }, 53 | "offset_header": 0, 54 | "offset_body": 118, 55 | "offset_end": 361 56 | } 57 | ] 58 | } -------------------------------------------------------------------------------- /resources/eml/malformed/018.eml: -------------------------------------------------------------------------------- 1 | Content-Type: text/plain; 2 | charset="Windows-1252" 3 | Content-Transfer-Encoding: quoted-printable 4 | MIME-Version: 1.0 5 | 6 | Best 7 | Enviado desde mi BlackBerry=AE de Vodafone= 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /resources/eml/malformed/018.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 0 4 | ], 5 | "text_body": [ 6 | 0 7 | ], 8 | "attachments": [], 9 | "parts": [ 10 | { 11 | "headers": [ 12 | { 13 | "name": "content_type", 14 | "value": { 15 | "ContentType": { 16 | "c_type": "text", 17 | "c_subtype": "plain", 18 | "attributes": [ 19 | { 20 | "name": "charset", 21 | "value": "Windows-1252" 22 | } 23 | ] 24 | } 25 | }, 26 | "offset_field": 0, 27 | "offset_start": 13, 28 | "offset_end": 52 29 | }, 30 | { 31 | "name": "content_transfer_encoding", 32 | "value": { 33 | "Text": "quoted-printable" 34 | }, 35 | "offset_field": 52, 36 | "offset_start": 78, 37 | "offset_end": 97 38 | }, 39 | { 40 | "name": "mime_version", 41 | "value": { 42 | "Text": "1.0" 43 | }, 44 | "offset_field": 97, 45 | "offset_start": 110, 46 | "offset_end": 116 47 | } 48 | ], 49 | "is_encoding_problem": true, 50 | "body": { 51 | "Text": "Best\nEnviado desde mi BlackBerry=AE de Vodafone=\n\n\n\n\n\n" 52 | }, 53 | "offset_header": 0, 54 | "offset_body": 118, 55 | "offset_end": 354 56 | } 57 | ] 58 | } -------------------------------------------------------------------------------- /resources/eml/malformed/COPYING: -------------------------------------------------------------------------------- 1 | These test files are Copyright (c) 2003-2018 Dovecot authors, licensed under MIT. 2 | See the COPYING file at https://github.com/dovecot/core/blob/master/COPYING 3 | -------------------------------------------------------------------------------- /resources/eml/rfc/000.eml: -------------------------------------------------------------------------------- 1 | MIME-Version: 1.0 2 | From: Nathaniel Borenstein 3 | To: Ned Freed 4 | Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT) 5 | Subject: A multipart example 6 | Content-Type: multipart/mixed; 7 | boundary=unique-boundary-1 8 | 9 | This is the preamble area of a multipart message. 10 | Mail readers that understand multipart format 11 | should ignore this preamble. 12 | 13 | If you are reading this text, you might want to 14 | consider changing to a mail reader that understands 15 | how to properly display multipart messages. 16 | 17 | --unique-boundary-1 18 | 19 | ... Some text appears here ... 20 | 21 | [Note that the blank between the boundary and the start 22 | of the text in this part means no header fields were 23 | given and this is text in the US-ASCII character set. 24 | It could have been done with explicit typing as in the 25 | next part.] 26 | 27 | --unique-boundary-1 28 | Content-type: text/plain; charset=US-ASCII 29 | 30 | This could have been part of the previous part, but 31 | illustrates explicit versus implicit typing of body 32 | parts. 33 | 34 | --unique-boundary-1 35 | Content-Type: multipart/parallel; boundary=unique-boundary-2 36 | 37 | --unique-boundary-2 38 | Content-Type: audio/basic 39 | Content-Transfer-Encoding: base64 40 | 41 | ... base64-encoded 8000 Hz single-channel 42 | mu-law-format audio data goes here ... 43 | 44 | --unique-boundary-2 45 | Content-Type: image/jpeg 46 | Content-Transfer-Encoding: base64 47 | 48 | ... base64-encoded image data goes here ... 49 | 50 | --unique-boundary-2-- 51 | 52 | --unique-boundary-1 53 | Content-type: text/enriched 54 | 55 | This is enriched. 56 | as defined in RFC 1896 57 | 58 | Isn't it 59 | cool? 60 | 61 | --unique-boundary-1 62 | Content-Type: message/rfc822 63 | 64 | From: (mailbox in US-ASCII) 65 | To: (address in US-ASCII) 66 | Subject: (subject in US-ASCII) 67 | Content-Type: Text/plain; charset=ISO-8859-1 68 | Content-Transfer-Encoding: Quoted-printable 69 | 70 | ... Additional text in ISO-8859-1 goes here ... 71 | 72 | --unique-boundary-1-- 73 | -------------------------------------------------------------------------------- /resources/eml/rfc/001.eml: -------------------------------------------------------------------------------- 1 | From: Whomever 2 | To: Someone 3 | Date: Whenever 4 | Subject: whatever 5 | MIME-Version: 1.0 6 | Message-ID: 7 | Content-Type: multipart/alternative; boundary=42 8 | Content-ID: 9 | 10 | --42 11 | Content-Type: message/external-body; name="BodyFormats.ps"; 12 | site="thumper.bellcore.com"; mode="image"; 13 | access-type=ANON-FTP; directory="pub"; 14 | expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" 15 | 16 | Content-type: application/postscript 17 | Content-ID: 18 | 19 | --42 20 | Content-Type: message/external-body; access-type=local-file; 21 | name="/u/nsb/writing/rfcs/RFC-MIME.ps"; 22 | site="thumper.bellcore.com"; 23 | expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" 24 | 25 | Content-type: application/postscript 26 | Content-ID: 27 | 28 | --42 29 | Content-Type: message/external-body; 30 | access-type=mail-server 31 | server="listserv@bogus.bitnet"; 32 | expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" 33 | 34 | Content-type: application/postscript 35 | Content-ID: 36 | 37 | get RFC-MIME.DOC 38 | 39 | --42-- 40 | 41 | -------------------------------------------------------------------------------- /resources/eml/rfc/002.eml: -------------------------------------------------------------------------------- 1 | From: Al Gore 2 | To: White House Transportation Coordinator 3 | 4 | Subject: [Fwd: Map of Argentina with Description] 5 | Content-Type: multipart/mixed; 6 | boundary="D7F------------D7FD5A0B8AB9C65CCDBFA872" 7 | 8 | This is a multi-part message in MIME format. 9 | --D7F------------D7FD5A0B8AB9C65CCDBFA872 10 | Content-Type: text/plain; charset=us-ascii 11 | Content-Transfer-Encoding: 7bit 12 | 13 | Fred, 14 | 15 | Fire up Air Force One! We're going South! 16 | 17 | Thanks, 18 | Al 19 | --D7F------------D7FD5A0B8AB9C65CCDBFA872 20 | Content-Type: message/rfc822 21 | Content-Transfer-Encoding: 7bit 22 | Content-Disposition: inline 23 | 24 | Return-Path: 25 | Received: from mailhost.whitehouse.gov ([192.168.51.200]) 26 | by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453 27 | for ; 28 | Mon, 13 Aug 1998 l8:14:23 +1000 29 | Received: from the_big_box.whitehouse.gov ([192.168.51.50]) 30 | by mailhost.whitehouse.gov (8.8.8/8.8.7) with ESMTP id RAA20366 31 | for vice-president@whitehouse.gov; Mon, 13 Aug 1998 17:42:41 +1000 32 | Date: Mon, 13 Aug 1998 17:42:41 +1000 33 | Message-Id: <199804130742.RAA20366@mai1host.whitehouse.gov> 34 | From: Bill Clinton 35 | To: A1 (The Enforcer) Gore 36 | Subject: Map of Argentina with Description 37 | MIME-Version: 1.0 38 | Content-Type: multipart/mixed; 39 | boundary="DC8------------DC8638F443D87A7F0726DEF7" 40 | 41 | This is a multi-part message in MIME format. 42 | --DC8------------DC8638F443D87A7F0726DEF7 43 | Content-Type: text/plain; charset=us-ascii 44 | Content-Transfer-Encoding: 7bit 45 | 46 | Hi A1, 47 | 48 | I finally figured out this MIME thing. Pretty cool. I'll send you 49 | some sax music in .au files next week! 50 | 51 | Anyway, the attached image is really too small to get a good look at 52 | Argentina. Try this for a much better map: 53 | 54 | http://www.1one1yp1anet.com/dest/sam/graphics/map-arg.htm 55 | 56 | Then again, shouldn't the CIA have something like that? 57 | 58 | Bill 59 | --DC8------------DC8638F443D87A7F0726DEF7 60 | Content-Type: image/gif; name="map_of_Argentina.gif" 61 | Content-Transfer-Encoding: base64 62 | Content-Disposition: inline; fi1ename="map_of_Argentina.gif" 63 | 64 | R01GOD1hJQA1AKIAAP/////78P/omn19fQAAAAAAAAAAAAAAACwAAAAAJQA1AAAD7Qi63P5w 65 | wEmjBCLrnQnhYCgM1wh+pkgqqeC9XrutmBm7hAK3tP31gFcAiFKVQrGFR6kscnonTe7FAAad 66 | GugmRu3CmiBt57fsVq3Y0VFKnpYdxPC6M7Ze4crnnHum4oN6LFJ1bn5NXTN7OF5fQkN5WYow 67 | BEN2dkGQGWJtSzqGTICJgnQuTJN/WJsojad9qXMuhIWdjXKjY4tenjo6tjVssk2gaWq3uGNX 68 | U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz 69 | 7itICBxISKDBgwgTKjyYAAA7 70 | --DC8------------DC8638F443D87A7F0726DEF7-- 71 | 72 | --D7F------------D7FD5A0B8AB9C65CCDBFA872-- 73 | -------------------------------------------------------------------------------- /resources/eml/rfc/003.eml: -------------------------------------------------------------------------------- 1 | From: Nathaniel Borenstein 2 | To: Ned Freed 3 | Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST) 4 | Subject: Formatted text mail 5 | MIME-Version: 1.0 6 | Content-Type: multipart/alternative; boundary=boundary42 7 | 8 | --boundary42 9 | Content-Type: text/plain; charset=us-ascii 10 | 11 | ... plain text version of message goes here ... 12 | 13 | --boundary42 14 | Content-Type: text/enriched 15 | 16 | ... RFC 1896 text/enriched version of same message 17 | goes here ... 18 | 19 | --boundary42 20 | Content-Type: application/x-whatever 21 | 22 | ... fanciest version of same message goes here ... 23 | 24 | --boundary42-- 25 | -------------------------------------------------------------------------------- /resources/eml/rfc/004.eml: -------------------------------------------------------------------------------- 1 | From: Moderator-Address 2 | To: Recipient-List 3 | Date: Mon, 22 Mar 1994 13:34:51 +0000 4 | Subject: Internet Digest, volume 42 5 | MIME-Version: 1.0 6 | Content-Type: multipart/mixed; 7 | boundary="---- main boundary ----" 8 | 9 | ------ main boundary ---- 10 | 11 | ...Introductory text or table of contents... 12 | 13 | ------ main boundary ---- 14 | Content-Type: multipart/digest; 15 | boundary="---- next message ----" 16 | 17 | ------ next message ---- 18 | 19 | From: someone-else 20 | Date: Fri, 26 Mar 1993 11:13:32 +0200 21 | Subject: my opinion 22 | 23 | ...body goes here ... 24 | 25 | ------ next message ---- 26 | 27 | From: someone-else-again 28 | Date: Fri, 26 Mar 1993 10:07:13 -0500 29 | Subject: my different opinion 30 | 31 | ... another body goes here ... 32 | 33 | ------ next message ------ 34 | 35 | ------ main boundary ------ 36 | -------------------------------------------------------------------------------- /resources/eml/rfc/005.eml: -------------------------------------------------------------------------------- 1 | From: Nathaniel Borenstein 2 | To: Ned Freed 3 | Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST) 4 | Subject: Sample message 5 | MIME-Version: 1.0 6 | Content-type: multipart/mixed; boundary="simple boundary" 7 | 8 | This is the preamble. It is to be ignored, though it 9 | is a handy place for composition agents to include an 10 | explanatory note to non-MIME conformant readers. 11 | 12 | --simple boundary 13 | 14 | This is implicitly typed plain US-ASCII text. 15 | It does NOT end with a linebreak. 16 | --simple boundary 17 | Content-type: text/plain; charset=us-ascii 18 | 19 | This is explicitly typed plain US-ASCII text. 20 | It DOES end with a linebreak. 21 | 22 | --simple boundary-- 23 | 24 | This is the epilogue. It is also to be ignored. 25 | -------------------------------------------------------------------------------- /resources/eml/rfc/006.eml: -------------------------------------------------------------------------------- 1 | From: sender@example.com 2 | To: recipient@example.com 3 | Subject: Multipart Email Example 4 | Content-Type: multipart/alternative; boundary="boundary-string" 5 | 6 | --boundary-string 7 | Content-Type: text/plain; charset="utf-8" 8 | Content-Transfer-Encoding: quoted-printable 9 | Content-Disposition: inline 10 | 11 | Plain text email goes here! 12 | This is the fallback if email client does not support HTML 13 | 14 | --boundary-string 15 | Content-Type: text/html; charset="utf-8" 16 | Content-Transfer-Encoding: quoted-printable 17 | Content-Disposition: inline 18 | 19 |

This is the HTML Section!

20 |

This is what displays in most modern email clients

21 | 22 | --boundary-string-- 23 | -------------------------------------------------------------------------------- /resources/eml/rfc/007.eml: -------------------------------------------------------------------------------- 1 | Subject: RFC 8621 Section 4.1.4 test 2 | Content-Type: multipart/mixed; boundary="1" 3 | 4 | --1 5 | Content-Type: text/plain 6 | Content-Disposition: inline 7 | 8 | A 9 | --1 10 | Content-Type: multipart/mixed; boundary="2" 11 | 12 | --2 13 | Content-Type: multipart/alternative; boundary="3" 14 | 15 | --3 16 | Content-Type: multipart/mixed; boundary="4" 17 | 18 | --4 19 | Content-Type: text/plain 20 | Content-Disposition: inline 21 | 22 | B 23 | --4 24 | Content-Type: image/jpeg 25 | Content-Disposition: inline 26 | 27 | C 28 | --4 29 | Content-Type: text/plain 30 | Content-Disposition: inline 31 | 32 | D 33 | --4-- 34 | 35 | --3 36 | Content-Type: multipart/related; boundary="5" 37 | 38 | --5 39 | Content-Type: text/html 40 | 41 | E 42 | --5 43 | Content-Type: image/jpeg 44 | 45 | F 46 | --5-- 47 | 48 | --3-- 49 | 50 | --2 51 | Content-Type: image/jpeg 52 | Content-Disposition: attachment 53 | 54 | G 55 | --2 56 | Content-Type: application/x-excel 57 | 58 | H 59 | --2 60 | Content-Type: message/rfc822 61 | 62 | Subject: J 63 | 64 | J 65 | --2-- 66 | 67 | --1 68 | Content-Type: text/plain 69 | Content-Disposition: inline 70 | 71 | K 72 | --1-- 73 | -------------------------------------------------------------------------------- /resources/eml/rfc/008.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; 2 | boundary=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 3 | 4 | --bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 5 | Content-Type: text/plain; charset=utf-8 6 | Content-Transfer-Encoding: 7bit 7 | 8 | This is a message with a base64 encoded attached email 9 | --bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 10 | Content-Disposition: attachment; filename="attached_email.eml" 11 | Content-Type: message/rfc822 12 | Content-Transfer-Encoding: base64 13 | 14 | VG86ICJlbWFpbEBleGFtcGxlLmNvbSIgPGVtYWlsQGV4YW1wbGUuY29tPg0KRnJvbTogTmFtZSA8 15 | ZW1haWxAZXhhbXBsZS5jb20+DQpTdWJqZWN0OiBIVE1MIHRlc3QNCk1lc3NhZ2UtSUQ6IDxyYW5k 16 | b20tbWVzc2FnZS1pZEBleGFtcGxlLmNvbT4NCkRhdGU6IFR1ZSwgMTQgRGVjIDIwMjEgMTE6NDg6 17 | MjUgKzAxMDANCk1JTUUtVmVyc2lvbjogMS4wDQpDb250ZW50LVR5cGU6IG11bHRpcGFydC9hbHRl 18 | cm5hdGl2ZTsNCiBib3VuZGFyeT0iYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 19 | YWFhYSINCkNvbnRlbnQtTGFuZ3VhZ2U6IGVuLVVTDQoNClRoaXMgaXMgYSBtdWx0aS1wYXJ0IG1l 20 | c3NhZ2UgaW4gTUlNRSBmb3JtYXQuDQotLWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 21 | YWFhYWFhYWENCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD11dGYtODsgZm9ybWF0 22 | PWZsb3dlZA0KQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdA0KDQpUaGlzIGlzIGFuICpI 23 | VE1MKiB0ZXN0IG1lc3NhZ2UNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 24 | YWFhYQ0KQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtVHJh 25 | bnNmZXItRW5jb2Rpbmc6IDdiaXQNCg0KPGh0bWw+DQogIDxoZWFkPg0KICAgIDxtZXRhIGh0dHAt 26 | ZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04Ij4N 27 | CiAgPC9oZWFkPg0KICA8Ym9keT4NCiAgICBUaGlzIGlzIGFuIDxiPkhUTUw8L2I+IHRlc3QgbWVz 28 | c2FnZQ0KICA8L2JvZHk+DQo8L2h0bWw+DQoNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 29 | YWFhYWFhYWFhYWFhYS0tDQo= 30 | --bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-- -------------------------------------------------------------------------------- /resources/eml/rfc/009.eml: -------------------------------------------------------------------------------- 1 | From: Whomever 2 | To: Someone 3 | Date: Sat, 10 Oct 2009 00:30:04 +0200 4 | Subject: whatever 5 | Content-Type: multipart/mixed; boundary=outer 6 | 7 | This is a multi-part message in MIME format. 8 | 9 | --outer 10 | Content-Type: multipart/alternative; boundary=inner 11 | 12 | This is a nested multi-part message in MIME format. 13 | 14 | --inner 15 | Content-Type: text/plain; charset="us-ascii" 16 | 17 | Hello 18 | 19 | --inner 20 | Content-Type: text/html; charset="us-ascii" 21 | 22 | Hello 23 | 24 | --inner-- 25 | 26 | This is the end of the inner MIME multipart. 27 | 28 | --outer 29 | Content-Type: message/rfc822 30 | 31 | From: Someone Else 32 | Subject: Hello, this is an elaborate request for you to finally say hello 33 | already! 34 | 35 | Please say Hello 36 | 37 | --outer-- 38 | 39 | This is the end of the outer MIME multipart. 40 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/000.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1, 4 | 2 5 | ], 6 | "text_body": [ 7 | 1, 8 | 2 9 | ], 10 | "attachments": [], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "mime_version", 16 | "value": { 17 | "Text": "1.0" 18 | }, 19 | "offset_field": 0, 20 | "offset_start": 13, 21 | "offset_end": 19 22 | }, 23 | { 24 | "name": "content_type", 25 | "value": { 26 | "ContentType": { 27 | "c_type": "multipart", 28 | "c_subtype": "alternative", 29 | "attributes": [ 30 | { 31 | "name": "boundary", 32 | "value": "bound" 33 | } 34 | ] 35 | } 36 | }, 37 | "offset_field": 19, 38 | "offset_start": 32, 39 | "offset_end": 76 40 | } 41 | ], 42 | "is_encoding_problem": false, 43 | "body": { 44 | "Multipart": [ 45 | 1, 46 | 2 47 | ] 48 | }, 49 | "offset_header": 0, 50 | "offset_body": 78, 51 | "offset_end": 480 52 | }, 53 | { 54 | "headers": [ 55 | { 56 | "name": "content_transfer_encoding", 57 | "value": { 58 | "Text": "base64" 59 | }, 60 | "offset_field": 102, 61 | "offset_start": 128, 62 | "offset_end": 137 63 | }, 64 | { 65 | "name": "content_type", 66 | "value": { 67 | "ContentType": { 68 | "c_type": "text", 69 | "c_subtype": "plain", 70 | "attributes": null 71 | } 72 | }, 73 | "offset_field": 137, 74 | "offset_start": 150, 75 | "offset_end": 163 76 | } 77 | ], 78 | "is_encoding_problem": false, 79 | "body": { 80 | "Text": "we have\ra lot \nof \u0000binary stuff in here\nb adjig sadjg jasidgjiaehga3wht8a3w8ghxjc dsgad hasdghsd gasd dsjdsoga sjdga0w3tjhawjgsertniq3n5oqerjqw2r89q23h awhrqh835r8a" 81 | }, 82 | "offset_header": 102, 83 | "offset_body": 165, 84 | "offset_end": 389 85 | }, 86 | { 87 | "headers": [ 88 | { 89 | "name": "content_type", 90 | "value": { 91 | "ContentType": { 92 | "c_type": "text", 93 | "c_subtype": "plain", 94 | "attributes": null 95 | } 96 | }, 97 | "offset_field": 400, 98 | "offset_start": 413, 99 | "offset_end": 426 100 | }, 101 | { 102 | "name": "content_transfer_encoding", 103 | "value": { 104 | "Text": "base64" 105 | }, 106 | "offset_field": 426, 107 | "offset_start": 452, 108 | "offset_end": 461 109 | } 110 | ], 111 | "is_encoding_problem": false, 112 | "body": { 113 | "Text": "eh" 114 | }, 115 | "offset_header": 400, 116 | "offset_body": 463, 117 | "offset_end": 467 118 | } 119 | ] 120 | } -------------------------------------------------------------------------------- /resources/eml/thirdparty/000.eml: -------------------------------------------------------------------------------- 1 | MIME-Version: 1.0 2 | Content-Type: multipart/alternative; 3 | boundary="bound" 4 | 5 | mime header 6 | 7 | --bound 8 | Content-Transfer-Encoding: base64 9 | Content-Type: text/plain 10 | 11 | d2UgaGF2ZQ1hIGxvdCAKb2YgAGJpbmFyeSBzdHVmZiBpbiBoZXJlCmIgYWRqaWcgc2FkamcgamFz 12 | aWRnamlhZWhnYTN3aHQ4YTN3OGdoeGpjIGRzZ2FkIGhhc2RnaHNkIGdhc2QgZHNqZHNvZ2Egc2pk 13 | Z2EwdzN0amhhd2pnc2VydG5pcTNuNW9xZXJqcXcycjg5cTIzaCBhd2hycWg4MzVyOGE= 14 | --bound 15 | Content-Type: text/plain 16 | Content-Transfer-Encoding: base64 17 | 18 | ZWg= 19 | --bound-- 20 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/000.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1, 4 | 2 5 | ], 6 | "text_body": [ 7 | 1, 8 | 2 9 | ], 10 | "attachments": [], 11 | "parts": [ 12 | { 13 | "headers": [ 14 | { 15 | "name": "mime_version", 16 | "value": { 17 | "Text": "1.0" 18 | }, 19 | "offset_field": 0, 20 | "offset_start": 13, 21 | "offset_end": 19 22 | }, 23 | { 24 | "name": "content_type", 25 | "value": { 26 | "ContentType": { 27 | "c_type": "multipart", 28 | "c_subtype": "alternative", 29 | "attributes": [ 30 | { 31 | "name": "boundary", 32 | "value": "bound" 33 | } 34 | ] 35 | } 36 | }, 37 | "offset_field": 19, 38 | "offset_start": 32, 39 | "offset_end": 76 40 | } 41 | ], 42 | "is_encoding_problem": false, 43 | "body": { 44 | "Multipart": [ 45 | 1, 46 | 2 47 | ] 48 | }, 49 | "offset_header": 0, 50 | "offset_body": 78, 51 | "offset_end": 480 52 | }, 53 | { 54 | "headers": [ 55 | { 56 | "name": "content_transfer_encoding", 57 | "value": { 58 | "Text": "base64" 59 | }, 60 | "offset_field": 102, 61 | "offset_start": 128, 62 | "offset_end": 137 63 | }, 64 | { 65 | "name": "content_type", 66 | "value": { 67 | "ContentType": { 68 | "c_type": "text", 69 | "c_subtype": "plain", 70 | "attributes": null 71 | } 72 | }, 73 | "offset_field": 137, 74 | "offset_start": 150, 75 | "offset_end": 163 76 | } 77 | ], 78 | "is_encoding_problem": false, 79 | "body": { 80 | "Text": "we have\ra lot \nof \u0000binary stuff in here\nb adjig sadjg jasidgjiaehga3wht8a3w8ghxjc dsgad hasdghsd gasd dsjdsoga sjdga0w3tjhawjgsertniq3n5oqerjqw2r89q23h awhrqh835r8a" 81 | }, 82 | "offset_header": 102, 83 | "offset_body": 165, 84 | "offset_end": 389 85 | }, 86 | { 87 | "headers": [ 88 | { 89 | "name": "content_type", 90 | "value": { 91 | "ContentType": { 92 | "c_type": "text", 93 | "c_subtype": "plain", 94 | "attributes": null 95 | } 96 | }, 97 | "offset_field": 400, 98 | "offset_start": 413, 99 | "offset_end": 426 100 | }, 101 | { 102 | "name": "content_transfer_encoding", 103 | "value": { 104 | "Text": "base64" 105 | }, 106 | "offset_field": 426, 107 | "offset_start": 452, 108 | "offset_end": 461 109 | } 110 | ], 111 | "is_encoding_problem": false, 112 | "body": { 113 | "Text": "eh" 114 | }, 115 | "offset_header": 400, 116 | "offset_body": 463, 117 | "offset_end": 467 118 | } 119 | ] 120 | } -------------------------------------------------------------------------------- /resources/eml/thirdparty/001.eml: -------------------------------------------------------------------------------- 1 | MIME-Version: 1.0 2 | Content-Type: multipart/alternative; 3 | boundary="bound" 4 | 5 | mime header 6 | 7 | --bound 8 | Content-Transfer-Encoding: binary 9 | Content-Type: text/plain 10 | 11 | d2UgaGF2ZQ1hIGxvdCAKb2YgAGJpbmFyeSBzdHVmZiBpbiBoZXJlCmIgYWRqaWcgc2FkamcgamFz 12 | aWRnamlhZWhnYTN3aHQ4YTN3OGdoeGpjIGRzZ2FkIGhhc2RnaHNkIGdhc2QgZHNqZHNvZ2Egc2pk 13 | Z2EwdzN0amhhd2pnc2VydG5pcTNuNW9xZXJqcXcycjg5cTIzaCBhd2hycWg4MzVyOGE= 14 | --bound 15 | Content-Type: text/plain 16 | Content-Transfer-Encoding: binary 17 | 18 | ZWg= 19 | --bound 20 | Content-Type: text/plain 21 | 22 | hello world 23 | 24 | --bound-- 25 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/001.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1, 4 | 2, 5 | 3 6 | ], 7 | "text_body": [ 8 | 1, 9 | 2, 10 | 3 11 | ], 12 | "attachments": [], 13 | "parts": [ 14 | { 15 | "headers": [ 16 | { 17 | "name": "mime_version", 18 | "value": { 19 | "Text": "1.0" 20 | }, 21 | "offset_field": 0, 22 | "offset_start": 13, 23 | "offset_end": 19 24 | }, 25 | { 26 | "name": "content_type", 27 | "value": { 28 | "ContentType": { 29 | "c_type": "multipart", 30 | "c_subtype": "alternative", 31 | "attributes": [ 32 | { 33 | "name": "boundary", 34 | "value": "bound" 35 | } 36 | ] 37 | } 38 | }, 39 | "offset_field": 19, 40 | "offset_start": 32, 41 | "offset_end": 76 42 | } 43 | ], 44 | "is_encoding_problem": false, 45 | "body": { 46 | "Multipart": [ 47 | 1, 48 | 2, 49 | 3 50 | ] 51 | }, 52 | "offset_header": 0, 53 | "offset_body": 78, 54 | "offset_end": 531 55 | }, 56 | { 57 | "headers": [ 58 | { 59 | "name": "content_transfer_encoding", 60 | "value": { 61 | "Text": "binary" 62 | }, 63 | "offset_field": 102, 64 | "offset_start": 128, 65 | "offset_end": 137 66 | }, 67 | { 68 | "name": "content_type", 69 | "value": { 70 | "ContentType": { 71 | "c_type": "text", 72 | "c_subtype": "plain", 73 | "attributes": null 74 | } 75 | }, 76 | "offset_field": 137, 77 | "offset_start": 150, 78 | "offset_end": 163 79 | } 80 | ], 81 | "is_encoding_problem": false, 82 | "body": { 83 | "Text": "d2UgaGF2ZQ1hIGxvdCAKb2YgAGJpbmFyeSBzdHVmZiBpbiBoZXJlCmIgYWRqaWcgc2FkamcgamFz\r\naWRnamlhZWhnYTN3aHQ4YTN3OGdoeGpjIGRzZ2FkIGhhc2RnaHNkIGdhc2QgZHNqZHNvZ2Egc2pk\r\nZ2EwdzN0amhhd2pnc2VydG5pcTNuNW9xZXJqcXcycjg5cTIzaCBhd2hycWg4MzVyOGE=" 84 | }, 85 | "offset_header": 102, 86 | "offset_body": 165, 87 | "offset_end": 389 88 | }, 89 | { 90 | "headers": [ 91 | { 92 | "name": "content_type", 93 | "value": { 94 | "ContentType": { 95 | "c_type": "text", 96 | "c_subtype": "plain", 97 | "attributes": null 98 | } 99 | }, 100 | "offset_field": 400, 101 | "offset_start": 413, 102 | "offset_end": 426 103 | }, 104 | { 105 | "name": "content_transfer_encoding", 106 | "value": { 107 | "Text": "binary" 108 | }, 109 | "offset_field": 426, 110 | "offset_start": 452, 111 | "offset_end": 461 112 | } 113 | ], 114 | "is_encoding_problem": false, 115 | "body": { 116 | "Text": "ZWg=" 117 | }, 118 | "offset_header": 400, 119 | "offset_body": 463, 120 | "offset_end": 467 121 | }, 122 | { 123 | "headers": [ 124 | { 125 | "name": "content_type", 126 | "value": { 127 | "ContentType": { 128 | "c_type": "text", 129 | "c_subtype": "plain", 130 | "attributes": null 131 | } 132 | }, 133 | "offset_field": 477, 134 | "offset_start": 490, 135 | "offset_end": 503 136 | } 137 | ], 138 | "is_encoding_problem": false, 139 | "body": { 140 | "Text": "hello world\r\n" 141 | }, 142 | "offset_header": 477, 143 | "offset_body": 505, 144 | "offset_end": 518 145 | } 146 | ] 147 | } -------------------------------------------------------------------------------- /resources/eml/thirdparty/002.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary=foo 2 | 3 | --foo 4 | Content-Transfer-Encoding: quoted-printable 5 | Content-Type: text/plain; charset=utf-8 6 | 7 | p=C3=A4iv=C3=A4=C3=A4 8 | 9 | --foo 10 | Content-Transfer-Encoding: base64 11 | Content-Type: text/plain; charset=utf-8 12 | 13 | ecO2dMOkIHZhYW4uCg== ignored 14 | --foo 15 | Content-Transfer-Encoding: base64 16 | Content-Type: text/plain; charset=utf-8 17 | 18 | ?garbage 19 | --foo-- 20 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/003.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1" 2 | MIME-Version: 1.0 3 | 4 | --1 5 | Content-Transfer-Encoding: 7bit 6 | Content-Type: text/plain; charset=us-ascii 7 | 8 | Move black king to queen's bishop 9 | 10 | --1 11 | Content-Transfer-Encoding: binary 12 | Content-Type: text/plain; charset=UTF-8 13 | 14 | Move ♚ to ♛'s ♝ 15 | 16 | --1 17 | Content-Transfer-Encoding: 8bit 18 | Content-Type: text/plain; charset=UTF-8 19 | 20 | Move ♚ to ♛'s ♝ 21 | 22 | --1 23 | Content-Transfer-Encoding: quoted-printable 24 | Content-Type: text/plain; charset=UTF-8 25 | 26 | Move =E2=99=9A to =E2=99=9B's =E2=99=9D 27 | 28 | --1 29 | Content-Transfer-Encoding: base64 30 | Content-Type: text/plain; charset=UTF-8 31 | 32 | TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== 33 | 34 | --1-- 35 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/004.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1" 2 | MIME-Version: 1.0 3 | 4 | --1 5 | Content-Transfer-Encoding: 6bit 6 | Content-Type: text/plain; charset=UTF-8 7 | 8 | Move black king to queen's bishop 9 | 10 | --1 11 | Content-Transfer-Encoding: 7bits 12 | Content-Type: text/plain; charset=UTF-8 13 | 14 | Move ♚ to ♛'s ♝ 15 | 16 | --1 17 | Content-Transfer-Encoding: 8 bit 18 | Content-Type: text/plain; charset=UTF-8 19 | 20 | Move ♚ to ♛'s ♝ 21 | 22 | --1 23 | Content-Transfer-Encoding: 7-bit 24 | Content-Type: text/plain; charset=UTF-8 25 | 26 | Move ♚ to ♛'s ♝ 27 | 28 | --1 29 | Content-Transfer-Encoding: 8-bit 30 | Content-Type: text/plain; charset=UTF-8 31 | 32 | Move ♚ to ♛'s ♝ 33 | 34 | --1 35 | Content-Transfer-Encoding: 36 | Content-Type: text/plain; charset=UTF-8 37 | 38 | Move =E2=99=9A to =E2=99=9B's =E2=99=9D 39 | 40 | --1-- 41 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/005.eml: -------------------------------------------------------------------------------- 1 | Content-Type: multipart/mixed; boundary="1" 2 | MIME-Version: 1.0 3 | 4 | --1 5 | Content-Transfer-Encoding: binary 6 | Content-Type: text/plain; charset=utf-16le 7 | 8 | Test message 9 | 10 | --1 11 | Content-Transfer-Encoding: base64 12 | Content-Type: text/plain; charset=utf-16be 13 | 14 | AFQAZQBzAHQAIABtAGUAcwBzAGEAZwBlAAo= 15 | 16 | --1 17 | Content-Transfer-Encoding: base64 18 | Content-Type: text/plain; charset=utf-16le 19 | 20 | VABlAHMAdAAgAG0AZQBzAHMAYQBnAGUACgA= 21 | 22 | --1 23 | Content-Transfer-Encoding: base64 24 | Content-Type: text/plain; charset=EUC-JP 25 | 26 | odjApLOmv824osDruMCh2Q== 27 | 28 | --1 29 | Content-Transfer-Encoding: binary 30 | Content-Type: text/plain; charset=UTF-8 31 | 32 | invalid--1-- 33 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/006.eml: -------------------------------------------------------------------------------- 1 | Subject: Hide and seek 2 | MIME-Version: 1.0 3 | Content-Type: multipart/mixed; boundary=1 4 | 5 | --1 6 | Content-Type: multipart/signed; protocol="signature/plain"; migalc="pen+paper"; boundary=2 7 | X-Signature-Type: penmanship 8 | 9 | --2 10 | Content-Type: multipart/alternative; boundary=3 11 | 12 | --3 13 | Content-Type: text/html; charset=us-ascii 14 | 15 | Search me

Don't find me here

16 | 17 | --3 18 | Content-Type: text/plain 19 | Content-Transfer-Encoding: binary 20 | 21 | Search me, and Find me here 22 | --3-- 23 | 24 | --2 25 | Content-Type: signature/plain; charset=us-ascii 26 | 27 | Signed by undersigned 28 | --2-- 29 | 30 | --1-- -------------------------------------------------------------------------------- /resources/eml/thirdparty/007.eml: -------------------------------------------------------------------------------- 1 | From: Moderator-Address 2 | Content-Type: multipart/digest; boundary=1; 3 | 4 | 5 | --1 6 | 7 | From: someone-else 8 | Subject: my opinion 9 | 10 | This is my opinion 11 | --1 12 | 13 | From: another one 14 | Subject: i disagree 15 | 16 | Not agreeing one bit! 17 | --1 18 | 19 | From: attachment 20 | Subject: funny hat 21 | Content-Type: multipart/mixed; boundary=2 22 | 23 | --2 24 | Content-Type: text/plain 25 | Content-Transfer-Encoding: binary 26 | 27 | Lovely attachment for you 28 | --2 29 | Content-Type: application/octet-stream; disposition=attachment; name="test.txt" 30 | Content-Transfer-Encoding: binary 31 | 32 | Foobar 33 | --2-- 34 | --1-- -------------------------------------------------------------------------------- /resources/eml/thirdparty/008.eml: -------------------------------------------------------------------------------- 1 | From: user@domain.org 2 | Date: Sat, 24 Mar 2007 23:00:00 +0200 3 | Mime-Version: 1.0 4 | Content-Type: multipart/mixed; boundary="foo bar" 5 | 6 | Root MIME prologue 7 | 8 | --foo bar 9 | Content-Type: text/x-myown; charset=us-ascii 10 | 11 | hello 12 | 13 | --foo bar 14 | Content-Type: message/rfc822 15 | 16 | From: sub@domain.org 17 | Date: Sun, 12 Aug 2012 12:34:56 +0300 18 | Subject: submsg 19 | Content-Type: multipart/alternative; boundary="sub1" 20 | 21 | Sub MIME prologue 22 | --sub1 23 | Content-Type: text/html 24 | 25 |

Hello world

26 | 27 | --sub1 28 | Content-Type: multipart/alternative; boundary="sub2" 29 | 30 | --sub2 31 | Content-Type: multipart/alternative; boundary="sub3" 32 | 33 | --sub3 34 | 35 | sub3 text 36 | --sub3 37 | 38 | sub3 text2 39 | --sub3-- 40 | 41 | sub2 text 42 | --sub2 43 | 44 | sub2 text2 45 | --sub2-- 46 | --sub1-- 47 | Sub MIME epilogue 48 | 49 | --foo bar 50 | Content-Type: text/plain 51 | 52 | Another part 53 | --foo bar-- 54 | Root MIME epilogue 55 | 56 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/009.eml: -------------------------------------------------------------------------------- 1 | Subject: In parts 2 | MIME-Version: 1.0 3 | Content-Type: multipart/mixed; boundary=1 4 | 5 | --1 6 | Content-Type: text/plain 7 | Content-Transfer-Encoding: binary 8 | 9 | Hi, this is the fancy thing I was talking about! 10 | --1 11 | Content-Type: Message/Partial; number=1; total=5; id="heks68ewe@example.org" 12 | 13 | X-Weird-Header-1: Bar 14 | X-Weird-Header-2: Hello 15 | Message-ID: 16 | Content-Type: text/plain; charset="us-ascii" 17 | Content-Transfer-Encoding: base64 18 | 19 | dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo= 20 | --1-- 21 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/010.crlf.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1 4 | ], 5 | "text_body": [ 6 | 1 7 | ], 8 | "attachments": [], 9 | "parts": [ 10 | { 11 | "headers": [ 12 | { 13 | "name": "subject", 14 | "value": { 15 | "Text": "こんにちは" 16 | }, 17 | "offset_field": 0, 18 | "offset_start": 8, 19 | "offset_end": 43 20 | }, 21 | { 22 | "name": "mime_version", 23 | "value": { 24 | "Text": "1.0" 25 | }, 26 | "offset_field": 43, 27 | "offset_start": 56, 28 | "offset_end": 62 29 | }, 30 | { 31 | "name": "content_type", 32 | "value": { 33 | "ContentType": { 34 | "c_type": "multipart", 35 | "c_subtype": "mixed", 36 | "attributes": [ 37 | { 38 | "name": "boundary", 39 | "value": "1" 40 | }, 41 | { 42 | "name": "comment", 43 | "value": "人権の無視及" 44 | } 45 | ] 46 | } 47 | }, 48 | "offset_field": 62, 49 | "offset_start": 75, 50 | "offset_end": 149 51 | } 52 | ], 53 | "is_encoding_problem": false, 54 | "body": { 55 | "Multipart": [ 56 | 1 57 | ] 58 | }, 59 | "offset_header": 0, 60 | "offset_body": 151, 61 | "offset_end": 266 62 | }, 63 | { 64 | "headers": [ 65 | { 66 | "name": "content_type", 67 | "value": { 68 | "ContentType": { 69 | "c_type": "text", 70 | "c_subtype": "plain", 71 | "attributes": null 72 | } 73 | }, 74 | "offset_field": 156, 75 | "offset_start": 169, 76 | "offset_end": 182 77 | }, 78 | { 79 | "name": "content_transfer_encoding", 80 | "value": { 81 | "Text": "binary" 82 | }, 83 | "offset_field": 182, 84 | "offset_start": 208, 85 | "offset_end": 217 86 | }, 87 | { 88 | "name": "content_language", 89 | "value": { 90 | "Text": "ja" 91 | }, 92 | "offset_field": 217, 93 | "offset_start": 234, 94 | "offset_end": 239 95 | } 96 | ], 97 | "is_encoding_problem": false, 98 | "body": { 99 | "Text": "人権の無視及" 100 | }, 101 | "offset_header": 156, 102 | "offset_body": 241, 103 | "offset_end": 259 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /resources/eml/thirdparty/010.eml: -------------------------------------------------------------------------------- 1 | Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv?= 2 | MIME-Version: 1.0 3 | Content-Type: multipart/mixed; boundary=1; comment="" 4 | comment="人権の無視及" 5 | 6 | --1 7 | Content-Type: text/plain 8 | Content-Transfer-Encoding: binary 9 | Content-Language: ja 10 | 11 | 人権の無視及 12 | --1-- -------------------------------------------------------------------------------- /resources/eml/thirdparty/010.json: -------------------------------------------------------------------------------- 1 | { 2 | "html_body": [ 3 | 1 4 | ], 5 | "text_body": [ 6 | 1 7 | ], 8 | "attachments": [], 9 | "parts": [ 10 | { 11 | "headers": [ 12 | { 13 | "name": "subject", 14 | "value": { 15 | "Text": "こんにちは" 16 | }, 17 | "offset_field": 0, 18 | "offset_start": 8, 19 | "offset_end": 42 20 | }, 21 | { 22 | "name": "mime_version", 23 | "value": { 24 | "Text": "1.0" 25 | }, 26 | "offset_field": 42, 27 | "offset_start": 55, 28 | "offset_end": 60 29 | }, 30 | { 31 | "name": "content_type", 32 | "value": { 33 | "ContentType": { 34 | "c_type": "multipart", 35 | "c_subtype": "mixed", 36 | "attributes": [ 37 | { 38 | "name": "boundary", 39 | "value": "1" 40 | }, 41 | { 42 | "name": "comment", 43 | "value": "人権の無視及" 44 | } 45 | ] 46 | } 47 | }, 48 | "offset_field": 60, 49 | "offset_start": 73, 50 | "offset_end": 145 51 | } 52 | ], 53 | "is_encoding_problem": false, 54 | "body": { 55 | "Multipart": [ 56 | 1 57 | ] 58 | }, 59 | "offset_header": 0, 60 | "offset_body": 146, 61 | "offset_end": 255 62 | }, 63 | { 64 | "headers": [ 65 | { 66 | "name": "content_type", 67 | "value": { 68 | "ContentType": { 69 | "c_type": "text", 70 | "c_subtype": "plain", 71 | "attributes": null 72 | } 73 | }, 74 | "offset_field": 150, 75 | "offset_start": 163, 76 | "offset_end": 175 77 | }, 78 | { 79 | "name": "content_transfer_encoding", 80 | "value": { 81 | "Text": "binary" 82 | }, 83 | "offset_field": 175, 84 | "offset_start": 201, 85 | "offset_end": 209 86 | }, 87 | { 88 | "name": "content_language", 89 | "value": { 90 | "Text": "ja" 91 | }, 92 | "offset_field": 209, 93 | "offset_start": 226, 94 | "offset_end": 230 95 | } 96 | ], 97 | "is_encoding_problem": false, 98 | "body": { 99 | "Text": "人権の無視及" 100 | }, 101 | "offset_header": 150, 102 | "offset_body": 231, 103 | "offset_end": 249 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /resources/eml/thirdparty/012.eml: -------------------------------------------------------------------------------- 1 | From: user@domain.org 2 | Date: Sat, 24 Mar 2007 23:00:00 +0200 3 | Mime-Version: 1.0 4 | Content-Type: multipart/mixed; boundary="foo 5 | bar" 6 | 7 | Root MIME prologue 8 | 9 | --foo bar 10 | Content-Type: text/x-myown; charset=us-ascii 11 | 12 | hello 13 | 14 | --foo bar 15 | Content-Type: message/rfc822 16 | 17 | From: sub@domain.org 18 | Date: Sun, 12 Aug 2012 12:34:56 +0300 19 | Subject: submsg 20 | Content-Type: multipart/alternative; boundary="sub1" 21 | 22 | Sub MIME prologue 23 | --sub1 24 | Content-Type: text/html 25 | 26 |

Hello world

27 | 28 | --sub1 29 | Content-Type: text/plain 30 | 31 | Hello another world 32 | 33 | --sub1-- 34 | Sub MIME epilogue 35 | 36 | --foo bar-- 37 | Root MIME epilogue -------------------------------------------------------------------------------- /resources/eml/thirdparty/013.eml: -------------------------------------------------------------------------------- 1 | Date: Fri, 19 Aug 2022 13:10:40 +0000 2 | MIME-Version: 1.0 3 | Content-Type: multipart/mixed; boundary=166091464015.94FEC6.541095 4 | Content-Transfer-Encoding: 7bit 5 | 6 | 7 | --166091464015.94FEC6.541095 8 | Date: Fri, 19 Aug 2022 13:10:40 +0000 9 | MIME-Version: 1.0 10 | Content-Type: multipart/alternative; boundary=166091464014.8cee04D8.541095 11 | Content-Transfer-Encoding: 7bit 12 | 13 | 14 | --166091464014.8cee04D8.541095 15 | Date: Fri, 19 Aug 2022 13:10:40 +0000 16 | MIME-Version: 1.0 17 | Content-Type: text/plain 18 | 19 | a 20 | --166091464014.8cee04D8.541095 21 | Date: Fri, 19 Aug 2022 13:10:40 +0000 22 | MIME-Version: 1.0 23 | Content-Type: text/html 24 | 25 | b 26 | --166091464014.8cee04D8.541095-- 27 | 28 | --166091464015.94FEC6.541095 29 | Date: Fri, 19 Aug 2022 13:10:40 +0000 30 | MIME-Version: 1.0 31 | Content-Type: image/jpeg 32 | 33 | c 34 | --166091464015.94FEC6.541095 35 | Date: Fri, 19 Aug 2022 13:10:40 +0000 36 | MIME-Version: 1.0 37 | Content-Type: audio/mp3 38 | 39 | d 40 | --166091464015.94FEC6.541095 41 | Date: Fri, 19 Aug 2022 13:10:40 +0000 42 | MIME-Version: 1.0 43 | Content-Type: video/avi 44 | 45 | e 46 | --166091464015.94FEC6.541095-- 47 | -------------------------------------------------------------------------------- /resources/eml/thirdparty/COPYING: -------------------------------------------------------------------------------- 1 | These test files are Copyright (c) 2003-2018 Dovecot authors, licensed under MIT. 2 | See the COPYING file at https://github.com/dovecot/core/blob/master/COPYING 3 | -------------------------------------------------------------------------------- /resources/id.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "header": "<1234@local.machine.example>\n", 4 | "expected": [ 5 | "1234@local.machine.example" 6 | ] 7 | }, 8 | { 9 | "header": "<1234@local.machine.example> <3456@example.net>\n", 10 | "expected": [ 11 | "1234@local.machine.example", 12 | "3456@example.net" 13 | ] 14 | }, 15 | { 16 | "header": "<1234@local.machine.example>\n <3456@example.net> \n", 17 | "expected": [ 18 | "1234@local.machine.example", 19 | "3456@example.net" 20 | ] 21 | }, 22 | { 23 | "header": "<1234@local.machine.example>\n\n <3456@example.net>\n", 24 | "expected": [ 25 | "1234@local.machine.example" 26 | ] 27 | }, 28 | { 29 | "header": " \n", 30 | "expected": [ 31 | "testabcd.1234@silly.test" 32 | ] 33 | }, 34 | { 35 | "header": "<5678.21-Nov-1997@example.com>\n", 36 | "expected": [ 37 | "5678.21-Nov-1997@example.com" 38 | ] 39 | }, 40 | { 41 | "header": "<1234 @ local(blah) .machine .example>\n", 42 | "expected": [ 43 | "1234 @ local(blah) .machine .example" 44 | ] 45 | }, 46 | { 47 | "header": "<>\n", 48 | "expected": null 49 | }, 50 | { 51 | "header": "malformed@id.machine.example\n", 52 | "expected": [ 53 | "malformed@id.machine.example" 54 | ] 55 | }, 56 | { 57 | "header": " malformed2@id.machine.example \t \n", 58 | "expected": [ 59 | "malformed2@id.machine.example" 60 | ] 61 | }, 62 | { 63 | "header": " m \n", 64 | "expected": [ 65 | "m" 66 | ] 67 | } 68 | ] -------------------------------------------------------------------------------- /resources/list.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "header": " one item \n", 4 | "expected": [ 5 | "one item" 6 | ] 7 | }, 8 | { 9 | "header": "simple, list\n", 10 | "expected": [ 11 | "simple", 12 | "list" 13 | ] 14 | }, 15 | { 16 | "header": "multi \r\n list, \r\n with, cr lf \r\n", 17 | "expected": [ 18 | "multi list", 19 | "with", 20 | "cr lf" 21 | ] 22 | }, 23 | { 24 | "header": "=?iso-8859-1?q?this is some text?=, in, a, list, \n", 25 | "expected": [ 26 | "this is some text", 27 | "in", 28 | "a", 29 | "list" 30 | ] 31 | }, 32 | { 33 | "header": " =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\n =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\n , but, in a list, which, is, more, fun!\n", 34 | "expected": [ 35 | "If you can read this you understand the example.", 36 | "but", 37 | "in a list", 38 | "which", 39 | "is", 40 | "more", 41 | "fun!" 42 | ] 43 | }, 44 | { 45 | "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n , listed\n", 46 | "expected": [ 47 | "ab", 48 | "listed" 49 | ] 50 | }, 51 | { 52 | "header": "ハロー・ワールド, and also, ascii terms\n", 53 | "expected": [ 54 | "ハロー・ワールド", 55 | "and also", 56 | "ascii terms" 57 | ] 58 | } 59 | ] -------------------------------------------------------------------------------- /resources/maildir/.My Folder.Nested Folder/cur/1276533073.M242911P3632.kurkku;2,FP: -------------------------------------------------------------------------------- 1 | e 2 | -------------------------------------------------------------------------------- /resources/maildir/.My Folder.Nested Folder/new/1035478339.27041_118.foo.org,S=1000,W=1030;2,RDF,: -------------------------------------------------------------------------------- 1 | f 2 | -------------------------------------------------------------------------------- /resources/maildir/.My Folder/cur/1035478339.27041_118.foo.org,S=1000,W=1030;2,TDR: -------------------------------------------------------------------------------- 1 | c 2 | -------------------------------------------------------------------------------- /resources/maildir/.My Folder/new/1276528487.M364837P9451.kurkku,S=1355,W=1394;2,: -------------------------------------------------------------------------------- 1 | d 2 | -------------------------------------------------------------------------------- /resources/maildir/cur/1491941793.M41850P8566V0000000000000015I0000000004F3030E_0.mx1.example.com,S=10956;2,STln: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /resources/maildir/new/1234567890.M20046P2137.mailserver,S=4542,W=4642;2,Sb: -------------------------------------------------------------------------------- 1 | b 2 | -------------------------------------------------------------------------------- /resources/unstructured.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "header": "Saying Hello\n", 4 | "expected": "Saying Hello" 5 | }, 6 | { 7 | "header": "Re: Saying Hello\r\n", 8 | "expected": "Re: Saying Hello" 9 | }, 10 | { 11 | "header": " Fwd: \n\tSaying \n Hello\r\n", 12 | "expected": "Fwd: Saying Hello" 13 | }, 14 | { 15 | "header": " FWD: \n Saying Hello \nX-Mailer: 123\r\n", 16 | "expected": "FWD: Saying Hello" 17 | }, 18 | { 19 | "header": " from x.y.test\n by example.net\n via TCP\n with ESMTP\n id ABC12345\n for ; 21 Nov 1997 10:05:43 -0600\n", 20 | "expected": "from x.y.test by example.net via TCP with ESMTP id ABC12345 for ; 21 Nov 1997 10:05:43 -0600" 21 | }, 22 | { 23 | "header": "=?iso-8859-1?q?this is some text?=\n", 24 | "expected": "this is some text" 25 | }, 26 | { 27 | "header": "=?iso-8859-1?q?this=20is=20some=20text?=\r\n", 28 | "expected": "this is some text" 29 | }, 30 | { 31 | "header": " =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\n =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\n", 32 | "expected": "If you can read this you understand the example." 33 | }, 34 | { 35 | "header": " =?ISO-8859-1?Q?a?=\n", 36 | "expected": "a" 37 | }, 38 | { 39 | "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n", 40 | "expected": "ab" 41 | }, 42 | { 43 | "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n", 44 | "expected": "ab" 45 | }, 46 | { 47 | "header": "=?ISO-8859-1?Q?a?=\r\n =?ISO-8859-1?Q?b?=\nFrom: unknown@domain.com\n", 48 | "expected": "ab" 49 | }, 50 | { 51 | "header": "=?ISO-8859-1?Q?a_b?=\n", 52 | "expected": "a b" 53 | }, 54 | { 55 | "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=\r\n", 56 | "expected": "a b" 57 | }, 58 | { 59 | "header": " this =?iso-8859-1?q?is?= some =?iso-8859-1?q?t?=\n =?iso-8859-1?q?e?= \n =?iso-8859-1?q?x?=\n =?iso-8859-1?q?t?=\n", 60 | "expected": "this is some text" 61 | }, 62 | { 63 | "header": " =\n", 64 | "expected": "=" 65 | }, 66 | { 67 | "header": " =? \n", 68 | "expected": "=?" 69 | }, 70 | { 71 | "header": "=?utf-8 \n", 72 | "expected": "=?utf-8" 73 | }, 74 | { 75 | "header": "=?utf-8? \n", 76 | "expected": "=?utf-8?" 77 | }, 78 | { 79 | "header": " let's = try =?iso-8859-1? to break\n =? the \n parser\n", 80 | "expected": "let's = try =?iso-8859-1? to break =? the parser" 81 | }, 82 | { 83 | "header": "ハロー・ワールド \n", 84 | "expected": "ハロー・ワールド" 85 | }, 86 | { 87 | "header": "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb3JpZ2luYWwgc3ViamVjdA==?=\n", 88 | "expected": "[SUSPECTED SPAM] This is the original subject" 89 | }, 90 | { 91 | "header": "Some text =?utf-8?Q??=here\n", 92 | "expected": "Some text here" 93 | }, 94 | { 95 | "header": "=?ISO-8859-1?Q?a?==?ISO-8859-1?Q?b?==?ISO-8859-1?Q?c?= =?ISO-8859-1?Q?d?=\n", 96 | "expected": "abcd" 97 | }, 98 | { 99 | "header": "=?utf-8?Q?Hello\n _there!?=\n", 100 | "expected": "Hello there!" 101 | }, 102 | { 103 | "header": "=?utf-8?Q?Hello\r\n _there!?=\r\n", 104 | "expected": "Hello there!" 105 | }, 106 | { 107 | "header": "=?utf-8?Q?Hello\r\n \t _there!?=\r\n", 108 | "expected": "Hello there!" 109 | }, 110 | { 111 | "header": "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb\n 3JpZ2luYWwgc3ViamVjdA==?=\n", 112 | "expected": "[SUSPECTED SPAM] This is the original subject" 113 | }, 114 | { 115 | "header": "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb\r\n 3JpZ2luYWwgc3ViamVjdA==?=\r\n", 116 | "expected": "[SUSPECTED SPAM] This is the original subject" 117 | }, 118 | { 119 | "header": "Les Communs - =?utf-8?Q?R=C3=A9capitulatif?= de la\r\n =?utf-8?Q?r=C3=A9servation?= 13510164434879\r\n", 120 | "expected": "Les Communs - Récapitulatif de la réservation 13510164434879" 121 | } 122 | ] -------------------------------------------------------------------------------- /src/core/body.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use crate::{AttachmentIterator, BodyPartIterator, Message, MessagePart, MessagePartId, PartType}; 8 | 9 | impl PartType<'_> { 10 | #[allow(clippy::len_without_is_empty)] 11 | pub fn len(&self) -> usize { 12 | match self { 13 | PartType::Text(v) | PartType::Html(v) => v.len(), 14 | PartType::Binary(v) | PartType::InlineBinary(v) => v.len(), 15 | PartType::Message(v) => v.raw_message.len(), 16 | PartType::Multipart(_) => 0, 17 | } 18 | } 19 | } 20 | 21 | impl<'x> BodyPartIterator<'x> { 22 | pub(crate) fn new(message: &'x Message<'x>, list: &'x [MessagePartId]) -> BodyPartIterator<'x> { 23 | BodyPartIterator { 24 | message, 25 | list, 26 | pos: -1, 27 | } 28 | } 29 | } 30 | 31 | impl<'x> Iterator for BodyPartIterator<'x> { 32 | type Item = &'x MessagePart<'x>; 33 | 34 | fn next(&mut self) -> Option { 35 | self.pos += 1; 36 | self.message 37 | .parts 38 | .get(*self.list.get(self.pos as usize)? as usize) 39 | } 40 | } 41 | 42 | impl<'x> AttachmentIterator<'x> { 43 | pub(crate) fn new(message: &'x Message<'x>) -> AttachmentIterator<'x> { 44 | AttachmentIterator { message, pos: -1 } 45 | } 46 | } 47 | 48 | impl<'x> Iterator for AttachmentIterator<'x> { 49 | type Item = &'x MessagePart<'x>; 50 | 51 | fn next(&mut self) -> Option { 52 | self.pos += 1; 53 | self.message.attachment(self.pos as u32) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/core/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | pub mod address; 8 | pub mod body; 9 | pub mod builder; 10 | pub mod header; 11 | pub mod message; 12 | #[cfg(feature = "rkyv")] 13 | pub mod rkyv; 14 | -------------------------------------------------------------------------------- /src/decoders/charsets/multi_byte.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | #[cfg(feature = "full_encoding")] 8 | use encoding_rs::*; 9 | 10 | #[cfg(feature = "full_encoding")] 11 | fn multi_byte_decoder(mut decoder: Decoder, bytes: &[u8]) -> String { 12 | let mut result = String::with_capacity(bytes.len() * 4); 13 | 14 | if let (CoderResult::OutputFull, _, _) = decoder.decode_to_string(bytes, &mut result, true) { 15 | debug_assert!(false, "String full while decoding.") 16 | } 17 | 18 | result.shrink_to_fit(); 19 | result 20 | } 21 | 22 | #[inline(always)] 23 | pub(crate) fn decoder_shift_jis(bytes: &[u8]) -> String { 24 | #[cfg(feature = "full_encoding")] 25 | { 26 | multi_byte_decoder(SHIFT_JIS.new_decoder(), bytes) 27 | } 28 | 29 | #[cfg(not(feature = "full_encoding"))] 30 | { 31 | String::from_utf8_lossy(bytes).into_owned() 32 | } 33 | } 34 | 35 | #[inline(always)] 36 | pub(crate) fn decoder_big5(bytes: &[u8]) -> String { 37 | #[cfg(feature = "full_encoding")] 38 | { 39 | multi_byte_decoder(BIG5.new_decoder(), bytes) 40 | } 41 | 42 | #[cfg(not(feature = "full_encoding"))] 43 | { 44 | String::from_utf8_lossy(bytes).into_owned() 45 | } 46 | } 47 | 48 | #[inline(always)] 49 | pub(crate) fn decoder_euc_jp(bytes: &[u8]) -> String { 50 | #[cfg(feature = "full_encoding")] 51 | { 52 | multi_byte_decoder(EUC_JP.new_decoder(), bytes) 53 | } 54 | 55 | #[cfg(not(feature = "full_encoding"))] 56 | { 57 | String::from_utf8_lossy(bytes).into_owned() 58 | } 59 | } 60 | 61 | #[inline(always)] 62 | pub(crate) fn decoder_euc_kr(bytes: &[u8]) -> String { 63 | #[cfg(feature = "full_encoding")] 64 | { 65 | multi_byte_decoder(EUC_KR.new_decoder(), bytes) 66 | } 67 | 68 | #[cfg(not(feature = "full_encoding"))] 69 | { 70 | String::from_utf8_lossy(bytes).into_owned() 71 | } 72 | } 73 | 74 | #[inline(always)] 75 | pub(crate) fn decoder_gb18030(bytes: &[u8]) -> String { 76 | #[cfg(feature = "full_encoding")] 77 | { 78 | multi_byte_decoder(GB18030.new_decoder(), bytes) 79 | } 80 | 81 | #[cfg(not(feature = "full_encoding"))] 82 | { 83 | String::from_utf8_lossy(bytes).into_owned() 84 | } 85 | } 86 | 87 | #[inline(always)] 88 | pub(crate) fn decoder_gbk(bytes: &[u8]) -> String { 89 | #[cfg(feature = "full_encoding")] 90 | { 91 | multi_byte_decoder(GBK.new_decoder(), bytes) 92 | } 93 | 94 | #[cfg(not(feature = "full_encoding"))] 95 | { 96 | String::from_utf8_lossy(bytes).into_owned() 97 | } 98 | } 99 | 100 | #[inline(always)] 101 | pub(crate) fn decoder_iso2022_jp(bytes: &[u8]) -> String { 102 | #[cfg(feature = "full_encoding")] 103 | { 104 | multi_byte_decoder(ISO_2022_JP.new_decoder(), bytes) 105 | } 106 | 107 | #[cfg(not(feature = "full_encoding"))] 108 | { 109 | String::from_utf8_lossy(bytes).into_owned() 110 | } 111 | } 112 | 113 | #[inline(always)] 114 | pub(crate) fn decoder_windows874(bytes: &[u8]) -> String { 115 | #[cfg(feature = "full_encoding")] 116 | { 117 | multi_byte_decoder(WINDOWS_874.new_decoder(), bytes) 118 | } 119 | 120 | #[cfg(not(feature = "full_encoding"))] 121 | { 122 | String::from_utf8_lossy(bytes).into_owned() 123 | } 124 | } 125 | 126 | #[inline(always)] 127 | pub(crate) fn decoder_ibm866(bytes: &[u8]) -> String { 128 | #[cfg(feature = "full_encoding")] 129 | { 130 | multi_byte_decoder(IBM866.new_decoder(), bytes) 131 | } 132 | 133 | #[cfg(not(feature = "full_encoding"))] 134 | { 135 | String::from_utf8_lossy(bytes).into_owned() 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/decoders/hex.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use super::quoted_printable::HEX_MAP; 8 | 9 | #[derive(PartialEq, Debug)] 10 | enum HexState { 11 | None, 12 | Percent, 13 | Hex1, 14 | } 15 | 16 | pub fn decode_hex(src: &[u8]) -> (bool, Vec) { 17 | let mut state = HexState::None; 18 | let mut hex1 = 0; 19 | let mut result = Vec::with_capacity(src.len()); 20 | let mut success = true; 21 | 22 | for ch in src { 23 | match ch { 24 | b'%' => { 25 | if let HexState::None = state { 26 | state = HexState::Percent 27 | } else { 28 | success = false; 29 | break; 30 | } 31 | } 32 | _ => match state { 33 | HexState::None => { 34 | result.push(*ch); 35 | } 36 | HexState::Percent => { 37 | hex1 = HEX_MAP[*ch as usize]; 38 | if hex1 != -1 { 39 | state = HexState::Hex1; 40 | } else { 41 | success = false; 42 | break; 43 | } 44 | } 45 | HexState::Hex1 => { 46 | let hex2 = HEX_MAP[*ch as usize]; 47 | 48 | state = HexState::None; 49 | if hex2 != -1 { 50 | result.push(((hex1 as u8) << 4) | hex2 as u8); 51 | } else { 52 | success = false; 53 | break; 54 | } 55 | } 56 | }, 57 | } 58 | } 59 | 60 | (success, result) 61 | } 62 | 63 | #[cfg(test)] 64 | mod tests { 65 | use crate::decoders::hex::decode_hex; 66 | 67 | #[test] 68 | fn decode_hex_line() { 69 | let inputs = [ 70 | ("this%20is%20some%20text", "this is some text"), 71 | ("this is some text", "this is some text"), 72 | ]; 73 | 74 | for input in inputs { 75 | let (success, result) = decode_hex(input.0.as_bytes()); 76 | 77 | assert!(success, "Failed for '{:?}'", input.0); 78 | 79 | let result_str = std::str::from_utf8(&result).unwrap(); 80 | 81 | /*println!( 82 | "Decoded '{}'\n -> to ->\n'{}'\n{}", 83 | input.0.escape_debug(), 84 | result_str.escape_debug(), 85 | "-".repeat(50) 86 | );*/ 87 | 88 | assert_eq!( 89 | input.1, 90 | result_str, 91 | "Failed for '{}'", 92 | input.0.escape_debug() 93 | ); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/decoders/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use std::borrow::Cow; 8 | 9 | use crate::parsers::MessageStream; 10 | 11 | pub mod base64; 12 | pub mod charsets; 13 | pub mod encoded_word; 14 | pub mod hex; 15 | pub mod html; 16 | pub mod quoted_printable; 17 | 18 | pub type DecodeFnc<'x> = fn(&mut MessageStream<'x>, &[u8]) -> (usize, Cow<'x, [u8]>); 19 | pub type DecodeWordFnc<'x> = fn(&mut MessageStream<'x>) -> Option>; 20 | -------------------------------------------------------------------------------- /src/mailbox/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod maildir; 2 | pub mod mbox; 3 | -------------------------------------------------------------------------------- /src/parsers/fields/id.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use crate::{parsers::MessageStream, HeaderValue}; 8 | 9 | impl<'x> MessageStream<'x> { 10 | pub fn parse_id(&mut self) -> HeaderValue<'x> { 11 | let mut token_start: usize = 0; 12 | let mut token_end: usize = 0; 13 | let mut token_invalid_start: usize = 0; // Handle broken clients 14 | let mut token_invalid_end: usize = 0; // Handle broken clients 15 | let mut is_id_part = false; 16 | let mut ids = Vec::new(); 17 | 18 | while let Some(&ch) = self.next() { 19 | match ch { 20 | b'\n' => { 21 | if !self.try_next_is_space() { 22 | return match ids.len() { 23 | 1 => HeaderValue::Text(ids.pop().unwrap()), 24 | 0 => { 25 | if token_invalid_start > 0 { 26 | HeaderValue::Text(String::from_utf8_lossy( 27 | self.bytes(token_invalid_start - 1..token_invalid_end), 28 | )) 29 | } else { 30 | HeaderValue::Empty 31 | } 32 | } 33 | _ => HeaderValue::TextList(ids), 34 | }; 35 | } else { 36 | continue; 37 | } 38 | } 39 | b'<' => { 40 | is_id_part = true; 41 | continue; 42 | } 43 | b'>' => { 44 | is_id_part = false; 45 | if token_start > 0 { 46 | ids.push(String::from_utf8_lossy( 47 | self.bytes(token_start - 1..token_end), 48 | )); 49 | token_start = 0; 50 | } else { 51 | continue; 52 | } 53 | } 54 | b' ' | b'\t' | b'\r' => continue, 55 | _ => {} 56 | } 57 | if is_id_part { 58 | if token_start == 0 { 59 | token_start = self.offset(); 60 | } 61 | token_end = self.offset(); 62 | } else { 63 | if token_invalid_start == 0 { 64 | token_invalid_start = self.offset(); 65 | } 66 | token_invalid_end = self.offset(); 67 | } 68 | } 69 | 70 | HeaderValue::Empty 71 | } 72 | } 73 | #[cfg(test)] 74 | mod tests { 75 | use std::borrow::Cow; 76 | 77 | use crate::parsers::{fields::load_tests, MessageStream}; 78 | 79 | #[test] 80 | fn parse_message_ids() { 81 | for test in load_tests::>>>("id.json") { 82 | assert_eq!( 83 | MessageStream::new(test.header.as_bytes()) 84 | .parse_id() 85 | .into_text_list(), 86 | test.expected, 87 | "failed for {:?}", 88 | test.header 89 | ); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/parsers/fields/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | pub mod address; 8 | pub mod content_type; 9 | pub mod date; 10 | pub mod id; 11 | pub mod list; 12 | pub mod raw; 13 | pub mod received; 14 | pub mod thread; 15 | pub mod unstructured; 16 | 17 | #[cfg(test)] 18 | use serde::{Deserialize, Serialize}; 19 | 20 | #[cfg(test)] 21 | #[derive(Debug, Serialize, Deserialize)] 22 | pub struct Test { 23 | pub header: String, 24 | pub expected: T, 25 | } 26 | 27 | #[cfg(test)] 28 | pub fn load_tests(test_name: &str) -> Vec> { 29 | serde_json::from_slice::>>( 30 | &std::fs::read( 31 | std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) 32 | .join("resources") 33 | .join(test_name), 34 | ) 35 | .unwrap(), 36 | ) 37 | .unwrap() 38 | } 39 | 40 | #[cfg(test)] 41 | #[derive(Debug, Default)] 42 | pub struct TestBuilder { 43 | test: std::path::PathBuf, 44 | tests: Vec>, 45 | } 46 | 47 | #[cfg(test)] 48 | impl TestBuilder { 49 | pub fn new(test: impl AsRef) -> Self { 50 | Self { 51 | test: std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) 52 | .join("resources") 53 | .join(test.as_ref()), 54 | tests: Vec::new(), 55 | } 56 | } 57 | 58 | pub fn add(&mut self, header: impl Into, expected: T) { 59 | self.tests.push(Test { 60 | header: header.into(), 61 | expected, 62 | }); 63 | } 64 | 65 | pub fn write(&self) { 66 | std::fs::write( 67 | &self.test, 68 | serde_json::to_string_pretty(&self.tests).unwrap(), 69 | ) 70 | .unwrap(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/parsers/fields/unstructured.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 OR MIT 5 | */ 6 | 7 | use std::borrow::Cow; 8 | 9 | use crate::{parsers::MessageStream, HeaderValue}; 10 | struct UnstructuredParser<'x> { 11 | token_start: usize, 12 | token_end: usize, 13 | tokens: Vec>, 14 | last_is_encoded: bool, 15 | } 16 | 17 | impl<'x> UnstructuredParser<'x> { 18 | fn add_token(&mut self, stream: &MessageStream<'x>) { 19 | if self.token_start > 0 { 20 | if !self.tokens.is_empty() { 21 | self.tokens.push(" ".into()); 22 | } 23 | self.tokens.push(String::from_utf8_lossy( 24 | stream.bytes(self.token_start - 1..self.token_end), 25 | )); 26 | 27 | self.token_start = 0; 28 | self.last_is_encoded = false; 29 | } 30 | } 31 | 32 | fn add_rfc2047(&mut self, token: String) { 33 | if !self.last_is_encoded { 34 | self.tokens.push(" ".into()); 35 | } 36 | self.tokens.push(token.into()); 37 | self.last_is_encoded = true; 38 | } 39 | } 40 | 41 | impl<'x> MessageStream<'x> { 42 | pub fn parse_unstructured(&mut self) -> HeaderValue<'x> { 43 | let mut parser = UnstructuredParser { 44 | token_start: 0, 45 | token_end: 0, 46 | tokens: Vec::new(), 47 | last_is_encoded: true, 48 | }; 49 | 50 | while let Some(ch) = self.next() { 51 | match ch { 52 | b'\n' => { 53 | parser.add_token(self); 54 | 55 | if !self.try_next_is_space() { 56 | return match parser.tokens.len() { 57 | 1 => HeaderValue::Text(parser.tokens.pop().unwrap()), 58 | 0 => HeaderValue::Empty, 59 | _ => HeaderValue::Text(parser.tokens.concat().into()), 60 | }; 61 | } else { 62 | continue; 63 | } 64 | } 65 | b' ' | b'\t' | b'\r' => { 66 | continue; 67 | } 68 | b'=' if self.peek_char(b'?') => { 69 | self.checkpoint(); 70 | if let Some(token) = self.decode_rfc2047() { 71 | parser.add_token(self); 72 | parser.add_rfc2047(token); 73 | continue; 74 | } 75 | self.restore(); 76 | } 77 | _ => (), 78 | } 79 | 80 | if parser.token_start == 0 { 81 | parser.token_start = self.offset(); 82 | } 83 | 84 | parser.token_end = self.offset(); 85 | } 86 | 87 | HeaderValue::Empty 88 | } 89 | } 90 | 91 | #[cfg(test)] 92 | mod tests { 93 | use crate::parsers::{fields::load_tests, MessageStream}; 94 | 95 | #[test] 96 | fn parse_unstructured() { 97 | for test in load_tests::("unstructured.json") { 98 | assert_eq!( 99 | MessageStream::new(test.header.as_bytes()) 100 | .parse_unstructured() 101 | .unwrap_text(), 102 | test.expected, 103 | "failed for {:?}", 104 | test.header 105 | ); 106 | } 107 | } 108 | } 109 | --------------------------------------------------------------------------------