diff --git a/src/lib.rs b/src/lib.rs index c9b1757..d4da72a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -304,19 +304,32 @@ impl Default for MessageStructure { } } -// Part of the message. +/// Part of the message. #[derive(Debug, Default, PartialEq)] #[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] pub struct Part<'x, T> { #[cfg_attr(feature = "serde_support", serde(default))] - pub headers: RfcHeaders<'x>, - + pub headers_rfc: RfcHeaders<'x>, + #[cfg_attr(feature = "serde_support", serde(default))] + #[cfg_attr(feature = "serde_support", serde(skip))] + pub headers_raw: RawHeaders<'x>, + pub is_encoding_problem: bool, pub body: T, } impl<'x, T> Part<'x, T> { - pub fn new(headers: RfcHeaders<'x>, body: T) -> Self { - Self { headers, body } + pub fn new( + headers_rfc: RfcHeaders<'x>, + headers_raw: RawHeaders<'x>, + body: T, + is_encoding_problem: bool, + ) -> Self { + Self { + headers_rfc, + headers_raw, + body, + is_encoding_problem, + } } pub fn get_body(&self) -> &T { @@ -324,6 +337,26 @@ impl<'x, T> Part<'x, T> { } } +impl<'x> MultiPart<'x> { + pub fn new(headers_rfc: RfcHeaders<'x>, headers_raw: RawHeaders<'x>) -> Self { + Self { + headers_rfc, + headers_raw, + } + } +} + +/// Multipart part +#[derive(Debug, Default, PartialEq)] +#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] +pub struct MultiPart<'x> { + #[cfg_attr(feature = "serde_support", serde(default))] + pub headers_rfc: RfcHeaders<'x>, + #[cfg_attr(feature = "serde_support", serde(default))] + #[cfg_attr(feature = "serde_support", serde(skip))] + pub headers_raw: RawHeaders<'x>, +} + /// Unique ID representing a MIME part within a message. pub type MessagePartId = usize; @@ -355,7 +388,7 @@ pub enum MessagePart<'x> { Message(Part<'x, MessageAttachment<'x>>), /// Multipart part - Multipart(RfcHeaders<'x>), + Multipart(MultiPart<'x>), } impl<'x> MessagePart<'x> { @@ -460,7 +493,7 @@ pub type RfcHeaders<'x> = HashMap>; pub type RawHeaders<'x> = HashMap, Vec>; /// Offset of a message element in the raw message. -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Clone)] #[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] pub struct HeaderOffset { pub start: usize, @@ -1189,43 +1222,43 @@ impl<'x> fmt::Display for Part<'x, MessageAttachment<'x>> { impl<'x, T> MimeHeaders<'x> for Part<'x, T> { fn get_content_description(&self) -> Option<&str> { - self.headers + self.headers_rfc .get(&HeaderName::ContentDescription) .and_then(|header| header.as_text_ref()) } fn get_content_disposition(&self) -> Option<&ContentType> { - self.headers + self.headers_rfc .get(&HeaderName::ContentDisposition) .and_then(|header| header.as_content_type_ref()) } fn get_content_id(&self) -> Option<&str> { - self.headers + self.headers_rfc .get(&HeaderName::ContentId) .and_then(|header| header.as_text_ref()) } fn get_content_transfer_encoding(&self) -> Option<&str> { - self.headers + self.headers_rfc .get(&HeaderName::ContentTransferEncoding) .and_then(|header| header.as_text_ref()) } fn get_content_type(&self) -> Option<&ContentType> { - self.headers + self.headers_rfc .get(&HeaderName::ContentType) .and_then(|header| header.as_content_type_ref()) } fn get_content_language(&self) -> &HeaderValue<'x> { - self.headers + self.headers_rfc .get(&HeaderName::ContentLanguage) .unwrap_or(&HeaderValue::Empty) } fn get_content_location(&self) -> Option<&str> { - self.headers + self.headers_rfc .get(&HeaderName::ContentLocation) .and_then(|header| header.as_text_ref()) } diff --git a/src/parsers/header.rs b/src/parsers/header.rs index 46c9a0e..d494139 100644 --- a/src/parsers/header.rs +++ b/src/parsers/header.rs @@ -36,7 +36,7 @@ pub enum HeaderParserResult<'x> { pub fn parse_headers<'x>( headers_rfc: &mut RfcHeaders<'x>, - mut headers_raw: Option<&mut RawHeaders<'x>>, + headers_raw: &mut RawHeaders<'x>, stream: &mut MessageStream<'x>, ) -> bool { loop { @@ -49,15 +49,13 @@ pub fn parse_headers<'x>( let from_offset = stream.pos; let value = parser(stream); - if let Some(headers_raw) = headers_raw.as_mut() { - headers_raw - .entry(HeaderOffsetName::Rfc(name)) - .or_insert_with(Vec::new) - .push(HeaderOffset { - start: from_offset, - end: stream.pos, - }); - } + headers_raw + .entry(HeaderOffsetName::Rfc(name)) + .or_insert_with(Vec::new) + .push(HeaderOffset { + start: from_offset, + end: stream.pos, + }); if !value.is_empty() { if is_many { @@ -85,15 +83,13 @@ pub fn parse_headers<'x>( HeaderParserResult::Other(name) => { let from_offset = stream.pos; parse_and_ignore(stream); - if let Some(headers_raw) = headers_raw.as_mut() { - headers_raw - .entry(HeaderOffsetName::Other(name)) - .or_insert_with(Vec::new) - .push(HeaderOffset { - start: from_offset, - end: stream.pos, - }); - } + headers_raw + .entry(HeaderOffsetName::Other(name)) + .or_insert_with(Vec::new) + .push(HeaderOffset { + start: from_offset, + end: stream.pos, + }); } HeaderParserResult::Lf => return true, HeaderParserResult::Eof => return false, diff --git a/src/parsers/message.rs b/src/parsers/message.rs index baa2770..ac2610b 100644 --- a/src/parsers/message.rs +++ b/src/parsers/message.rs @@ -16,8 +16,8 @@ use crate::{ base64::decode_base64, charsets::map::get_charset_decoder, quoted_printable::decode_quoted_printable, DecodeFnc, DecodeResult, }, - ContentType, HeaderName, HeaderValue, Message, MessageAttachment, MessagePart, MessagePartId, - MessageStructure, Part, RfcHeaders, + ContentType, HeaderName, HeaderOffsetName, HeaderValue, Message, MessageAttachment, + MessagePart, MessagePartId, MessageStructure, MultiPart, Part, RawHeaders, RfcHeaders, }; use super::{ @@ -213,6 +213,7 @@ impl<'x> Message<'x> { let mut state_stack = Vec::new(); let mut mime_part_header = RfcHeaders::new(); + let mut mime_part_header_raw = RawHeaders::new(); 'outer: loop { // Parse headers @@ -220,7 +221,7 @@ impl<'x> Message<'x> { message.offset_header = stream.pos; if !parse_headers( &mut message.headers_rfc, - Some(&mut message.headers_raw), + &mut message.headers_raw, &mut stream, ) { break; @@ -228,7 +229,11 @@ impl<'x> Message<'x> { message.offset_body = seek_crlf_end(&stream, stream.pos); (true, &mut message.headers_rfc) } else { - if !parse_headers(&mut mime_part_header, None, &mut stream) { + if !parse_headers( + &mut mime_part_header, + &mut mime_part_header_raw, + &mut stream, + ) { break; } (false, &mut mime_part_header) @@ -268,8 +273,9 @@ impl<'x> Message<'x> { }; if !is_message { add_missing_type(&mut mime_part_header, "text".into(), "plain".into()); - message.parts.push(MessagePart::Multipart(std::mem::take( - &mut mime_part_header, + message.parts.push(MessagePart::Multipart(MultiPart::new( + std::mem::take(&mut mime_part_header), + std::mem::take(&mut mime_part_header_raw), ))); } state_stack.push(state); @@ -312,7 +318,11 @@ impl<'x> Message<'x> { ..Default::default() }; add_missing_type(&mut mime_part_header, "message".into(), "rfc822".into()); - message_stack.push((message, std::mem::take(&mut mime_part_header))); + message_stack.push(( + message, + std::mem::take(&mut mime_part_header), + std::mem::take(&mut mime_part_header_raw), + )); state_stack.push(state); message = Message::new(); state = new_state; @@ -330,7 +340,8 @@ impl<'x> Message<'x> { ); // Attempt to recover contents of an invalid message - if bytes_read == 0 { + let is_encoding_problem = bytes_read == 0; + if is_encoding_problem { if stream.pos >= stream.data.len() || (is_binary && state.mime_boundary.is_none()) { state.structure.pop(); break; @@ -415,11 +426,39 @@ impl<'x> Message<'x> { if is_text { let is_html = mime_type == MimeType::TextHtml; - let text_part = Part { + let mut text_part = Part { body: result_to_string(bytes, stream.data, content_type), - headers: std::mem::take(&mut mime_part_header), + headers_rfc: std::mem::take(&mut mime_part_header), + headers_raw: std::mem::take(&mut mime_part_header_raw), + is_encoding_problem, }; + // If there is a single part in the message, move MIME headers + // to the part + if is_message { + for header_name in [ + HeaderName::ContentType, + HeaderName::ContentDisposition, + HeaderName::ContentId, + HeaderName::ContentLanguage, + HeaderName::ContentLocation, + HeaderName::ContentTransferEncoding, + HeaderName::ContentDescription, + ] { + if let Some(value) = message.headers_rfc.remove(&header_name) { + text_part.headers_rfc.insert(header_name, value); + } + if let Some(value) = + message.headers_raw.get(&HeaderOffsetName::Rfc(header_name)) + { + text_part + .headers_raw + .insert(HeaderOffsetName::Rfc(header_name), value.to_vec()); + } + } + } + add_missing_type(&mut text_part.headers_rfc, "text".into(), "plain".into()); + if add_to_html && !is_html { message.html_body.push(message.parts.len()); } else if add_to_text && is_html { @@ -449,11 +488,38 @@ impl<'x> Message<'x> { message.attachments.push(message.parts.len()); - let binary_part = Part::new( + let mut binary_part = Part::new( std::mem::take(&mut mime_part_header), + std::mem::take(&mut mime_part_header_raw), result_to_bytes(bytes, stream.data), + is_encoding_problem, ); + // If there is a single part in the message, move MIME headers + // to the part + if is_message { + for header_name in [ + HeaderName::ContentType, + HeaderName::ContentDisposition, + HeaderName::ContentId, + HeaderName::ContentLanguage, + HeaderName::ContentLocation, + HeaderName::ContentTransferEncoding, + HeaderName::ContentDescription, + ] { + if let Some(value) = message.headers_rfc.remove(&header_name) { + binary_part.headers_rfc.insert(header_name, value); + } + if let Some(value) = + message.headers_raw.get(&HeaderOffsetName::Rfc(header_name)) + { + binary_part + .headers_raw + .insert(HeaderOffsetName::Rfc(header_name), value.to_vec()); + } + } + } + message.parts.push(if !is_inline { MessagePart::Binary(binary_part) } else { @@ -465,7 +531,9 @@ impl<'x> Message<'x> { message.attachments.push(message.parts.len()); message.parts.push(MessagePart::Message(Part::new( std::mem::take(&mut mime_part_header), + std::mem::take(&mut mime_part_header_raw), MessageAttachment::Raw(result_to_bytes(bytes, stream.data)), + is_encoding_problem, ))); } @@ -476,8 +544,10 @@ impl<'x> Message<'x> { 'inner: loop { if let MimeType::Message = state.mime_type { // Finished processing nested message, restore parent message from stack - if let (Some((mut prev_message, headers)), Some(mut prev_state)) = - (message_stack.pop(), state_stack.pop()) + if let ( + Some((mut prev_message, headers, headers_raw)), + Some(mut prev_state), + ) = (message_stack.pop(), state_stack.pop()) { message.structure = state.get_structure(); message.offset_end = seek_crlf_end(&stream, last_part_offset); @@ -486,7 +556,9 @@ impl<'x> Message<'x> { prev_message.attachments.push(prev_message.parts.len()); prev_message.parts.push(MessagePart::Message(Part::new( headers, + headers_raw, MessageAttachment::Parsed(Box::new(message)), + false, ))); message = prev_message; prev_state.mime_boundary = state.mime_boundary; @@ -550,7 +622,7 @@ impl<'x> Message<'x> { } } - while let (Some((mut prev_message, headers)), Some(prev_state)) = + while let (Some((mut prev_message, headers, headers_raw)), Some(prev_state)) = (message_stack.pop(), state_stack.pop()) { message.offset_end = stream.pos; @@ -560,7 +632,9 @@ impl<'x> Message<'x> { prev_message.attachments.push(prev_message.parts.len()); prev_message.parts.push(MessagePart::Message(Part::new( headers, + headers_raw, MessageAttachment::Parsed(Box::new(message)), + false, ))); } message = prev_message; @@ -586,7 +660,7 @@ mod tests { use crate::parsers::message::Message; - const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----\n".as_bytes(); + const SEPARATOR: &[u8] = "\n---- EXPECTED STRUCTURE ----".as_bytes(); #[test] fn parse_full_messages() { diff --git a/tests/legacy/000.txt b/tests/legacy/000.txt index ed11040..b247455 100644 --- a/tests/legacy/000.txt +++ b/tests/legacy/000.txt @@ -42,14 +42,10 @@ QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5 IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "to": { - "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" - } + "mime_version": { + "Text": "1.0" }, "date": { "DateTime": { @@ -64,41 +60,23 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "tz_minute": 0 } }, - "subject": { - "Text": "Test message from Microsoft Outlook 00" - }, - "content_disposition": { - "ContentType": { - "c_type": "attachment", - "c_subtype": null, - "attributes": { - "filename": "redball.png" - } + "to": { + "Address": { + "name": "Joe Blow", + "address": "jblow@example.com" } }, - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": { - "name": "redball.png" - } - } - }, - "content_transfer_encoding": { - "Text": "base64" - }, "message_id": { "Text": "NDBBIAKOPKHFGPLCODIGKEKECHAA.doug@example.com" }, - "mime_version": { - "Text": "1.0" - }, "from": { "Address": { "name": "Doug Sauder", "address": "doug@example.com" } + }, + "subject": { + "Text": "Test message from Microsoft Outlook 00" } }, "html_body": [], @@ -109,7 +87,30 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "parts": [ { "Binary": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": { + "name": "redball.png" + } + } + }, + "content_disposition": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": { + "filename": "redball.png" + } + } + } + }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/001.txt b/tests/legacy/001.txt index 5a33728..e7ecf93 100644 --- a/tests/legacy/001.txt +++ b/tests/legacy/001.txt @@ -33,9 +33,20 @@ ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein = m+APw-ssen als wir.+ACI-=20 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com" + }, + "mime_version": { + "Text": "1.0" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "doug@example.com" + } + }, "to": { "AddressList": [ { @@ -48,12 +59,6 @@ m+APw-ssen als wir.+ACI-=20 } ] }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com" - }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, "subject": { "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" }, @@ -69,24 +74,6 @@ m+APw-ssen als wir.+ACI-=20 "tz_hour": 4, "tz_minute": 0 } - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "utf-7" - } - } - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" - } - }, - "mime_version": { - "Text": "1.0" } }, "html_body": [ @@ -99,7 +86,21 @@ m+APw-ssen als wir.+ACI-=20 "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "utf-7" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n" } } diff --git a/tests/legacy/002.txt b/tests/legacy/002.txt index 78bfce4..67860dc 100644 --- a/tests/legacy/002.txt +++ b/tests/legacy/002.txt @@ -35,42 +35,20 @@ wir."
----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "subject": { - "Text": "Die Hasen und die Frösche" - }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "html", - "attributes": { - "charset": "iso-8859-1" - } - } + "mime_version": { + "Text": "1.0" }, "message_id": { "Text": "4.2.0.58.20000519003052.00a89c40@pop.example.com" }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, "to": { "Address": { "name": "Heinz Müller", "address": "mueller@example.com" } }, - "mime_version": { - "Text": "1.0" - }, "date": { "DateTime": { "year": 2000, @@ -83,6 +61,15 @@ wir."
"tz_hour": 4, "tz_minute": 0 } + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "subject": { + "Text": "Die Hasen und die Frösche" } }, "html_body": [ @@ -95,7 +82,21 @@ wir."
"parts": [ { "Html": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": { + "charset": "iso-8859-1" + } + } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" + } + }, + "is_encoding_problem": false, "body": "\nDie Hasen und die\nFrösche
\n
\n
Die Hasen klagten einst über\nihre mißliche Lage; "wir leben", sprach ein Redner, "in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben."
\n
\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.
\n
\n"Halt", rief nun eben dieser Sprecher, "wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir."
\n
\n
\n\n" } } diff --git a/tests/legacy/003.txt b/tests/legacy/003.txt index 40a17ec..abb5dc0 100644 --- a/tests/legacy/003.txt +++ b/tests/legacy/003.txt @@ -62,39 +62,8 @@ wir."
--=====================_714967308==_.ALT-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "mime_version": { - "Text": "1.0" - }, - "message_id": { - "Text": "4.2.0.58.20000519002557.00a88870@pop.example.com" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "=====================_714967308==_.ALT" - } - } - }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, "date": { "DateTime": { "year": 2000, @@ -107,6 +76,36 @@ wir."
"tz_hour": 4, "tz_minute": 0 } + }, + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + }, + "mime_version": { + "Text": "1.0" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "subject": { + "Text": "Die Hasen und die Frösche" + }, + "message_id": { + "Text": "4.2.0.58.20000519002557.00a88870@pop.example.com" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "=====================_714967308==_.ALT" + } + } } }, "html_body": [ @@ -119,7 +118,7 @@ wir."
"parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "quoted-printable" }, @@ -133,12 +132,16 @@ wir."
} } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n" } }, { "Html": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, "content_type": { "ContentType": { "c_type": "text", @@ -147,11 +150,9 @@ wir."
"charset": "iso-8859-1" } } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\nDie Hasen und die\nFrösche
\n
\n
Die Hasen klagten einst über\nihre mißliche Lage; "wir leben", sprach ein Redner, "in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben."
\n
\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.
\n
\n"Halt", rief nun eben dieser Sprecher, "wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir."
\n
\n
\n" } } diff --git a/tests/legacy/004.txt b/tests/legacy/004.txt index 6173989..e2cf86a 100644 --- a/tests/legacy/004.txt +++ b/tests/legacy/004.txt @@ -17,8 +17,7 @@ A HARE one day ridiculed the short feet and slow pace of the Tortoise, who repli Slow but steady wins the race. ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "to": { "Address": { @@ -39,29 +38,20 @@ Slow but steady wins the race. "tz_minute": 0 } }, + "subject": { + "Text": "The Hare and the Tortoise" + }, "mime_version": { "Text": "1.0" }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "us-ascii" - } - } + "message_id": { + "Text": "4.2.0.58.20000519011207.00a8cd70@pop.example.com" }, "from": { "Address": { "name": "Doug Sauder", "address": "dwsauder@example.com" } - }, - "message_id": { - "Text": "4.2.0.58.20000519011207.00a8cd70@pop.example.com" - }, - "subject": { - "Text": "The Hare and the Tortoise" } }, "html_body": [ @@ -74,7 +64,18 @@ Slow but steady wins the race. "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "us-ascii" + } + } + } + }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n\r\n" } } diff --git a/tests/legacy/005.txt b/tests/legacy/005.txt index a463e8e..6aca448 100644 --- a/tests/legacy/005.txt +++ b/tests/legacy/005.txt @@ -31,22 +31,12 @@ Ers+AOQ-ufen noch ein wenig aufschieben, denn auch uns f+APw-rchten, wie = ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein = m+APw-ssen als wir.+ACI-=20 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "mime_version": { - "Text": "1.0" - }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "utf-7" - } + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" } }, "from": { @@ -55,6 +45,12 @@ m+APw-ssen als wir.+ACI-=20 "address": "doug@example.com" } }, + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGCEKDCHAA.doug@example.com" + }, + "subject": { + "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" + }, "date": { "DateTime": { "year": 2000, @@ -68,17 +64,8 @@ m+APw-ssen als wir.+ACI-=20 "tz_minute": 0 } }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGCEKDCHAA.doug@example.com" - }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - }, - "subject": { - "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" + "mime_version": { + "Text": "1.0" } }, "html_body": [ @@ -91,7 +78,21 @@ m+APw-ssen als wir.+ACI-=20 "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "utf-7" + } + } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n" } } diff --git a/tests/legacy/006.txt b/tests/legacy/006.txt index cbcd9e4..1ef112f 100644 --- a/tests/legacy/006.txt +++ b/tests/legacy/006.txt @@ -82,15 +82,8 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== ------=_NextPart_000_0004_01BFC037.28F2FA90-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "from": { - "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" - } - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -100,12 +93,15 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, - "to": { + "from": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "name": "Doug Sauder", + "address": "doug@example.com" } }, + "subject": { + "Text": "Test message from Microsoft Outlook 00" + }, "date": { "DateTime": { "year": 2000, @@ -119,12 +115,15 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "tz_minute": 0 } }, + "to": { + "Address": { + "name": "Joe Blow", + "address": "jblow@example.com" + } + }, "message_id": { "Text": "NDBBIAKOPKHFGPLCODIGOEKECHAA.doug@example.com" }, - "subject": { - "Text": "Test message from Microsoft Outlook 00" - }, "mime_version": { "Text": "1.0" } @@ -138,7 +137,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "parts": [ { "Binary": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, "content_disposition": { "ContentType": { "c_type": "attachment", @@ -148,9 +150,6 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, - "content_transfer_encoding": { - "Text": "base64" - }, "content_type": { "ContentType": { "c_type": "image", @@ -161,6 +160,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1492,7 +1492,16 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { + "content_disposition": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": { + "filename": "redball.png" + } + } + }, "content_type": { "ContentType": { "c_type": "image", @@ -1504,17 +1513,9 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, "content_transfer_encoding": { "Text": "base64" - }, - "content_disposition": { - "ContentType": { - "c_type": "attachment", - "c_subtype": null, - "attributes": { - "filename": "redball.png" - } - } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/007.txt b/tests/legacy/007.txt index ea9bd75..90b956e 100644 --- a/tests/legacy/007.txt +++ b/tests/legacy/007.txt @@ -30,9 +30,14 @@ ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige = Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "to": { + "Address": { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + }, "subject": { "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" }, @@ -49,30 +54,12 @@ Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 "tz_minute": 0 } }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } - } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, - "to": { - "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" - } + "mime_version": { + "Text": "1.0" }, "message_id": { "Text": "NDBBIAKOPKHFGPLCODIGIEKCCHAA.doug@example.com" }, - "mime_version": { - "Text": "1.0" - }, "from": { "Address": { "name": "Doug Sauder", @@ -90,7 +77,21 @@ Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n" } } diff --git a/tests/legacy/008.txt b/tests/legacy/008.txt index 1455cf3..789ea47 100644 --- a/tests/legacy/008.txt +++ b/tests/legacy/008.txt @@ -134,15 +134,32 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== ------=_NextPart_000_0002_01BFC036.AE309650-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "----=_NextPart_000_0002_01BFC036.AE309650" + } + } + }, "from": { "Address": { "name": "Doug Sauder", "address": "doug@example.com" } }, + "subject": { + "Text": "Test message from Microsoft Outlook 00" + }, + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + }, "date": { "DateTime": { "year": 2000, @@ -156,29 +173,11 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "tz_minute": 0 } }, - "subject": { - "Text": "Test message from Microsoft Outlook 00" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "----=_NextPart_000_0002_01BFC036.AE309650" - } - } + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGGEKECHAA.doug@example.com" }, "mime_version": { "Text": "1.0" - }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGGEKECHAA.doug@example.com" } }, "html_body": [ @@ -195,7 +194,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "parts": [ { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, "content_type": { "ContentType": { "c_type": "text", @@ -204,17 +206,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "charset": "iso-8859-1" } } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n" } }, { "Binary": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, "content_type": { "ContentType": { "c_type": "image", @@ -232,11 +235,9 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "filename": "blueball.png" } } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1568,7 +1569,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -1578,6 +1579,9 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "content_transfer_encoding": { + "Text": "base64" + }, "content_type": { "ContentType": { "c_type": "image", @@ -1586,11 +1590,9 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "name": "greenball.png" } } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -2895,7 +2897,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -2918,6 +2920,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/009.txt b/tests/legacy/009.txt index b5167f4..e09c5c2 100644 --- a/tests/legacy/009.txt +++ b/tests/legacy/009.txt @@ -35,8 +35,7 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "date": { "DateTime": { @@ -51,8 +50,8 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "tz_minute": 0 } }, - "message_id": { - "Text": "4.2.0.58.20000519010441.00a8d140@pop.example.com" + "subject": { + "Text": "Die Hasen und die Frösche" }, "from": { "Address": { @@ -60,9 +59,6 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "address": "dwsauder@example.com" } }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, "mime_version": { "Text": "1.0" }, @@ -72,18 +68,8 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "address": "jschmuergen@example.com" } }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1", - "format": "flowed" - } - } + "message_id": { + "Text": "4.2.0.58.20000519010441.00a8d140@pop.example.com" } }, "html_body": [ @@ -96,7 +82,22 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1", + "format": "flowed" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein \nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, \nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der \nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; \nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte \neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste \nuntertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein \nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, \nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n" } } diff --git a/tests/legacy/010.txt b/tests/legacy/010.txt index 138d2d4..1a38526 100644 --- a/tests/legacy/010.txt +++ b/tests/legacy/010.txt @@ -20,39 +20,11 @@ In einem nahen Teich wollten sie sich nun ers ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "subject": { "Text": "Die Hasen und die Fr�sche" }, - "message_id": { - "Text": "4.2.0.58.20000519010842.00a8c7f0@pop.example.com" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } - } - }, - "content_transfer_encoding": { - "Text": "8bit" - }, - "to": { - "Address": { - "name": "Heinz M�ller", - "address": "mueller@example.com" - } - }, "date": { "DateTime": { "year": 2000, @@ -66,8 +38,23 @@ In einem nahen Teich wollten sie sich nun ers "tz_minute": 0 } }, + "to": { + "Address": { + "name": "Heinz M�ller", + "address": "mueller@example.com" + } + }, + "message_id": { + "Text": "4.2.0.58.20000519010842.00a8c7f0@pop.example.com" + }, "mime_version": { "Text": "1.0" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } } }, "html_body": [ @@ -80,7 +67,21 @@ In einem nahen Teich wollten sie sich nun ers "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + }, + "content_transfer_encoding": { + "Text": "8bit" + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\n\r\n\r\n" } } diff --git a/tests/legacy/011.txt b/tests/legacy/011.txt index bcb1a44..056f405 100644 --- a/tests/legacy/011.txt +++ b/tests/legacy/011.txt @@ -28,14 +28,10 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "to": { - "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" - } + "message_id": { + "Text": "4.2.0.58.20000519001217.00a85b60@pop.example.com" }, "from": { "Address": { @@ -43,24 +39,15 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= "address": "dwsauder@example.com" } }, - "message_id": { - "Text": "4.2.0.58.20000519001217.00a85b60@pop.example.com" - }, - "mime_version": { - "Text": "1.0" + "to": { + "Address": { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } }, "subject": { "Text": "Die Hasen und die Frösche" }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } - } - }, "date": { "DateTime": { "year": 2000, @@ -74,8 +61,8 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= "tz_minute": 0 } }, - "content_transfer_encoding": { - "Text": "quoted-printable" + "mime_version": { + "Text": "1.0" } }, "html_body": [ @@ -88,7 +75,21 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n\n" } } diff --git a/tests/legacy/012.txt b/tests/legacy/012.txt index 5e90eeb..0ef3b18 100644 --- a/tests/legacy/012.txt +++ b/tests/legacy/012.txt @@ -29,30 +29,13 @@ sie aufs schnellste untertauchten.=20 ein wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige = Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "date": { - "DateTime": { - "year": 2000, - "month": 5, - "day": 17, - "hour": 19, - "minute": 30, - "second": 20, - "tz_before_gmt": true, - "tz_hour": 4, - "tz_minute": 0 - } + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGCEKECHAA.doug@example.com" }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "Windows-1252" - } - } + "subject": { + "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" }, "to": { "Address": { @@ -66,17 +49,21 @@ Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 "address": "doug@example.com" } }, - "subject": { - "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" + "date": { + "DateTime": { + "year": 2000, + "month": 5, + "day": 17, + "hour": 19, + "minute": 30, + "second": 20, + "tz_before_gmt": true, + "tz_hour": 4, + "tz_minute": 0 + } }, "mime_version": { "Text": "1.0" - }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGCEKECHAA.doug@example.com" } }, "html_body": [ @@ -89,7 +76,21 @@ Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "Windows-1252" + } + } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n" } } diff --git a/tests/legacy/013.txt b/tests/legacy/013.txt index 019c720..448c243 100644 --- a/tests/legacy/013.txt +++ b/tests/legacy/013.txt @@ -30,29 +30,10 @@ wenig aufschieben, denn auch uns f welche also wohl noch unglücklicher sein müssen als wir." ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "subject": { - "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } - } - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" - } - }, - "content_transfer_encoding": { - "Text": "8bit" + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGEEKCCHAA.doug@example.com" }, "to": { "Address": { @@ -60,11 +41,17 @@ welche also wohl noch ungl "address": "schmuergen@example.com" } }, + "subject": { + "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" + }, "mime_version": { "Text": "1.0" }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGEEKCCHAA.doug@example.com" + "from": { + "Address": { + "name": "Doug Sauder", + "address": "doug@example.com" + } }, "date": { "DateTime": { @@ -90,7 +77,21 @@ welche also wohl noch ungl "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + }, + "content_transfer_encoding": { + "Text": "8bit" + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod\r\nselbst. Auf, laßt uns ein für allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\r\nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte\r\neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\r\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch unglücklicher sein müssen als wir.\"\r\n\r\n" } } diff --git a/tests/legacy/014.txt b/tests/legacy/014.txt index 5f8102a..111d3d8 100644 --- a/tests/legacy/014.txt +++ b/tests/legacy/014.txt @@ -71,11 +71,16 @@ race. =20 ------=_NextPart_000_0005_01BFC037.799BEF60-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGCEKFCHAA.doug@example.com" + "to": { + "Address": { + "name": "Joe Blow", + "address": "jblow@example.com" + } + }, + "mime_version": { + "Text": "1.0" }, "subject": { "Text": "Test message from Microsoft Outlook 00" @@ -89,15 +94,6 @@ race. =20 } } }, - "mime_version": { - "Text": "1.0" - }, - "to": { - "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" - } - }, "date": { "DateTime": { "year": 2000, @@ -116,6 +112,9 @@ race. =20 "name": "Doug Sauder", "address": "doug@example.com" } + }, + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGCEKFCHAA.doug@example.com" } }, "html_body": [ @@ -128,10 +127,7 @@ race. =20 "parts": [ { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -140,17 +136,18 @@ race. =20 "charset": "iso-8859-1" } } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n" } }, { "Html": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -159,8 +156,12 @@ race. =20 "charset": "iso-8859-1" } } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\n\n\n\n\n

The Hare and the Tortoise
 
A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:  \"Though you be swift as the wind, I will beat you in a \nrace.\"  The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.  On the day appointed for the race the two started \ntogether.  The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.  The Hare, lying down by \nthe wayside, fell fast asleep.  At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue. 
 
Slow but steady wins the race.  \n
\n" } } diff --git a/tests/legacy/015.txt b/tests/legacy/015.txt index 8a8032b..ad7f802 100644 --- a/tests/legacy/015.txt +++ b/tests/legacy/015.txt @@ -197,8 +197,7 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= --=====================_715392540==_-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "from": { "Address": { @@ -206,30 +205,6 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "address": "dwsauder@example.com" } }, - "mime_version": { - "Text": "1.0" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "=====================_715392540==_" - } - } - }, - "message_id": { - "Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com" - }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - }, "date": { "DateTime": { "year": 2000, @@ -242,6 +217,30 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "tz_hour": 4, "tz_minute": 0 } + }, + "mime_version": { + "Text": "1.0" + }, + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "=====================_715392540==_" + } + } + }, + "subject": { + "Text": "Die Hasen und die Frösche" + }, + "message_id": { + "Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com" } }, "html_body": [ @@ -259,13 +258,15 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "related", - "attributes": { - "type": "multipart/alternative", - "boundary": "=====================_715392540==_.REL" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": { + "type": "multipart/alternative", + "boundary": "=====================_715392540==_.REL" + } } } } @@ -273,12 +274,14 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "=====================_715392550==_.ALT" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "=====================_715392550==_.ALT" + } } } } @@ -286,10 +289,7 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -298,17 +298,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "charset": "iso-8859-1" } } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n2aa3ed95.png2aa3edd1.png" } }, { "Html": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -317,14 +318,21 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "charset": "iso-8859-1" } } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\nDie Hasen und die\nFrösche
\n
\n
Die Hasen klagten einst über\nihre mißliche Lage; "wir leben", sprach ein Redner, "in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben."
\n
\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.
\n
\n"Halt", rief nun eben dieser Sprecher, "wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir."
\n
\n
\"2aa3ed95.png\"\"2aa3edd1.png\"\n" } }, { "Binary": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, "content_type": { "ContentType": { "c_type": "image", @@ -334,12 +342,6 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, - "content_transfer_encoding": { - "Text": "base64" - }, - "content_id": { - "Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com.2" - }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -348,8 +350,12 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "filename": "2aa3ed95.png" } } + }, + "content_id": { + "Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com.2" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1681,7 +1687,19 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { + "headers_rfc": { + "content_id": { + "Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com.3" + }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "2aa3edd1.png" + } + } + }, "content_transfer_encoding": { "Text": "base64" }, @@ -1693,20 +1711,9 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "name": "2aa3edd1.png" } } - }, - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "2aa3edd1.png" - } - } - }, - "content_id": { - "Text": "4.2.0.58.20000519003556.00a918e0@pop.example.com.3" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -3166,7 +3173,16 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": { + "name": "blueball.png" + } + } + }, "content_transfer_encoding": { "Text": "base64" }, @@ -3178,17 +3194,9 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "filename": "blueball.png" } } - }, - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": { - "name": "blueball.png" - } - } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -4520,7 +4528,10 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, "content_disposition": { "ContentType": { "c_type": "attachment", @@ -4538,11 +4549,9 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "name": "greenball.png" } } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/016.txt b/tests/legacy/016.txt index 2e510a5..88e4aba 100644 --- a/tests/legacy/016.txt +++ b/tests/legacy/016.txt @@ -94,13 +94,15 @@ JB@ac)(GTFLiL)!d09'8!!!: --=====================_716373961==_-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "to": { - "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "=====================_716373961==_" + } } }, "message_id": { @@ -112,21 +114,6 @@ JB@ac)(GTFLiL)!d09'8!!!: "address": "dwsauder@example.com" } }, - "mime_version": { - "Text": "1.0" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "=====================_716373961==_" - } - } - }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, "date": { "DateTime": { "year": 2000, @@ -139,6 +126,18 @@ JB@ac)(GTFLiL)!d09'8!!!: "tz_hour": 4, "tz_minute": 0 } + }, + "subject": { + "Text": "Die Hasen und die Frösche" + }, + "mime_version": { + "Text": "1.0" + }, + "to": { + "Address": { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } } }, "html_body": [ @@ -154,7 +153,7 @@ JB@ac)(GTFLiL)!d09'8!!!: "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -168,21 +167,13 @@ JB@ac)(GTFLiL)!d09'8!!!: "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n" } }, { "Binary": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "application", - "c_subtype": "mac-binhex40", - "attributes": { - "name": "blueball.png" - } - } - }, + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -191,8 +182,18 @@ JB@ac)(GTFLiL)!d09'8!!!: "filename": "blueball.png" } } + }, + "content_type": { + "ContentType": { + "c_type": "application", + "c_subtype": "mac-binhex40", + "attributes": { + "name": "blueball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 13, 10, @@ -2129,16 +2130,7 @@ JB@ac)(GTFLiL)!d09'8!!!: }, { "Binary": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "application", - "c_subtype": "mac-binhex40", - "attributes": { - "name": "HasenundFr�sche.txt" - } - } - }, + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -2147,8 +2139,18 @@ JB@ac)(GTFLiL)!d09'8!!!: "filename": "HasenundFr�sche.txt" } } + }, + "content_type": { + "ContentType": { + "c_type": "application", + "c_subtype": "mac-binhex40", + "attributes": { + "name": "HasenundFr�sche.txt" + } + } } }, + "is_encoding_problem": false, "body": [ 13, 10, diff --git a/tests/legacy/017.txt b/tests/legacy/017.txt index 926841d..bdbde6e 100644 --- a/tests/legacy/017.txt +++ b/tests/legacy/017.txt @@ -101,9 +101,35 @@ end --=====================_716177458==_-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "mime_version": { + "Text": "1.0" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "to": { + "Address": { + "name": "J�rgen Schm�rgen", + "address": "jschmuergen@example.com" + } + }, + "subject": { + "Text": "The Hare and the Tortoise" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "=====================_716177458==_" + } + } + }, "message_id": { "Text": "4.2.0.58.20000519004755.00a86100@pop.example.com" }, @@ -119,33 +145,6 @@ end "tz_hour": 4, "tz_minute": 0 } - }, - "subject": { - "Text": "The Hare and the Tortoise" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, - "mime_version": { - "Text": "1.0" - }, - "to": { - "Address": { - "name": "J�rgen Schm�rgen", - "address": "jschmuergen@example.com" - } - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "=====================_716177458==_" - } - } } }, "html_body": [ @@ -161,7 +160,7 @@ end "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -172,12 +171,13 @@ end } } }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n\r" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -200,6 +200,7 @@ end "Text": "x-uuencode" } }, + "is_encoding_problem": false, "body": [ 13, 10, @@ -2061,7 +2062,16 @@ end }, { "Binary": { - "headers": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": { + "name": "blueball.png" + } + } + }, "content_transfer_encoding": { "Text": "x-uuencode" }, @@ -2073,17 +2083,9 @@ end "filename": "blueball.png" } } - }, - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": { - "name": "blueball.png" - } - } } }, + "is_encoding_problem": false, "body": [ 13, 10, diff --git a/tests/legacy/018.txt b/tests/legacy/018.txt index f452851..04fd4b1 100644 --- a/tests/legacy/018.txt +++ b/tests/legacy/018.txt @@ -137,30 +137,8 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== --=====================_715157131==_.REL-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, - "message_id": { - "Text": "4.2.0.58.20000519003143.00a8d550@pop.example.com" - }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - }, - "mime_version": { - "Text": "1.0" - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -171,6 +149,21 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + }, + "subject": { + "Text": "Die Hasen und die Frösche" + }, "date": { "DateTime": { "year": 2000, @@ -183,6 +176,12 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "tz_hour": 4, "tz_minute": 0 } + }, + "message_id": { + "Text": "4.2.0.58.20000519003143.00a8d550@pop.example.com" + }, + "mime_version": { + "Text": "1.0" } }, "html_body": [ @@ -198,12 +197,14 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "=====================_715157141==_.ALT" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "=====================_715157141==_.ALT" + } } } } @@ -211,7 +212,10 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, "content_type": { "ContentType": { "c_type": "text", @@ -220,17 +224,15 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "charset": "iso-8859-1" } } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "blueball.png\n\nDie Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\nredball.png" } }, { "Html": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -244,12 +246,13 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\n\"blueball.png\"
\n
\nDie Hasen und die\nFrösche
\n
\n
Die Hasen klagten einst über\nihre mißliche Lage; "wir leben", sprach ein Redner, "in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben."
\n
\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.
\n
\n"Halt", rief nun eben dieser Sprecher, "wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir."
\n
\n\"redball.png\"
\n" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -259,9 +262,6 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, - "content_transfer_encoding": { - "Text": "base64" - }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -273,8 +273,12 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, "content_id": { "Text": "4.2.0.58.20000519003143.00a8d550@pop.example.com.0" + }, + "content_transfer_encoding": { + "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1606,19 +1610,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "redball.png" - } - } - }, - "content_transfer_encoding": { - "Text": "base64" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -1628,10 +1620,23 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "content_transfer_encoding": { + "Text": "base64" + }, "content_id": { "Text": "4.2.0.58.20000519003143.00a8d550@pop.example.com.1" + }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "redball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/019.txt b/tests/legacy/019.txt index 549baad..022bc7d 100644 --- a/tests/legacy/019.txt +++ b/tests/legacy/019.txt @@ -143,21 +143,8 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== ------=_NextPart_000_0008_01BFC037.FDD8EE90-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "subject": { - "Text": "Test message from Microsoft Outlook 00" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "----=_NextPart_000_0008_01BFC037.FDD8EE90" - } - } - }, "date": { "DateTime": { "year": 2000, @@ -174,11 +161,8 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "mime_version": { "Text": "1.0" }, - "to": { - "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" - } + "subject": { + "Text": "Test message from Microsoft Outlook 00" }, "from": { "Address": { @@ -186,8 +170,23 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "address": "doug@example.com" } }, + "to": { + "Address": { + "name": "Joe Blow", + "address": "jblow@example.com" + } + }, "message_id": { "Text": "NDBBIAKOPKHFGPLCODIGGEKFCHAA.doug@example.com" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "----=_NextPart_000_0008_01BFC037.FDD8EE90" + } + } } }, "html_body": [ @@ -203,12 +202,14 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "----=_NextPart_001_0009_01BFC037.FDD8EE90" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "----=_NextPart_001_0009_01BFC037.FDD8EE90" + } } } } @@ -216,7 +217,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "quoted-printable" }, @@ -230,12 +231,16 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "is_encoding_problem": false, "body": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n" } }, { "Html": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, "content_type": { "ContentType": { "c_type": "text", @@ -244,29 +249,15 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "charset": "iso-8859-1" } } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\n\n\n\n\n

The Hare and the Tortoise
 
A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:  \"Though you be swift as the wind, I will beat you in a \nrace.\"  The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.  On the day appointed for the race the two started \ntogether.  The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.  The Hare, lying down by \nthe wayside, fell fast asleep.  At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue. 
 
Slow but steady wins the race.  \n
\n" } }, { "Binary": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "attachment", - "c_subtype": null, - "attributes": { - "filename": "greenball.png" - } - } - }, - "content_transfer_encoding": { - "Text": "base64" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -275,8 +266,21 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "name": "greenball.png" } } + }, + "content_transfer_encoding": { + "Text": "base64" + }, + "content_disposition": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": { + "filename": "greenball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1581,7 +1585,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "base64" }, @@ -1604,6 +1608,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/020.txt b/tests/legacy/020.txt index 561f251..ba88bb5 100644 --- a/tests/legacy/020.txt +++ b/tests/legacy/020.txt @@ -30,9 +30,26 @@ wenig aufschieben, denn auch uns f welche also wohl noch unglücklicher sein müssen als wir." ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "subject": { + "Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)" + }, + "to": { + "Address": { + "name": "J�rgen Schm�rgen", + "address": "schmuergen@example.com" + } + }, + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGIEKBCHAA.doug@example.com" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "doug@example.com" + } + }, "date": { "DateTime": { "year": 2000, @@ -46,38 +63,8 @@ welche also wohl noch ungl "tz_minute": 0 } }, - "subject": { - "Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" - } - }, - "to": { - "Address": { - "name": "J�rgen Schm�rgen", - "address": "schmuergen@example.com" - } - }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGIEKBCHAA.doug@example.com" - }, "mime_version": { "Text": "1.0" - }, - "content_transfer_encoding": { - "Text": "8bit" - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } - } } }, "html_body": [ @@ -90,7 +77,21 @@ welche also wohl noch ungl "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "8bit" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod\r\nselbst. Auf, laßt uns ein für allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\r\nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte\r\neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\r\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch unglücklicher sein müssen als wir.\"\r\n\r\n" } } diff --git a/tests/legacy/021.txt b/tests/legacy/021.txt index 8e8f310..788243e 100644 --- a/tests/legacy/021.txt +++ b/tests/legacy/021.txt @@ -187,15 +187,32 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== ------=_NextPart_000_0010_01BFC038.B91BC650-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "----=_NextPart_000_0010_01BFC038.B91BC650" + } + } + }, + "mime_version": { + "Text": "1.0" + }, + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGOEKFCHAA.doug@example.com" + }, "to": { "Address": { "name": "Joe Blow", "address": "jblow@example.com" } }, + "subject": { + "Text": "Test message from Microsoft Outlook 00" + }, "date": { "DateTime": { "year": 2000, @@ -209,24 +226,6 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "tz_minute": 0 } }, - "subject": { - "Text": "Test message from Microsoft Outlook 00" - }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGOEKFCHAA.doug@example.com" - }, - "mime_version": { - "Text": "1.0" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "----=_NextPart_000_0010_01BFC038.B91BC650" - } - } - }, "from": { "Address": { "name": "Doug Sauder", @@ -248,12 +247,14 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "related", - "attributes": { - "boundary": "----=_NextPart_001_0011_01BFC038.B91BC650" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": { + "boundary": "----=_NextPart_001_0011_01BFC038.B91BC650" + } } } } @@ -261,12 +262,14 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "----=_NextPart_002_0012_01BFC038.B91BC650" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "----=_NextPart_002_0012_01BFC038.B91BC650" + } } } } @@ -274,10 +277,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -286,14 +286,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "charset": "iso-8859-1" } } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\n\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n\n" } }, { "Html": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "quoted-printable" }, @@ -307,15 +311,13 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "is_encoding_problem": false, "body": "\n\n\n\n\n
\"blue
\n

The Hare and the Tortoise
 
A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:  \"Though you be swift as the wind, I will beat you in a \nrace.\"  The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.  On the day appointed for the race the two started \ntogether.  The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.  The Hare, lying down by \nthe wayside, fell fast asleep.  At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue. 
 
Slow but steady wins the race.  \n
\n

 
\n" } }, { "Binary": { - "headers": { - "content_id": { - "Text": "938014623@17052000-0f9b" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -325,10 +327,14 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "content_id": { + "Text": "938014623@17052000-0f9b" + }, "content_transfer_encoding": { "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1660,7 +1666,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -1670,6 +1676,9 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "content_transfer_encoding": { + "Text": "base64" + }, "content_type": { "ContentType": { "c_type": "image", @@ -1678,11 +1687,9 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "name": "greenball.png" } } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -2987,7 +2994,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -3010,6 +3017,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/022.txt b/tests/legacy/022.txt index 7310933..37ce84e 100644 --- a/tests/legacy/022.txt +++ b/tests/legacy/022.txt @@ -29,20 +29,13 @@ IHdlbGNoZSBhbHNvIHdvaGwgbm9jaCB1bmds/GNrbGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIu IiANCg== ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGAEKCCHAA.doug@example.com" + "mime_version": { + "Text": "1.0" }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } - } + "subject": { + "Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)" }, "to": { "Address": { @@ -50,21 +43,6 @@ IiANCg== "address": "schmuergen@example.com" } }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" - } - }, - "subject": { - "Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)" - }, - "content_transfer_encoding": { - "Text": "base64" - }, - "mime_version": { - "Text": "1.0" - }, "date": { "DateTime": { "year": 2000, @@ -77,6 +55,15 @@ IiANCg== "tz_hour": 4, "tz_minute": 0 } + }, + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGAEKCCHAA.doug@example.com" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "doug@example.com" + } } }, "html_body": [ @@ -89,7 +76,21 @@ IiANCg== "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\n" } } diff --git a/tests/legacy/023.txt b/tests/legacy/023.txt index 058e8d0..ed7b76c 100644 --- a/tests/legacy/023.txt +++ b/tests/legacy/023.txt @@ -107,12 +107,14 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= --=====================_716541962==_-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "subject": { "Text": "Die Hasen und die Frösche" }, + "mime_version": { + "Text": "1.0" + }, "content_type": { "ContentType": { "c_type": "multipart", @@ -122,11 +124,8 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= } } }, - "to": { - "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" - } + "message_id": { + "Text": "4.2.0.58.20000519005505.00a853a0@pop.example.com" }, "date": { "DateTime": { @@ -141,17 +140,17 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= "tz_minute": 0 } }, - "message_id": { - "Text": "4.2.0.58.20000519005505.00a853a0@pop.example.com" + "to": { + "Address": { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } }, "from": { "Address": { "name": "Doug Sauder", "address": "dwsauder@example.com" } - }, - "mime_version": { - "Text": "1.0" } }, "html_body": [ @@ -168,7 +167,10 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= "parts": [ { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, "content_type": { "ContentType": { "c_type": "text", @@ -177,26 +179,15 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= "charset": "iso-8859-1" } } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n" } }, { "Binary": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": { - "name": "blueball.png" - } - } - }, + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -208,8 +199,18 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= }, "content_transfer_encoding": { "Text": "base64" + }, + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": { + "name": "blueball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1541,16 +1542,7 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= }, { "Text": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "us-ascii" - } - } - }, + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -1559,22 +1551,26 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= "filename": "farmerandstork.txt" } } - } - }, - "body": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n\r" - } - }, - { - "Text": { - "headers": { + }, "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": { - "charset": "iso-8859-1" + "charset": "us-ascii" } } + } + }, + "is_encoding_problem": false, + "body": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n\r" + } + }, + { + "Text": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" }, "content_disposition": { "ContentType": { @@ -1585,10 +1581,17 @@ In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;= } } }, - "content_transfer_encoding": { - "Text": "quoted-printable" + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n" } } diff --git a/tests/legacy/024.txt b/tests/legacy/024.txt index 80e196e..093705a 100644 --- a/tests/legacy/024.txt +++ b/tests/legacy/024.txt @@ -108,20 +108,13 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== --=====================_715429112==_.REL-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } + "message_id": { + "Text": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com" }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } + "subject": { + "Text": "Die Hasen und die Frösche" }, "content_type": { "ContentType": { @@ -133,9 +126,6 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, - "message_id": { - "Text": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com" - }, "date": { "DateTime": { "year": 2000, @@ -149,8 +139,17 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "tz_minute": 0 } }, - "subject": { - "Text": "Die Hasen und die Frösche" + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } }, "mime_version": { "Text": "1.0" @@ -169,7 +168,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "parts": [ { "Html": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "quoted-printable" }, @@ -183,14 +182,21 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, + "is_encoding_problem": false, "body": "\n\"2aa48eb6.png\"
\n
\nDie Hasen und die\nFrösche
\n
\n
Die Hasen klagten einst über\nihre mißliche Lage; "wir leben", sprach ein Redner, "in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben."
\n
\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.
\n
\n"Halt", rief nun eben dieser Sprecher, "wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir."
\n
\n\"2aa48ec0.png\"
\n" } }, { "Binary": { - "headers": { - "content_transfer_encoding": { - "Text": "base64" + "headers_rfc": { + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "2aa48eb6.png" + } + } }, "content_type": { "ContentType": { @@ -201,19 +207,14 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "2aa48eb6.png" - } - } - }, "content_id": { "Text": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com.2" + }, + "content_transfer_encoding": { + "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1545,22 +1546,13 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { "content_id": { "Text": "4.2.0.58.20000519003735.00a8d7e0@pop.example.com.3" }, "content_transfer_encoding": { "Text": "base64" }, - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": { - "name": "2aa48ec0.png" - } - } - }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -1569,8 +1561,18 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "filename": "2aa48ec0.png" } } + }, + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": { + "name": "2aa48ec0.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/025.txt b/tests/legacy/025.txt index 2c62b63..15622bf 100644 --- a/tests/legacy/025.txt +++ b/tests/legacy/025.txt @@ -170,18 +170,8 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= --=====================_715462801==_-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -191,15 +181,6 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, - "mime_version": { - "Text": "1.0" - }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - }, "message_id": { "Text": "4.2.0.58.20000519003809.00a85140@pop.example.com" }, @@ -215,6 +196,24 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "tz_hour": 4, "tz_minute": 0 } + }, + "mime_version": { + "Text": "1.0" + }, + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "subject": { + "Text": "Die Hasen und die Frösche" } }, "html_body": [ @@ -232,13 +231,15 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "related", - "attributes": { - "boundary": "=====================_715462801==_.REL", - "type": "text/html" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": { + "type": "text/html", + "boundary": "=====================_715462801==_.REL" + } } } } @@ -246,7 +247,7 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Html": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -260,26 +261,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\nDie Hasen und die\nFrösche
\n
\n
Die Hasen klagten einst über\nihre mißliche Lage; "wir leben", sprach ein Redner, "in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben."
\n
\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.
\n
\n"Halt", rief nun eben dieser Sprecher, "wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir."
\n
\n
\"2aa51367.png\"\"2aa51371.png\"\n" } }, { "Binary": { - "headers": { - "content_transfer_encoding": { - "Text": "base64" - }, + "headers_rfc": { "content_id": { "Text": "4.2.0.58.20000519003809.00a85140@pop.example.com.2" }, - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "2aa51367.png" - } - } + "content_transfer_encoding": { + "Text": "base64" }, "content_type": { "ContentType": { @@ -289,8 +282,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "name": "2aa51367.png" } } + }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "2aa51367.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1622,10 +1625,7 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { - "content_transfer_encoding": { - "Text": "base64" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -1644,10 +1644,14 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "content_transfer_encoding": { + "Text": "base64" + }, "content_id": { "Text": "4.2.0.58.20000519003809.00a85140@pop.example.com.3" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -3107,9 +3111,15 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { - "content_transfer_encoding": { - "Text": "base64" + "headers_rfc": { + "content_disposition": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": { + "filename": "blueball.png" + } + } }, "content_type": { "ContentType": { @@ -3120,16 +3130,11 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, - "content_disposition": { - "ContentType": { - "c_type": "attachment", - "c_subtype": null, - "attributes": { - "filename": "blueball.png" - } - } + "content_transfer_encoding": { + "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -4461,7 +4466,7 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -4471,9 +4476,6 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, - "content_transfer_encoding": { - "Text": "base64" - }, "content_type": { "ContentType": { "c_type": "image", @@ -4482,8 +4484,12 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "name": "greenball.png" } } + }, + "content_transfer_encoding": { + "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/026.txt b/tests/legacy/026.txt index d24b3fa..15e7114 100644 --- a/tests/legacy/026.txt +++ b/tests/legacy/026.txt @@ -83,30 +83,8 @@ Birds of a feather flock together. --=====================_716740438==_-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "message_id": { - "Text": "4.2.0.58.20000519005818.00a86aa0@pop.example.com" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - }, - "mime_version": { - "Text": "1.0" - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -116,6 +94,12 @@ Birds of a feather flock together. } } }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, "date": { "DateTime": { "year": 2000, @@ -128,6 +112,21 @@ Birds of a feather flock together. "tz_hour": 4, "tz_minute": 0 } + }, + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + }, + "subject": { + "Text": "Die Hasen und die Frösche" + }, + "message_id": { + "Text": "4.2.0.58.20000519005818.00a86aa0@pop.example.com" + }, + "mime_version": { + "Text": "1.0" } }, "html_body": [ @@ -143,10 +142,7 @@ Birds of a feather flock together. "parts": [ { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -155,25 +151,26 @@ Birds of a feather flock together. "charset": "iso-8859-1" } } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n" } }, { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "x-uuencode" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": { - "x-mac-creator": "74747874", + "name": "HasenundFr�sche.txt", "x-mac-type": "54455854", - "name": "HasenundFr�sche.txt" + "x-mac-creator": "74747874" } } }, @@ -185,23 +182,18 @@ Birds of a feather flock together. "filename": "HasenundFr�sche.txt" } } + }, + "content_transfer_encoding": { + "Text": "x-uuencode" } }, + "is_encoding_problem": false, "body": "\r\nbegin 600 HasenundFr�sche.txt\r\nM1&EE($AA\n\n\n\n\n

The Hare and the Tortoise
 
A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:  \"Though you be swift as the wind, I will beat you in a \nrace.\"  The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.  On the day appointed for the race the two started \ntogether.  The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.  The Hare, lying down by \nthe wayside, fell fast asleep.  At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.  
\n
 
\n
\"blue
 
Slow but steady wins \nthe race. 
\n
 
\n
\"red
\n" } }, { "Binary": { - "headers": { - "content_transfer_encoding": { - "Text": "base64" - }, + "headers_rfc": { "content_id": { "Text": "823504223@17052000-0f8d" }, @@ -281,8 +281,12 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "name": "blueball.png" } } + }, + "content_transfer_encoding": { + "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1614,7 +1618,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { "content_id": { "Text": "823504223@17052000-0f94" }, @@ -1631,6 +1635,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/029.txt b/tests/legacy/029.txt index 6fca9a9..407221f 100644 --- a/tests/legacy/029.txt +++ b/tests/legacy/029.txt @@ -26,31 +26,18 @@ reached the goal, and was comfortably dozing after her fatigue. Slow but steady wins the race. ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "subject": { - "Text": "Test message from Netscape Communicator 4.7" - }, - "content_transfer_encoding": { - "Text": "7bit" - }, "from": { "Address": { "name": "Doug Sauder", "address": "dwsauder@example.com" } }, - "mime_version": { - "Text": "1.0" - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "us-ascii" - } + "to": { + "Address": { + "name": "Joe Blow", + "address": "blow@example.com" } }, "date": { @@ -66,14 +53,14 @@ Slow but steady wins the race. "tz_minute": 0 } }, + "mime_version": { + "Text": "1.0" + }, + "subject": { + "Text": "Test message from Netscape Communicator 4.7" + }, "message_id": { "Text": "392362D8.B650789F@example.com" - }, - "to": { - "Address": { - "name": "Joe Blow", - "address": "blow@example.com" - } } }, "html_body": [ @@ -86,7 +73,21 @@ Slow but steady wins the race. "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "7bit" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "us-ascii" + } + } + } + }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r\n" } } diff --git a/tests/legacy/030.txt b/tests/legacy/030.txt index 6dac63b..ce4b684 100644 --- a/tests/legacy/030.txt +++ b/tests/legacy/030.txt @@ -110,12 +110,14 @@ Slow but steady wins the race. --------------0BBC657DDC74A0B8454627FD-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "subject": { "Text": "Test message from Netscape Communicator 4.7" }, + "mime_version": { + "Text": "1.0" + }, "content_type": { "ContentType": { "c_type": "multipart", @@ -125,6 +127,12 @@ Slow but steady wins the race. } } }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, "date": { "DateTime": { "year": 2000, @@ -138,23 +146,14 @@ Slow but steady wins the race. "tz_minute": 0 } }, - "mime_version": { - "Text": "1.0" + "message_id": { + "Text": "3923635B.85C58444@example.com" }, "to": { "Address": { "name": "Joe Blow", "address": "blow@example.com" } - }, - "message_id": { - "Text": "3923635B.85C58444@example.com" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } } }, "html_body": [ @@ -175,7 +174,10 @@ Slow but steady wins the race. "parts": [ { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "7bit" + }, "content_type": { "ContentType": { "c_type": "text", @@ -184,17 +186,15 @@ Slow but steady wins the race. "charset": "us-ascii" } } - }, - "content_transfer_encoding": { - "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r" } }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -217,6 +217,7 @@ Slow but steady wins the race. } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1548,7 +1549,10 @@ Slow but steady wins the race. }, { "InlineBinary": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -1566,11 +1570,9 @@ Slow but steady wins the race. "name": "greenball.png" } } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -2875,10 +2877,7 @@ Slow but steady wins the race. }, { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "7bit" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -2889,6 +2888,9 @@ Slow but steady wins the race. } } }, + "content_transfer_encoding": { + "Text": "7bit" + }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -2899,6 +2901,7 @@ Slow but steady wins the race. } } }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n\r" } } diff --git a/tests/legacy/031.txt b/tests/legacy/031.txt index 301dff0..1e5b1b7 100644 --- a/tests/legacy/031.txt +++ b/tests/legacy/031.txt @@ -95,11 +95,28 @@ mWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBp Z3VldDZzO7wAAAAASUVORK5CYII= ---1463757054-952513540-958744548=:8452-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "message_id": { - "Text": "Pine.LNX.4.21.0005190951410.8452-102000@penguin.example.com" + "from": { + "Address": { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + }, + "mime_version": { + "Text": "1.0" + }, + "subject": { + "Text": "Test message from PINE" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "-1463757054-952513540-958744548=:8452" + } + } }, "date": { "DateTime": { @@ -114,32 +131,14 @@ Z3VldDZzO7wAAAAASUVORK5CYII= "tz_minute": 0 } }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "-1463757054-952513540-958744548=:8452" - } - } + "message_id": { + "Text": "Pine.LNX.4.21.0005190951410.8452-102000@penguin.example.com" }, "to": { "Address": { "name": "Joe Blow", "address": "blow@example.com" } - }, - "mime_version": { - "Text": "1.0" - }, - "subject": { - "Text": "Test message from PINE" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" - } } }, "html_body": [ @@ -155,7 +154,7 @@ Z3VldDZzO7wAAAAASUVORK5CYII= "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -166,20 +165,15 @@ Z3VldDZzO7wAAAAASUVORK5CYII= } } }, + "is_encoding_problem": false, "body": "This is a test message from PINE MUA.\r\n\r\n\r" } }, { "Binary": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "attachment", - "c_subtype": null, - "attributes": { - "filename": "redball.png" - } - } + "headers_rfc": { + "content_transfer_encoding": { + "Text": "BASE64" }, "content_description": { "Text": "A PNG graphic file" @@ -193,13 +187,20 @@ Z3VldDZzO7wAAAAASUVORK5CYII= } } }, - "content_transfer_encoding": { - "Text": "BASE64" - }, "content_id": { "Text": "Pine.LNX.4.21.0005190955480.8452@penguin.example.com" + }, + "content_disposition": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": { + "filename": "redball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1659,22 +1660,10 @@ Z3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { - "content_description": { - "Text": "A PNG graphic file" - }, + "headers_rfc": { "content_id": { "Text": "Pine.LNX.4.21.0005190955481.8452@penguin.example.com" }, - "content_type": { - "ContentType": { - "c_type": "application", - "c_subtype": "octet-stream", - "attributes": { - "name": "blueball.png" - } - } - }, "content_disposition": { "ContentType": { "c_type": "attachment", @@ -1686,8 +1675,21 @@ Z3VldDZzO7wAAAAASUVORK5CYII= }, "content_transfer_encoding": { "Text": "BASE64" + }, + "content_type": { + "ContentType": { + "c_type": "application", + "c_subtype": "octet-stream", + "attributes": { + "name": "blueball.png" + } + } + }, + "content_description": { + "Text": "A PNG graphic file" } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/032.txt b/tests/legacy/032.txt index 1cf3498..9bbcae9 100644 --- a/tests/legacy/032.txt +++ b/tests/legacy/032.txt @@ -132,27 +132,17 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= --------------C78F594988075E36AE03C243-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "subject": { + "Text": "Test message from Netscape Communicator 4.7" + }, "to": { "Address": { "name": "Joe Blow", "address": "blow@example.com" } }, - "subject": { - "Text": "Test message from Netscape Communicator 4.7" - }, - "mime_version": { - "Text": "1.0" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -162,8 +152,8 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, - "message_id": { - "Text": "39235EAD.E48E2160@example.com" + "mime_version": { + "Text": "1.0" }, "date": { "DateTime": { @@ -177,6 +167,15 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "tz_hour": 4, "tz_minute": 0 } + }, + "message_id": { + "Text": "39235EAD.E48E2160@example.com" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } } }, "html_body": [ @@ -196,12 +195,14 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "------------D74AE2393FB01D1B284AE257" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "------------D74AE2393FB01D1B284AE257" + } } } } @@ -209,10 +210,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -221,14 +219,18 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "charset": "iso-8859-1" } } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n" } }, { "Html": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -242,12 +244,13 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\n\r\nDie Hasen und die Frösche\r\n

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

In einem nahen Teich wollten sie sich nun ersäufen; sie eilten\r\nihm zu; allein das außerordentliche Getöse und ihre wunderbare\r\nGestalt erschreckte eine Menge Frösche, die am Ufer saßen, so\r\nsehr, daß sie aufs schnellste untertauchten.\r\n

\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen\r\nnoch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch unglücklicher sein müssen\r\nals wir.\"\r\n
 \r\n
 \r\n\r" } }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "inline", @@ -270,6 +273,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1574,7 +1578,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -1597,6 +1601,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/033.txt b/tests/legacy/033.txt index 33de672..255b850 100644 --- a/tests/legacy/033.txt +++ b/tests/legacy/033.txt @@ -32,14 +32,10 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere, welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "to": { - "Address": { - "name": "Joe Blow", - "address": "blow@example.com" - } + "mime_version": { + "Text": "1.0" }, "from": { "Address": { @@ -47,15 +43,18 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "address": "dwsauder@example.com" } }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "UTF-8" - } + "to": { + "Address": { + "name": "Joe Blow", + "address": "blow@example.com" } }, + "message_id": { + "Text": "392363E1.2AC47AB3@example.com" + }, + "subject": { + "Text": "Test message from Netscape Communicator 4.7" + }, "date": { "DateTime": { "year": 2000, @@ -68,18 +67,6 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "tz_hour": 4, "tz_minute": 0 } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, - "message_id": { - "Text": "392363E1.2AC47AB3@example.com" - }, - "mime_version": { - "Text": "1.0" - }, - "subject": { - "Text": "Test message from Netscape Communicator 4.7" } }, "html_body": [ @@ -92,7 +79,21 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "UTF-8" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Fr�sche\n\nDie Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der\nTod selbst. Auf, la�t uns ein f�r allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;\nallein das au�erordentliche Get�se und ihre wunderbare Gestalt\nerschreckte eine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs\nschnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein\nwenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,\nwelche also wohl noch ungl�cklicher sein m�ssen als wir.\"\n" } } diff --git a/tests/legacy/034.txt b/tests/legacy/034.txt index a0e2a9f..a8c4cdc 100644 --- a/tests/legacy/034.txt +++ b/tests/legacy/034.txt @@ -25,11 +25,13 @@ schnellste untertauchten. wenig aufschieben, denn auch uns f+vGM-hten, wie ihr seht, einige Tiere, welche also wohl noch ungl+uKs-licher sein m+vLM-en als wir." ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "mime_version": { - "Text": "1.0" + "message_id": { + "Text": "39236497.12FA2A89@example.com" + }, + "subject": { + "Text": "Die Hasen und die Fr+APY-sche" }, "from": { "Address": { @@ -37,30 +39,6 @@ welche also wohl noch ungl+uKs-licher sein m+vLM-en als wir." "address": "dwsauder@example.com" } }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "UTF-7" - } - } - }, - "subject": { - "Text": "Die Hasen und die Fr+APY-sche" - }, - "to": { - "Address": { - "name": "Heinz M+APw-ller", - "address": "mueller@example.com" - } - }, - "content_transfer_encoding": { - "Text": "7bit" - }, - "message_id": { - "Text": "39236497.12FA2A89@example.com" - }, "date": { "DateTime": { "year": 2000, @@ -73,6 +51,15 @@ welche also wohl noch ungl+uKs-licher sein m+vLM-en als wir." "tz_hour": 4, "tz_minute": 0 } + }, + "mime_version": { + "Text": "1.0" + }, + "to": { + "Address": { + "name": "Heinz M+APw-ller", + "address": "mueller@example.com" + } } }, "html_body": [ @@ -85,7 +72,21 @@ welche also wohl noch ungl+uKs-licher sein m+vLM-en als wir." "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "7bit" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "UTF-7" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Fr岣he\r\n\r\nDie Hasen klagten einst 롥r ihre miެiche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\r\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist 㱧er als der\r\nTod selbst. Auf, la޴ uns ein f밠allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ers㴦en; sie eilten ihm zu;\r\nallein das auޥrordentliche Get岥 und ihre wunderbare Gestalt\r\nerschreckte eine Menge Fr岣he, die am Ufer saޥn, so sehr, daݠsie aufs\r\nschnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers㴦en noch ein\r\nwenig aufschieben, denn auch uns f뱣hten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch ungl뢫licher sein m벳en als wir.\"\r\n" } } diff --git a/tests/legacy/035.txt b/tests/legacy/035.txt index 0f5454b..5bb0cef 100644 --- a/tests/legacy/035.txt +++ b/tests/legacy/035.txt @@ -211,33 +211,14 @@ YII= --------------A1E83A41894D3755390B838A-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "message_id": { - "Text": "39235FC5.276CCE00@example.com" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, "mime_version": { "Text": "1.0" }, "subject": { "Text": "Die Hasen und die Frösche (Netscape Messenger 4.7)" }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "------------A1E83A41894D3755390B838A" - } - } - }, "date": { "DateTime": { "year": 2000, @@ -251,11 +232,29 @@ YII= "tz_minute": 0 } }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "------------A1E83A41894D3755390B838A" + } + } + }, "to": { "Address": { "name": "Heinz Müller", "address": "mueller@example.com" } + }, + "message_id": { + "Text": "39235FC5.276CCE00@example.com" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } } }, "html_body": [ @@ -277,12 +276,14 @@ YII= "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "------------F03F94BA73D3B9E8C1B94D92" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "------------F03F94BA73D3B9E8C1B94D92" + } } } } @@ -290,7 +291,7 @@ YII= }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -304,17 +305,20 @@ YII= "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "[blue ball]\n\nDie Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n[Image]\n\n\n" } }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "related", - "attributes": { - "boundary": "------------C02FA3D0A04E95F295FB25EB" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": { + "boundary": "------------C02FA3D0A04E95F295FB25EB" + } } } } @@ -322,7 +326,10 @@ YII= }, { "Html": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "7bit" + }, "content_type": { "ContentType": { "c_type": "text", @@ -331,19 +338,24 @@ YII= "charset": "us-ascii" } } - }, - "content_transfer_encoding": { - "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\n\r\n\"blue\r\n

Die Hasen und die Frösche\r\n

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

In einem nahen Teich wollten sie sich nun ersäufen; sie eilten\r\nihm zu; allein das außerordentliche Getöse und ihre wunderbare\r\nGestalt erschreckte eine Menge Frösche, die am Ufer saßen, so\r\nsehr, daß sie aufs schnellste untertauchten.\r\n

\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen\r\nnoch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch unglücklicher sein müssen\r\nals wir.\"\r\n

\r\n
 \r\n
 \r\n\r" } }, { "Binary": { - "headers": { - "content_transfer_encoding": { - "Text": "base64" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": null + } + }, + "content_id": { + "Text": "part1.39235FC5.E71D8178@example.com" }, "content_disposition": { "ContentType": { @@ -354,17 +366,11 @@ YII= } } }, - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": null - } - }, - "content_id": { - "Text": "part1.39235FC5.E71D8178@example.com" + "content_transfer_encoding": { + "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1696,13 +1702,9 @@ YII= }, { "Binary": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": null - } + "headers_rfc": { + "content_id": { + "Text": "part2.39235FC5.E71D8178@example.com" }, "content_disposition": { "ContentType": { @@ -1713,13 +1715,18 @@ YII= } } }, + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": null + } + }, "content_transfer_encoding": { "Text": "base64" - }, - "content_id": { - "Text": "part2.39235FC5.E71D8178@example.com" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -3179,19 +3186,10 @@ YII= }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "base64" }, - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "redball.png" - } - } - }, "content_type": { "ContentType": { "c_type": "image", @@ -3200,8 +3198,18 @@ YII= "name": "redball.png" } } + }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "redball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -4661,16 +4669,7 @@ YII= }, { "InlineBinary": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": { - "name": "greenball.png" - } - } - }, + "headers_rfc": { "content_transfer_encoding": { "Text": "base64" }, @@ -4682,8 +4681,18 @@ YII= "filename": "greenball.png" } } + }, + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": { + "name": "greenball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/036.txt b/tests/legacy/036.txt index c7cdbca..6b1ad79 100644 --- a/tests/legacy/036.txt +++ b/tests/legacy/036.txt @@ -25,9 +25,17 @@ lche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "mime_version": { + "Text": "1.0" + }, + "to": { + "Address": { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + }, "date": { "DateTime": { "year": 2000, @@ -41,38 +49,17 @@ lche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 "tz_minute": 0 } }, - "to": { - "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" - } + "subject": { + "Text": "Die Hasen und die Frösche" }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } - } + "message_id": { + "Text": "Pine.LNX.4.21.0005191014500.8452-100000@penguin.example.com" }, "from": { "Address": { "name": "Doug Sauder", "address": "doug@penguin.example.com" } - }, - "message_id": { - "Text": "Pine.LNX.4.21.0005191014500.8452-100000@penguin.example.com" - }, - "content_transfer_encoding": { - "Text": "QUOTED-PRINTABLE" - }, - "mime_version": { - "Text": "1.0" - }, - "subject": { - "Text": "Die Hasen und die Frösche" } }, "html_body": [ @@ -85,7 +72,21 @@ lche also wohl noch ungl=FCcklicher sein m=FCssen als wir."=20 "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "QUOTED-PRINTABLE" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n\n" } } diff --git a/tests/legacy/037.txt b/tests/legacy/037.txt index eac4d08..67fcfe9 100644 --- a/tests/legacy/037.txt +++ b/tests/legacy/037.txt @@ -50,30 +50,14 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= --------------E7889DDF0F75D34163841C59-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "------------E7889DDF0F75D34163841C59" - } - } + "mime_version": { + "Text": "1.0" }, "message_id": { "Text": "392366A7.21929EA7@example.com" }, - "to": { - "Address": { - "name": "Joe Blow", - "address": "blow@example.com" - } - }, - "subject": { - "Text": "Test message from Netscape Communicator 4.7" - }, "date": { "DateTime": { "year": 2000, @@ -87,14 +71,29 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "tz_minute": 0 } }, - "mime_version": { - "Text": "1.0" - }, "from": { "Address": { "name": "Doug Sauder", "address": "dwsauder@example.com" } + }, + "subject": { + "Text": "Test message from Netscape Communicator 4.7" + }, + "to": { + "Address": { + "name": "Joe Blow", + "address": "blow@example.com" + } + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "------------E7889DDF0F75D34163841C59" + } + } } }, "html_body": [ @@ -111,7 +110,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "7bit" }, @@ -125,12 +124,16 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "is_encoding_problem": false, "body": " \r" } }, { "InlineBinary": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, "content_type": { "ContentType": { "c_type": "image", @@ -140,9 +143,6 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, - "content_transfer_encoding": { - "Text": "base64" - }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -153,6 +153,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/038.txt b/tests/legacy/038.txt index a0c602c..0e49a0d 100644 --- a/tests/legacy/038.txt +++ b/tests/legacy/038.txt @@ -16,11 +16,13 @@ A HARE one day ridiculed the short feet and slow pace of the Tortoise, who repli Slow but steady wins the race. ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "mime_version": { - "Text": "1.0" + "message_id": { + "Text": "3923625B.59F0C3AC@example.com" + }, + "subject": { + "Text": "Test message from Netscape Communicator 4.7" }, "to": { "Address": { @@ -28,15 +30,6 @@ Slow but steady wins the race. "address": "blow@example.com" } }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "us-ascii" - } - } - }, "date": { "DateTime": { "year": 2000, @@ -56,14 +49,8 @@ Slow but steady wins the race. "address": "dwsauder@example.com" } }, - "subject": { - "Text": "Test message from Netscape Communicator 4.7" - }, - "content_transfer_encoding": { - "Text": "7bit" - }, - "message_id": { - "Text": "3923625B.59F0C3AC@example.com" + "mime_version": { + "Text": "1.0" } }, "html_body": [ @@ -76,7 +63,21 @@ Slow but steady wins the race. "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "us-ascii" + } + } + }, + "content_transfer_encoding": { + "Text": "7bit" + } + }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r\n" } } diff --git a/tests/legacy/039.txt b/tests/legacy/039.txt index 5c40a47..2b80a47 100644 --- a/tests/legacy/039.txt +++ b/tests/legacy/039.txt @@ -170,27 +170,35 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= --------------B7133A01A6B323BF00DBC9A7-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "message_id": { - "Text": "39236103.FFE674FC@example.com" - }, "mime_version": { "Text": "1.0" }, + "to": { + "Address": { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + }, "from": { "Address": { "name": "Doug Sauder", "address": "dwsauder@example.com" } }, - "to": { - "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "------------B7133A01A6B323BF00DBC9A7" + } } }, + "message_id": { + "Text": "39236103.FFE674FC@example.com" + }, "date": { "DateTime": { "year": 2000, @@ -206,15 +214,6 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, "subject": { "Text": "Test message from Netscape Communicator 4.7" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "------------B7133A01A6B323BF00DBC9A7" - } - } } }, "html_body": [ @@ -236,12 +235,14 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "related", - "attributes": { - "boundary": "------------8E6A06810565BCAB5E1F7D97" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": { + "boundary": "------------8E6A06810565BCAB5E1F7D97" + } } } } @@ -249,7 +250,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Html": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -263,15 +264,23 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\n\r\n\"blue\r\n

Die Hasen und die Frösche\r\n

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

In einem nahen Teich wollten sie sich nun ersäufen; sie eilten\r\nihm zu; allein das außerordentliche Getöse und ihre wunderbare\r\nGestalt erschreckte eine Menge Frösche, die am Ufer saßen, so\r\nsehr, daß sie aufs schnellste untertauchten.\r\n

\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen\r\nnoch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch unglücklicher sein müssen\r\nals wir.\"\r\n

\"red\r\n\r" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_id": { "Text": "part1.39236103.1B697A54@example.com" }, + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": null + } + }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -283,15 +292,9 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, "content_transfer_encoding": { "Text": "base64" - }, - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": null - } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1623,13 +1626,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { - "content_transfer_encoding": { - "Text": "base64" - }, - "content_id": { - "Text": "part2.39236103.1B697A54@example.com" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -1637,6 +1634,12 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "attributes": null } }, + "content_transfer_encoding": { + "Text": "base64" + }, + "content_id": { + "Text": "part2.39236103.1B697A54@example.com" + }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -1647,6 +1650,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -3106,10 +3110,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "InlineBinary": { - "headers": { - "content_transfer_encoding": { - "Text": "base64" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -3119,6 +3120,9 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "content_transfer_encoding": { + "Text": "base64" + }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -3129,6 +3133,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -4433,7 +4438,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -4443,6 +4448,9 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "content_transfer_encoding": { + "Text": "base64" + }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -4451,11 +4459,9 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "filename": "blueball.png" } } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/040.txt b/tests/legacy/040.txt index a919e1e..c78d1aa 100644 --- a/tests/legacy/040.txt +++ b/tests/legacy/040.txt @@ -27,8 +27,7 @@ schnellste untertauchten. = n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= , welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "mime_version": { "Text": "1.0" @@ -39,12 +38,6 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= "address": "dwsauder@example.com" } }, - "message_id": { - "Text": "39236653.CAA8A090@example.com" - }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, "date": { "DateTime": { "year": 2000, @@ -58,8 +51,8 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= "tz_minute": 0 } }, - "subject": { - "Text": "Die Hasen und die Frösche" + "message_id": { + "Text": "39236653.CAA8A090@example.com" }, "to": { "Address": { @@ -67,14 +60,8 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= "address": "schmuergen@example.com" } }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } - } + "subject": { + "Text": "Die Hasen und die Frösche" } }, "html_body": [ @@ -87,7 +74,21 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"\n" } } diff --git a/tests/legacy/041.txt b/tests/legacy/041.txt index 805ea31..e98b017 100644 --- a/tests/legacy/041.txt +++ b/tests/legacy/041.txt @@ -56,8 +56,7 @@ JXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5IFl2ZXMgUGlndWV0NnM7 vAAAAABJRU5ErkJggg== ---1463757054-170444605-958746196=:8452-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "date": { "DateTime": { @@ -78,18 +77,12 @@ vAAAAABJRU5ErkJggg== "address": "doug@penguin.example.com" } }, - "subject": { - "Text": "PNG graphic" - }, "to": { "Address": { "name": "Heinz Müller", "address": "mueller@example.com" } }, - "message_id": { - "Text": "Pine.LNX.4.21.0005191019440.8452-101000@penguin.example.com" - }, "mime_version": { "Text": "1.0" }, @@ -101,6 +94,12 @@ vAAAAABJRU5ErkJggg== "boundary": "-1463757054-170444605-958746196=:8452" } } + }, + "subject": { + "Text": "PNG graphic" + }, + "message_id": { + "Text": "Pine.LNX.4.21.0005191019440.8452-101000@penguin.example.com" } }, "html_body": [ @@ -115,7 +114,7 @@ vAAAAABJRU5ErkJggg== "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -126,24 +125,19 @@ vAAAAABJRU5ErkJggg== } } }, + "is_encoding_problem": false, "body": "\r" } }, { "Binary": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "attachment", - "c_subtype": null, - "attributes": { - "filename": "redball.png" - } - } - }, + "headers_rfc": { "content_transfer_encoding": { "Text": "BASE64" }, + "content_id": { + "Text": "Pine.LNX.4.21.0005191023160.8452@penguin.example.com" + }, "content_type": { "ContentType": { "c_type": "application", @@ -153,13 +147,20 @@ vAAAAABJRU5ErkJggg== } } }, + "content_disposition": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": { + "filename": "redball.png" + } + } + }, "content_description": { "Text": "red ball" - }, - "content_id": { - "Text": "Pine.LNX.4.21.0005191023160.8452@penguin.example.com" } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/042.txt b/tests/legacy/042.txt index 5f26f7d..dd7fdc8 100644 --- a/tests/legacy/042.txt +++ b/tests/legacy/042.txt @@ -57,9 +57,20 @@ Birds of a feather flock together. --------------77060D866A66DC8D0921E051-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "------------77060D866A66DC8D0921E051" + } + } + }, + "subject": { + "Text": "Test message from Netscape Communicator 4.7" + }, "date": { "DateTime": { "year": 2000, @@ -82,26 +93,14 @@ Birds of a feather flock together. "mime_version": { "Text": "1.0" }, + "message_id": { + "Text": "3923686C.99FB5E36@example.com" + }, "to": { "Address": { "name": "Joe Blow", "address": "blow@example.com" } - }, - "subject": { - "Text": "Test message from Netscape Communicator 4.7" - }, - "message_id": { - "Text": "3923686C.99FB5E36@example.com" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "------------77060D866A66DC8D0921E051" - } - } } }, "html_body": [ @@ -116,10 +115,7 @@ Birds of a feather flock together. "parts": [ { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "7bit" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -128,14 +124,21 @@ Birds of a feather flock together. "charset": "us-ascii" } } + }, + "content_transfer_encoding": { + "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r" } }, { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "7bit" + }, "content_type": { "ContentType": { "c_type": "text", @@ -146,9 +149,6 @@ Birds of a feather flock together. } } }, - "content_transfer_encoding": { - "Text": "7bit" - }, "content_disposition": { "ContentType": { "c_type": "inline", @@ -159,6 +159,7 @@ Birds of a feather flock together. } } }, + "is_encoding_problem": false, "body": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n\r" } } diff --git a/tests/legacy/043.txt b/tests/legacy/043.txt index d36dea5..3062bd5 100644 --- a/tests/legacy/043.txt +++ b/tests/legacy/043.txt @@ -60,27 +60,26 @@ als wir." --------------9D454F23DA86BCD63FA3805F-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "mime_version": { - "Text": "1.0" - }, "from": { "Address": { "name": "Doug Sauder", "address": "dwsauder@example.com" } }, + "subject": { + "Text": "Die Hasen und die Frösche (Netscape Communicator 4.7)" + }, + "mime_version": { + "Text": "1.0" + }, "to": { "Address": { "name": "Heinz Müller", "address": "mueller@example.com" } }, - "subject": { - "Text": "Die Hasen und die Frösche (Netscape Communicator 4.7)" - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -117,7 +116,10 @@ als wir." "parts": [ { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, "content_type": { "ContentType": { "c_type": "text", @@ -126,17 +128,18 @@ als wir." "charset": "iso-8859-1" } } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n" } }, { "Html": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "7bit" + }, "content_type": { "ContentType": { "c_type": "text", @@ -145,11 +148,9 @@ als wir." "charset": "us-ascii" } } - }, - "content_transfer_encoding": { - "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\n\r\nDie Hasen und die Frösche\r\n

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

In einem nahen Teich wollten sie sich nun ersäufen; sie eilten\r\nihm zu; allein das außerordentliche Getöse und ihre wunderbare\r\nGestalt erschreckte eine Menge Frösche, die am Ufer saßen, so\r\nsehr, daß sie aufs schnellste untertauchten.\r\n

\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen\r\nnoch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch unglücklicher sein müssen\r\nals wir.\"\r\n
 \r\n
 \r\n\r" } } diff --git a/tests/legacy/044.txt b/tests/legacy/044.txt index fec00d9..4c53cfe 100644 --- a/tests/legacy/044.txt +++ b/tests/legacy/044.txt @@ -136,9 +136,29 @@ xW62p+lT+Yi747sD/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBi eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= --------------A1FCDEE154E03D875E5D6779-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "subject": { + "Text": "Test message from Netscape Communicator 4.7" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "------------A1FCDEE154E03D875E5D6779" + } + } + }, + "message_id": { + "Text": "39235E1C.1DC7EA90@example.com" + }, "date": { "DateTime": { "year": 2000, @@ -152,35 +172,14 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "tz_minute": 0 } }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "------------A1FCDEE154E03D875E5D6779" - } - } + "mime_version": { + "Text": "1.0" }, "to": { "Address": { "name": "Joe Blow", "address": "blow@example.com" } - }, - "mime_version": { - "Text": "1.0" - }, - "subject": { - "Text": "Test message from Netscape Communicator 4.7" - }, - "message_id": { - "Text": "39235E1C.1DC7EA90@example.com" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } } }, "html_body": [ @@ -203,10 +202,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "parts": [ { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -215,14 +211,27 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "charset": "iso-8859-1" } } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n" } }, { "InlineBinary": { - "headers": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": { + "name": "redball.png" + } + } + }, "content_transfer_encoding": { "Text": "base64" }, @@ -234,17 +243,9 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "filename": "redball.png" } } - }, - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": { - "name": "redball.png" - } - } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1704,7 +1705,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "inline", @@ -1727,6 +1728,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -3031,16 +3033,7 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "InlineBinary": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "png", - "attributes": { - "name": "blueball.png" - } - } - }, + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "inline", @@ -3050,10 +3043,20 @@ eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "png", + "attributes": { + "name": "blueball.png" + } + } + }, "content_transfer_encoding": { "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/045.txt b/tests/legacy/045.txt index cf473ff..5015d48 100644 --- a/tests/legacy/045.txt +++ b/tests/legacy/045.txt @@ -41,12 +41,8 @@ LCBlaW5pZ2UgVGllcmUsIHdlbGNoZSBhbHNvIHdvaGwgbm9jaCB1bmds/GNr bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo= ---1463757054-891160829-958746372=:8452-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "message_id": { - "Text": "Pine.LNX.4.21.0005191024380.8452-200000@penguin.example.com" - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -56,25 +52,9 @@ bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo= } } }, - "date": { - "DateTime": { - "year": 2000, - "month": 5, - "day": 19, - "hour": 10, - "minute": 26, - "second": 12, - "tz_before_gmt": true, - "tz_hour": 4, - "tz_minute": 0 - } - }, "subject": { "Text": "Die Hasen und die Frösche" }, - "mime_version": { - "Text": "1.0" - }, "to": { "AddressList": [ { @@ -92,6 +72,25 @@ bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo= "name": "Doug Sauder", "address": "doug@penguin.example.com" } + }, + "date": { + "DateTime": { + "year": 2000, + "month": 5, + "day": 19, + "hour": 10, + "minute": 26, + "second": 12, + "tz_before_gmt": true, + "tz_hour": 4, + "tz_minute": 0 + } + }, + "message_id": { + "Text": "Pine.LNX.4.21.0005191024380.8452-200000@penguin.example.com" + }, + "mime_version": { + "Text": "1.0" } }, "html_body": [ @@ -106,7 +105,7 @@ bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo= "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -117,12 +116,23 @@ bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo= } } }, + "is_encoding_problem": false, "body": "\r" } }, { "Text": { - "headers": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1", + "name": "HasenundFrösche.txt" + } + } + }, "content_disposition": { "ContentType": { "c_type": "attachment", @@ -135,16 +145,6 @@ bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo= "content_transfer_encoding": { "Text": "BASE64" }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "name": "HasenundFrösche.txt", - "charset": "iso-8859-1" - } - } - }, "content_id": { "Text": "Pine.LNX.4.21.0005191026120.8452@penguin.example.com" }, @@ -152,6 +152,7 @@ bGljaGVyIHNlaW4gbfxzc2VuIGFscyB3aXIuIiANDQoNDQo= "Text": "Short story in German" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\r\r\n\r\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\r\n\r\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\r\n\r\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\r\n\r\r\n" } } diff --git a/tests/legacy/046.txt b/tests/legacy/046.txt index 1b2c650..8b2df07 100644 --- a/tests/legacy/046.txt +++ b/tests/legacy/046.txt @@ -31,8 +31,7 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "date": { "DateTime": { @@ -47,11 +46,14 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "tz_minute": 0 } }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } + "message_id": { + "Text": "3923561C.B7078DEF@example.com" + }, + "subject": { + "Text": "Die Hasen und die Frösche (Netscape Communicator 4.7)" + }, + "mime_version": { + "Text": "1.0" }, "to": { "Address": { @@ -59,26 +61,11 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "address": "schmuergen@example.com" } }, - "mime_version": { - "Text": "1.0" - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "iso-8859-1" - } + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" } - }, - "message_id": { - "Text": "3923561C.B7078DEF@example.com" - }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, - "subject": { - "Text": "Die Hasen und die Frösche (Netscape Communicator 4.7)" } }, "html_body": [ @@ -91,7 +78,21 @@ welche also wohl noch ungl=FCcklicher sein m=FCssen als wir." "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "iso-8859-1" + } + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n" } } diff --git a/tests/legacy/047.txt b/tests/legacy/047.txt index 9a0b326..2153c91 100644 --- a/tests/legacy/047.txt +++ b/tests/legacy/047.txt @@ -59,27 +59,11 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= --------------CA611088711119FBDB3473B4-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "mime_version": { "Text": "1.0" }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, - "to": { - "Address": { - "name": "Joe Blow", - "address": "blow@example.com" - } - }, - "message_id": { - "Text": "392367BC.3D075C95@example.com" - }, "date": { "DateTime": { "year": 2000, @@ -96,6 +80,21 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= "subject": { "Text": "Test message from Netscape Communicator 4.7" }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "message_id": { + "Text": "392367BC.3D075C95@example.com" + }, + "to": { + "Address": { + "name": "Joe Blow", + "address": "blow@example.com" + } + }, "content_type": { "ContentType": { "c_type": "multipart", @@ -118,7 +117,7 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -132,12 +131,16 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r" } }, { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, "content_type": { "ContentType": { "c_type": "text", @@ -156,11 +159,9 @@ n wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere= "filename": "HasenundFrösche.txt" } } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n" } } diff --git a/tests/legacy/048.txt b/tests/legacy/048.txt index 9d12290..071ef27 100644 --- a/tests/legacy/048.txt +++ b/tests/legacy/048.txt @@ -154,39 +154,8 @@ end --------------177483472E7788F4AD46AB1A-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "to": { - "Address": { - "name": "Joe Blow", - "address": "blow@example.com" - } - }, - "subject": { - "Text": "Test message from Netscape Communicator 4.7" - }, - "message_id": { - "Text": "3923670C.67D83A99@example.com" - }, - "mime_version": { - "Text": "1.0" - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "------------177483472E7788F4AD46AB1A" - } - } - }, "date": { "DateTime": { "year": 2000, @@ -199,6 +168,36 @@ end "tz_hour": 4, "tz_minute": 0 } + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "message_id": { + "Text": "3923670C.67D83A99@example.com" + }, + "mime_version": { + "Text": "1.0" + }, + "to": { + "Address": { + "name": "Joe Blow", + "address": "blow@example.com" + } + }, + "subject": { + "Text": "Test message from Netscape Communicator 4.7" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "------------177483472E7788F4AD46AB1A" + } + } } }, "html_body": [ @@ -221,7 +220,7 @@ end "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -235,12 +234,13 @@ end "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r" } }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -263,6 +263,7 @@ end } } }, + "is_encoding_problem": false, "body": [ 98, 101, @@ -2337,15 +2338,9 @@ end }, { "InlineBinary": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "greenball.png" - } - } + "headers_rfc": { + "content_transfer_encoding": { + "Text": "x-uuencode" }, "content_type": { "ContentType": { @@ -2356,10 +2351,17 @@ end } } }, - "content_transfer_encoding": { - "Text": "x-uuencode" + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "greenball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 98, 101, @@ -4216,10 +4218,7 @@ end }, { "InlineBinary": { - "headers": { - "content_transfer_encoding": { - "Text": "x-uuencode" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -4237,8 +4236,12 @@ end "filename": "blueball.png" } } + }, + "content_transfer_encoding": { + "Text": "x-uuencode" } }, + "is_encoding_problem": false, "body": [ 98, 101, diff --git a/tests/legacy/049.txt b/tests/legacy/049.txt index 983a727..ea93f05 100644 --- a/tests/legacy/049.txt +++ b/tests/legacy/049.txt @@ -129,18 +129,11 @@ M)71%6'1#;VUM96YT`&-L:7 R9VEF('8N,"XV(&)Y(%EV97,@4&EG=65T-G,[ -O ````!)14Y$KD)@@@`` ` end - ----- EXPECTED STRUCTURE ---- -{ + +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "from": { - "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" - } - }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGIEKGCHAA.doug@example.com" + "subject": { + "Text": "Test message from Microsoft Outlook 00" }, "date": { "DateTime": { @@ -155,14 +148,20 @@ end "tz_minute": 0 } }, + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGIEKGCHAA.doug@example.com" + }, "to": { "Address": { "name": "Joe Blow", "address": "jblow@example.com" } }, - "subject": { - "Text": "Test message from Microsoft Outlook 00" + "from": { + "Address": { + "name": "Doug Sauder", + "address": "doug@example.com" + } } }, "html_body": [ @@ -175,8 +174,17 @@ end "parts": [ { "Text": { - "headers": {}, - "body": "\r\nThe Hare and the Tortoise\r\n\r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who\r\nreplied, laughing: \"Though you be swift as the wind, I will beat you in a\r\nrace.\" The Hare, believing her assertion to be simply impossible, assented\r\nto the proposal; and they agreed that the Fox should choose the course and\r\nfix the goal. On the day appointed for the race the two started together.\r\nThe Tortoise never for a moment stopped, but went on with a slow but steady\r\npace straight to the end of the course. The Hare, lying down by the\r\nwayside, fell fast asleep. At last waking up, and moving as fast as he\r\ncould, he saw the Tortoise had reached the goal, and was comfortably dozing\r\nafter her fatigue.\r\n\r\nSlow but steady wins the race.\r\n\r\n\r\nbegin 666 blueball.png\r\nMB5!.1PT*&@H````-24A$4@```!L````;\" ,```\"Z\"@1G```#`%!,5$7___\\`\r\nM``@``! ``!@`````\"\"D`$$(`$$H`\"#$`$%(((7,(*7L(*80((6L`&%H`\"#D(\r\nM(6,0.9P80J480JT80K40.:40,90`&%(0,8PI4K4Y8\\8Y8\\XI6LX82LX80LX8\r\nM0KU\":\\9[G-:\\ZMSMZESN]:C.\\0,9Q:A-:MUN?.[^^,O>]*>^\\8.:482L:,\r\nMO>>UY^^4O>\\``\"E:C.=SI>]KG.\\(*8PQ8^\\I6N\\((7L`````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM``````````````````````````````````````````````````````````#!\r\nM,@U5`````7123E,`0.;89@```!9T15AT4V]F='=AOF@```&(241!5'B<==)M5YLP& ;@$DZ )A!2DX;,\"4RG!2+:JHO;K&_;\r\nM?/G_ORA[TE;LL<>;+YQSG3LAY!F-A@0H1\"APHYT$.(HA48+#CXS'A*80DK$H\r\nM0=OHT(*,54I*9+0#>J23(LO^U\\/RJJ64PV(!L1,[WT[//I^?#)K6MGI\r\nM+#)O>P8QG>P?GO:G9^?SIFP7BC\"\\*;J$:W%QV??]U8]Y4]7\"4I:#>0PB,I'7\r\nM/_O^U^^;65/60H&%:PMCNKR]OKN_?_\"U5B[>S3T66I0'?_[^N_&[U:+3A*_,\r\nMC1QF3Z*=S9]?&D]R:M,L3@9+EW75@%1 \"ZLIC_UW>GLLJ)5M65:W-=!2:<+\\\r\nM^59F8J*F==U\"28H.B,.2&PMSEJJE%%(N.JOT:U9$9K4D6(\"++%6VZZRU*O6$\r\nMUS5_B# 'U$HIG5+\"BR@9\"(HF'W-\"*7TEG(^!UBNNS\"&3QP7CG#.X=[-I;7XV\r\nM8))'D!PF`FV3QP`9@XT)W^7M;OUK@. 9P&T-Q6ZVI^E3^8B[X[L#_P$45,S8\r\nMF6D.OP```\"5T15AT0V]M;65N= !C;&EP,F=I9B!V+C N-B!B>2!9=F5S(%!I\r\n49W5E=#9S.[P`````245.1*Y\"8((`\r\n`\r\nend\r\n\r\nbegin 666 greenball.png\r\nMB5!.1PT*&@H````-24A$4@```!L````;\" ,```\"Z\"@1G```#`%!,5$7___\\`\r\nM````$ ``& ``(0``\" ``,0``0@``4@``6@``2@`(8P`(P`0C `(:P``\r\nM.0``8P`0E `0G `AI0`0I0`AK0!\"O1ACQC%CQCE2QB$IS@`8O0`0K0`8K0`A\r\nMO0\"4UF.MUGN$UE)*WA@AU@`8Q@`8M0``*0!\"SA#.YY3>YZW&YY24YV-2YR$A\r\nMW@`8S@!2WB&KRU;5>]/60`]SX,0^'\\8HC[&`29]Y('?:!&F+.2<\r\nMAR(@R.NVVF@02C4<#N-8#:LMN[^]G#XU-FDB)VC_PW8#K614(E9K+_6\\Z7)DR)5\r\nM&]$:$C(QV7R9F9)&BH>4:+^V`8\\38\\HF1ZGD+*AN[TSC4*5)7LIWJN2V#52)\r\nM6-AWSS)*\"R>Q(T9Q!/W:?$T$ERJ.E9)RP\\KW!$V2%B)\"RQ XWX2\"D@ZY1A=>\r\nM0!EC0M\"@W]+6K ]T1##&U$6K84.VWA,`-4*11EZU$YV]<1^^#V&Y+*TTV=K_\r\nMJK>-T@@L+ ```\"5T15AT0V]M;65N= !C;&EP,F=I\r\nF9B!V+C N-B!B>2!9=F5S(%!I9W5E=#9S.[P`````245.1*Y\"8((`\r\n`\r\nend\r\n\r\nbegin 666 redball.png\r\nMB5!.1PT*&@H````-24A$4@```!L````;\" ,```\"Z\"@1G```#`%!,5$7___\\`\r\nM```!```+```5```:```7```1```*```#```<```R``!$``!-``!(```]```C\r\nM```6```F``!A``![``\"&``\"'``!]``!T``!@```Y```4```&```G``!+``!O\r\nM``\"0``\"E``\"[``\"_``\"K``\"A``\",``!S``!;```N```(``!,``!W``\"9``\"T\r\nM&1G*.#C5/3W;*2G=!06X``\"H``!Y```Q```8```$``!%``\":``\"[)\"3186'?\r\nMA(3F?W_F5E;J'Q_2``\"Y``\"C``!=``!\"```H```)``!G``\"Z#P_05%3>DY/E\r\nMK*SIF9GM967O)277``#!``\"Q``\"<``!M``!3```V```;```%``!*``\"!``#+\r\nM(\"#=9V?HG)SKIJ;MBHKO45'O%!31``##``\"V``!X``!>``! ```B``!7``\"2\r\nM``#\"``#:&QOH557L>'CO>'CO5U?O)B;A``#.``\"W``\"G``\"5``!'```K```/\r\nM``\"=``#%``#A!07K*\"CO/#SO-37O&QOC``#0``#)``\"U``\"7``\"$``!L``!/\r\nM```2```\"``!B``#I``#O`@+G``#8``#+``\"Z``\"P``!P```3```D``!8``#(\r\nM``#3``#-``\"S``\"#``!N```>``!^``# ``\"D``\"-``!_``!I``!0```P``\"1\r\nM``\"I``\"\\``\"J``\";``!E``!)```J```.```T``\"L``\"O``\"M``\"F``\")``!Z\r\nM``!K``!:```^```I``!J``\"\"``\"?``\">``\"6``\"/``!\\```9```'``!5``\".\r\nM``\"*```X```0```_``!R``\" ``!<```W```L``!F``!#``!6```@```S```\\\r\nM```Z```?```,```=```-````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM``````````````````````````````````````````````````````````#\\\r\nM+ME%`````7123E,`0.;89@```!9T15AT4V]F='=AOF@```((241!5'B<8V\" @_\\0P( !F)A96%G9V#DX,:4YN+AY>'GY^+D%\r\nM!#E0)?\\S\"_$(BXB*B4M(\\DH)2?D%A47%R26E9E$=Y1258[C^3D&15=4UM77U#8U.SJWW[10_(IZTQ.W@($E7_+;BD#F\\3WZ*P;-F1H[.WSI'D/29P'!J+__\\?\r\nMESUQV..DR*)3B[:J;SNM?49(V@(N%\\%VEK_#Y=PV^?9=PIE\\85.E(^\")X_]_\r\nMCH.R8>=Y0S,OA&JGFV5T6B\"EF___#TE?7'M)ZO+E*]P[KQ[O0DY20);%M2FL\r\nMUR]>O7B=[09:<@.QF2QDM-S=M2PP4^)_5(\":\"/%(84W7`)A(.MC?YL?R````\r\nM)71%6'1#;VUM96YT`&-L:7 R9VEF('8N,\"XV(&)Y(%EV97,@4&EG=65T-G,[\r\n-O ````!)14Y$KD)@@@``\r\n`\r\nend\r\n" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, + "body": "\r\nThe Hare and the Tortoise\r\n\r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who\r\nreplied, laughing: \"Though you be swift as the wind, I will beat you in a\r\nrace.\" The Hare, believing her assertion to be simply impossible, assented\r\nto the proposal; and they agreed that the Fox should choose the course and\r\nfix the goal. On the day appointed for the race the two started together.\r\nThe Tortoise never for a moment stopped, but went on with a slow but steady\r\npace straight to the end of the course. The Hare, lying down by the\r\nwayside, fell fast asleep. At last waking up, and moving as fast as he\r\ncould, he saw the Tortoise had reached the goal, and was comfortably dozing\r\nafter her fatigue.\r\n\r\nSlow but steady wins the race.\r\n\r\n\r\nbegin 666 blueball.png\r\nMB5!.1PT*&@H````-24A$4@```!L````;\" ,```\"Z\"@1G```#`%!,5$7___\\`\r\nM``@``! ``!@`````\"\"D`$$(`$$H`\"#$`$%(((7,(*7L(*80((6L`&%H`\"#D(\r\nM(6,0.9P80J480JT80K40.:40,90`&%(0,8PI4K4Y8\\8Y8\\XI6LX82LX80LX8\r\nM0KU\":\\9[G-:\\ZMSMZESN]:C.\\0,9Q:A-:MUN?.[^^,O>]*>^\\8.:482L:,\r\nMO>>UY^^4O>\\``\"E:C.=SI>]KG.\\(*8PQ8^\\I6N\\((7L`````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM``````````````````````````````````````````````````````````#!\r\nM,@U5`````7123E,`0.;89@```!9T15AT4V]F='=AOF@```&(241!5'B<==)M5YLP& ;@$DZ )A!2DX;,\"4RG!2+:JHO;K&_;\r\nM?/G_ORA[TE;LL<>;+YQSG3LAY!F-A@0H1\"APHYT$.(HA48+#CXS'A*80DK$H\r\nM0=OHT(*,54I*9+0#>J23(LO^U\\/RJJ64PV(!L1,[WT[//I^?#)K6MGI\r\nM+#)O>P8QG>P?GO:G9^?SIFP7BC\"\\*;J$:W%QV??]U8]Y4]7\"4I:#>0PB,I'7\r\nM/_O^U^^;65/60H&%:PMCNKR]OKN_?_\"U5B[>S3T66I0'?_[^N_&[U:+3A*_,\r\nMC1QF3Z*=S9]?&D]R:M,L3@9+EW75@%1 \"ZLIC_UW>GLLJ)5M65:W-=!2:<+\\\r\nM^59F8J*F==U\"28H.B,.2&PMSEJJE%%(N.JOT:U9$9K4D6(\"++%6VZZRU*O6$\r\nMUS5_B# 'U$HIG5+\"BR@9\"(HF'W-\"*7TEG(^!UBNNS\"&3QP7CG#.X=[-I;7XV\r\nM8))'D!PF`FV3QP`9@XT)W^7M;OUK@. 9P&T-Q6ZVI^E3^8B[X[L#_P$45,S8\r\nMF6D.OP```\"5T15AT0V]M;65N= !C;&EP,F=I9B!V+C N-B!B>2!9=F5S(%!I\r\n49W5E=#9S.[P`````245.1*Y\"8((`\r\n`\r\nend\r\n\r\nbegin 666 greenball.png\r\nMB5!.1PT*&@H````-24A$4@```!L````;\" ,```\"Z\"@1G```#`%!,5$7___\\`\r\nM````$ ``& ``(0``\" ``,0``0@``4@``6@``2@`(8P`(P`0C `(:P``\r\nM.0``8P`0E `0G `AI0`0I0`AK0!\"O1ACQC%CQCE2QB$IS@`8O0`0K0`8K0`A\r\nMO0\"4UF.MUGN$UE)*WA@AU@`8Q@`8M0``*0!\"SA#.YY3>YZW&YY24YV-2YR$A\r\nMW@`8S@!2WB&KRU;5>]/60`]SX,0^'\\8HC[&`29]Y('?:!&F+.2<\r\nMAR(@R.NVVF@02C4<#N-8#:LMN[^]G#XU-FDB)VC_PW8#K614(E9K+_6\\Z7)DR)5\r\nM&]$:$C(QV7R9F9)&BH>4:+^V`8\\38\\HF1ZGD+*AN[TSC4*5)7LIWJN2V#52)\r\nM6-AWSS)*\"R>Q(T9Q!/W:?$T$ERJ.E9)RP\\KW!$V2%B)\"RQ XWX2\"D@ZY1A=>\r\nM0!EC0M\"@W]+6K ]T1##&U$6K84.VWA,`-4*11EZU$YV]<1^^#V&Y+*TTV=K_\r\nMJK>-T@@L+ ```\"5T15AT0V]M;65N= !C;&EP,F=I\r\nF9B!V+C N-B!B>2!9=F5S(%!I9W5E=#9S.[P`````245.1*Y\"8((`\r\n`\r\nend\r\n\r\nbegin 666 redball.png\r\nMB5!.1PT*&@H````-24A$4@```!L````;\" ,```\"Z\"@1G```#`%!,5$7___\\`\r\nM```!```+```5```:```7```1```*```#```<```R``!$``!-``!(```]```C\r\nM```6```F``!A``![``\"&``\"'``!]``!T``!@```Y```4```&```G``!+``!O\r\nM``\"0``\"E``\"[``\"_``\"K``\"A``\",``!S``!;```N```(``!,``!W``\"9``\"T\r\nM&1G*.#C5/3W;*2G=!06X``\"H``!Y```Q```8```$``!%``\":``\"[)\"3186'?\r\nMA(3F?W_F5E;J'Q_2``\"Y``\"C``!=``!\"```H```)``!G``\"Z#P_05%3>DY/E\r\nMK*SIF9GM967O)277``#!``\"Q``\"<``!M``!3```V```;```%``!*``\"!``#+\r\nM(\"#=9V?HG)SKIJ;MBHKO45'O%!31``##``\"V``!X``!>``! ```B``!7``\"2\r\nM``#\"``#:&QOH557L>'CO>'CO5U?O)B;A``#.``\"W``\"G``\"5``!'```K```/\r\nM``\"=``#%``#A!07K*\"CO/#SO-37O&QOC``#0``#)``\"U``\"7``\"$``!L``!/\r\nM```2```\"``!B``#I``#O`@+G``#8``#+``\"Z``\"P``!P```3```D``!8``#(\r\nM``#3``#-``\"S``\"#``!N```>``!^``# ``\"D``\"-``!_``!I``!0```P``\"1\r\nM``\"I``\"\\``\"J``\";``!E``!)```J```.```T``\"L``\"O``\"M``\"F``\")``!Z\r\nM``!K``!:```^```I``!J``\"\"``\"?``\">``\"6``\"/``!\\```9```'``!5``\".\r\nM``\"*```X```0```_``!R``\" ``!<```W```L``!F``!#``!6```@```S```\\\r\nM```Z```?```,```=```-````````````````````````````````````````\r\nM````````````````````````````````````````````````````````````\r\nM``````````````````````````````````````````````````````````#\\\r\nM+ME%`````7123E,`0.;89@```!9T15AT4V]F='=AOF@```((241!5'B<8V\" @_\\0P( !F)A96%G9V#DX,:4YN+AY>'GY^+D%\r\nM!#E0)?\\S\"_$(BXB*B4M(\\DH)2?D%A47%R26E9E$=Y1258[C^3D&15=4UM77U#8U.SJWW[10_(IZTQ.W@($E7_+;BD#F\\3WZ*P;-F1H[.WSI'D/29P'!J+__\\?\r\nMESUQV..DR*)3B[:J;SNM?49(V@(N%\\%VEK_#Y=PV^?9=PIE\\85.E(^\")X_]_\r\nMCH.R8>=Y0S,OA&JGFV5T6B\"EF___#TE?7'M)ZO+E*]P[KQ[O0DY20);%M2FL\r\nMUR]>O7B=[09:<@.QF2QDM-S=M2PP4^)_5(\":\"/%(84W7`)A(.MC?YL?R````\r\nM)71%6'1#;VUM96YT`&-L:7 R9VEF('8N,\"XV(&)Y(%EV97,@4&EG=65T-G,[\r\n-O ````!)14Y$KD)@@@``\r\n`\r\nend\r\n\r" } } ], @@ -185,5 +193,5 @@ end }, "offset_header": 0, "offset_body": 420, - "offset_end": 7001 + "offset_end": 7002 } \ No newline at end of file diff --git a/tests/legacy/050.txt b/tests/legacy/050.txt index 6c433d6..b41e921 100644 --- a/tests/legacy/050.txt +++ b/tests/legacy/050.txt @@ -108,26 +108,19 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== --=====================_715546120==_.REL-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "message_id": { - "Text": "4.2.0.58.20000519003934.00a866f0@pop.example.com" - }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, - "mime_version": { - "Text": "1.0" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "related", - "attributes": { - "type": "text/html", - "boundary": "=====================_715546120==_.REL" - } + "date": { + "DateTime": { + "year": 2000, + "month": 5, + "day": 19, + "hour": 0, + "minute": 39, + "second": 36, + "tz_before_gmt": true, + "tz_hour": 4, + "tz_minute": 0 } }, "from": { @@ -142,18 +135,24 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "address": "mueller@example.com" } }, - "date": { - "DateTime": { - "year": 2000, - "month": 5, - "day": 19, - "hour": 0, - "minute": 39, - "second": 36, - "tz_before_gmt": true, - "tz_hour": 4, - "tz_minute": 0 + "mime_version": { + "Text": "1.0" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": { + "type": "text/html", + "boundary": "=====================_715546120==_.REL" + } } + }, + "subject": { + "Text": "Die Hasen und die Frösche" + }, + "message_id": { + "Text": "4.2.0.58.20000519003934.00a866f0@pop.example.com" } }, "html_body": [ @@ -169,7 +168,7 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "parts": [ { "Html": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -183,21 +182,13 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "\n\"2aa658b6.png\"
\n
\nDie Hasen und die\nFrösche
\n
\n
Die Hasen klagten einst über\nihre mißliche Lage; "wir leben", sprach ein Redner, "in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben."
\n
\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.
\n
\n"Halt", rief nun eben dieser Sprecher, "wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir."
\n
\n\"2aa658c0.png\"
\n" } }, { "Binary": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "2aa658b6.png" - } - } - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -207,13 +198,23 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== } } }, - "content_transfer_encoding": { - "Text": "base64" - }, "content_id": { "Text": "4.2.0.58.20000519003934.00a866f0@pop.example.com.2" + }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "2aa658b6.png" + } + } + }, + "content_transfer_encoding": { + "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1545,10 +1546,22 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== }, { "Binary": { - "headers": { + "headers_rfc": { + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "2aa658c0.png" + } + } + }, "content_transfer_encoding": { "Text": "base64" }, + "content_id": { + "Text": "4.2.0.58.20000519003934.00a866f0@pop.example.com.3" + }, "content_type": { "ContentType": { "c_type": "image", @@ -1557,20 +1570,9 @@ IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg== "name": "2aa658c0.png" } } - }, - "content_id": { - "Text": "4.2.0.58.20000519003934.00a866f0@pop.example.com.3" - }, - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "2aa658c0.png" - } - } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/051.txt b/tests/legacy/051.txt index a903e36..bf77c05 100644 --- a/tests/legacy/051.txt +++ b/tests/legacy/051.txt @@ -160,15 +160,8 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= --=====================_715515186==_-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "from": { - "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" - } - }, "date": { "DateTime": { "year": 2000, @@ -182,18 +175,6 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "tz_minute": 0 } }, - "subject": { - "Text": "Die Hasen und die Frösche" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "=====================_715515186==_" - } - } - }, "message_id": { "Text": "4.2.0.58.20000519003903.00a859b0@pop.example.com" }, @@ -203,8 +184,26 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "address": "mueller@example.com" } }, + "subject": { + "Text": "Die Hasen und die Frösche" + }, "mime_version": { "Text": "1.0" + }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "=====================_715515186==_" + } + } } }, "html_body": [ @@ -222,13 +221,15 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "related", - "attributes": { - "type": "text/plain", - "boundary": "=====================_715515186==_.REL" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": { + "boundary": "=====================_715515186==_.REL", + "type": "text/plain" + } } } } @@ -236,7 +237,10 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "quoted-printable" + }, "content_type": { "ContentType": { "c_type": "text", @@ -245,25 +249,17 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "charset": "iso-8859-1" } } - }, - "content_transfer_encoding": { - "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n2aa5e03a.png2aa5e044.png" } }, { "Binary": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": { - "filename": "2aa5e03a.png" - } - } + "headers_rfc": { + "content_id": { + "Text": "4.2.0.58.20000519003903.00a859b0@pop.example.com.2" }, "content_type": { "ContentType": { @@ -274,13 +270,20 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": { + "filename": "2aa5e03a.png" + } + } + }, "content_transfer_encoding": { "Text": "base64" - }, - "content_id": { - "Text": "4.2.0.58.20000519003903.00a859b0@pop.example.com.2" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -1612,13 +1615,7 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { - "content_id": { - "Text": "4.2.0.58.20000519003903.00a859b0@pop.example.com.3" - }, - "content_transfer_encoding": { - "Text": "base64" - }, + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "inline", @@ -1636,8 +1633,15 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "name": "2aa5e044.png" } } + }, + "content_id": { + "Text": "4.2.0.58.20000519003903.00a859b0@pop.example.com.3" + }, + "content_transfer_encoding": { + "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -3097,7 +3101,7 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", @@ -3107,6 +3111,9 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= } } }, + "content_transfer_encoding": { + "Text": "base64" + }, "content_type": { "ContentType": { "c_type": "image", @@ -3115,11 +3122,9 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "name": "blueball.png" } } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 137, 80, @@ -4451,19 +4456,10 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= }, { "Binary": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "base64" }, - "content_disposition": { - "ContentType": { - "c_type": "attachment", - "c_subtype": null, - "attributes": { - "filename": "greenball.png" - } - } - }, "content_type": { "ContentType": { "c_type": "image", @@ -4472,8 +4468,18 @@ bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII= "name": "greenball.png" } } + }, + "content_disposition": { + "ContentType": { + "c_type": "attachment", + "c_subtype": null, + "attributes": { + "filename": "greenball.png" + } + } } }, + "is_encoding_problem": false, "body": [ 137, 80, diff --git a/tests/legacy/052.txt b/tests/legacy/052.txt index 6a3af50..07bcfcb 100644 --- a/tests/legacy/052.txt +++ b/tests/legacy/052.txt @@ -26,9 +26,11 @@ wenig aufschieben, denn auch uns f welche also wohl noch unglücklicher sein müssen als wir." ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "subject": { + "Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)" + }, "date": { "DateTime": { "year": 2000, @@ -42,6 +44,9 @@ welche also wohl noch ungl "tz_minute": 0 } }, + "message_id": { + "Text": "NDBBIAKOPKHFGPLCODIGOEKDCHAA.doug@example.com" + }, "from": { "Address": { "name": "Doug Sauder", @@ -53,12 +58,6 @@ welche also wohl noch ungl "name": "Heinz M�ller", "address": "mueller@example.com" } - }, - "subject": { - "Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)" - }, - "message_id": { - "Text": "NDBBIAKOPKHFGPLCODIGOEKDCHAA.doug@example.com" } }, "html_body": [ @@ -71,7 +70,16 @@ welche also wohl noch ungl "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Fr�sche\r\n\r\nDie Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der Tod\r\nselbst. Auf, la�t uns ein f�r allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;\r\nallein das au�erordentliche Get�se und ihre wunderbare Gestalt erschreckte\r\neine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein\r\nwenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch ungl�cklicher sein m�ssen als wir.\"\r\n\r\n" } } diff --git a/tests/legacy/053.txt b/tests/legacy/053.txt index 9e849f5..14cb35c 100644 --- a/tests/legacy/053.txt +++ b/tests/legacy/053.txt @@ -31,12 +31,23 @@ noch ein wenig aufschieben, denn auch uns f=C3=BCrchten, wie ihr seht, = einige Tiere, welche also wohl noch ungl=C3=BCcklicher sein m=C3=BCssen = als wir."=20 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "mime_version": { "Text": "1.0" }, + "from": { + "Address": { + "name": "Doug Sauder", + "address": "doug@example.com" + } + }, + "to": { + "Address": { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + }, "date": { "DateTime": { "year": 2000, @@ -50,33 +61,9 @@ als wir."=20 "tz_minute": 0 } }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "utf-8" - } - } - }, "subject": { "Text": "Die Hasen und die Frösche (Microsoft Outlook 00)" }, - "content_transfer_encoding": { - "Text": "quoted-printable" - }, - "to": { - "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - }, - "from": { - "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" - } - }, "message_id": { "Text": "NDBBIAKOPKHFGPLCODIGKEKDCHAA.doug@example.com" } @@ -91,7 +78,21 @@ als wir."=20 "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "utf-8" + } + } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" + } + }, + "is_encoding_problem": false, "body": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n" } } diff --git a/tests/malformed/000.txt b/tests/malformed/000.txt index 1850c03..cb5f5d2 100644 --- a/tests/malformed/000.txt +++ b/tests/malformed/000.txt @@ -9,8 +9,7 @@ Content-Type: text/plain Content-Type: text/html --:foo-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { diff --git a/tests/malformed/001.txt b/tests/malformed/001.txt index fb38893..8797ad7 100644 --- a/tests/malformed/001.txt +++ b/tests/malformed/001.txt @@ -9,8 +9,7 @@ Content-Type: text/plain --a ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -32,12 +31,14 @@ Content-Type: text/plain "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "a" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "a" + } } } } @@ -45,7 +46,16 @@ Content-Type: text/plain }, { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "Content-Type: text/plain\n" } } diff --git a/tests/malformed/002.txt b/tests/malformed/002.txt index 1eef551..9265d2f 100644 --- a/tests/malformed/002.txt +++ b/tests/malformed/002.txt @@ -2,19 +2,8 @@ Content-Type: multipart/mixed; boundary="ab" body ----- EXPECTED STRUCTURE ---- -{ - "headers_rfc": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "ab" - } - } - } - }, +---- EXPECTED STRUCTURE ----{ + "headers_rfc": {}, "html_body": [], "text_body": [], "attachments": [ @@ -23,7 +12,18 @@ body "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "ab" + } + } + } + }, + "is_encoding_problem": false, "body": "body\n" } } diff --git a/tests/malformed/003.txt b/tests/malformed/003.txt index bd5bc4a..9935b8b 100644 --- a/tests/malformed/003.txt +++ b/tests/malformed/003.txt @@ -8,8 +8,7 @@ Content-Type: text/plain body ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -29,12 +28,14 @@ body "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "a" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "a" + } } } } @@ -42,7 +43,7 @@ body }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -51,6 +52,7 @@ body } } }, + "is_encoding_problem": true, "body": "body\n" } } diff --git a/tests/malformed/004.txt b/tests/malformed/004.txt index a699fff..4cb1a3a 100644 --- a/tests/malformed/004.txt +++ b/tests/malformed/004.txt @@ -8,8 +8,7 @@ Content-Type: text/plain body ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -29,7 +28,16 @@ body "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": true, "body": "Content-Type: multipart/mixed; boundary=\"a\"\n\n--ac\nContent-Type: text/plain\n\nbody\n" } } diff --git a/tests/malformed/005.txt b/tests/malformed/005.txt index 837c3fa..f00e4a9 100644 --- a/tests/malformed/005.txt +++ b/tests/malformed/005.txt @@ -12,8 +12,7 @@ Content-Type: text/html body2 --a---- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -35,12 +34,14 @@ body2 "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "a----" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "a----" + } } } } @@ -48,7 +49,7 @@ body2 }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -57,6 +58,7 @@ body2 } } }, + "is_encoding_problem": false, "body": "body" } } diff --git a/tests/malformed/006.txt b/tests/malformed/006.txt index 58820e7..db7d87c 100644 --- a/tests/malformed/006.txt +++ b/tests/malformed/006.txt @@ -8,8 +8,7 @@ Content-Type: text/plain body ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -29,12 +28,14 @@ body "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "ab" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "ab" + } } } } @@ -42,7 +43,7 @@ body }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -51,6 +52,7 @@ body } } }, + "is_encoding_problem": true, "body": "body\n" } } diff --git a/tests/malformed/007.txt b/tests/malformed/007.txt index 263b7e9..cba522d 100644 --- a/tests/malformed/007.txt +++ b/tests/malformed/007.txt @@ -10,8 +10,7 @@ Content-Type: text/plain --a-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -31,23 +30,34 @@ Content-Type: text/plain "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "ab" + "headers_rfc": { + "mime_version": { + "Text": "1.0" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "ab" + } } } - }, - "mime_version": { - "Text": "1.0" } } }, { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": true, "body": "--a--\n\n" } } diff --git a/tests/malformed/008.txt b/tests/malformed/008.txt index f8128ee..723d3ed 100644 --- a/tests/malformed/008.txt +++ b/tests/malformed/008.txt @@ -12,8 +12,7 @@ Content-Type: text/html body2 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -33,12 +32,14 @@ body2 "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "a" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "a" + } } } } @@ -46,7 +47,7 @@ body2 }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -55,6 +56,7 @@ body2 } } }, + "is_encoding_problem": true, "body": "body\n--ab\nContent-Type: text/html\n\nbody2\n" } } diff --git a/tests/malformed/009.txt b/tests/malformed/009.txt index 167bb7a..72aafcb 100644 --- a/tests/malformed/009.txt +++ b/tests/malformed/009.txt @@ -16,8 +16,7 @@ Content-Type: text/plain 333 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -41,12 +40,14 @@ Content-Type: text/plain "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "2" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "2" + } } } } @@ -54,7 +55,7 @@ Content-Type: text/plain }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -63,12 +64,13 @@ Content-Type: text/plain } } }, + "is_encoding_problem": false, "body": "1" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -77,6 +79,7 @@ Content-Type: text/plain } } }, + "is_encoding_problem": true, "body": "22\n--1\nContent-Type: text/plain\n\n333\n" } } diff --git a/tests/malformed/010.txt b/tests/malformed/010.txt index 1456f1d..92c43a0 100644 --- a/tests/malformed/010.txt +++ b/tests/malformed/010.txt @@ -6,8 +6,7 @@ Content-Type: text/plain 1 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -25,7 +24,7 @@ Content-Type: text/plain "parts": [ { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -34,6 +33,7 @@ Content-Type: text/plain } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { "content_type": { @@ -52,7 +52,7 @@ Content-Type: text/plain "parts": [ { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -61,16 +61,9 @@ Content-Type: text/plain } } }, + "is_encoding_problem": false, "body": { - "headers_rfc": { - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": null - } - } - }, + "headers_rfc": {}, "html_body": [ 0 ], @@ -81,7 +74,16 @@ Content-Type: text/plain "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "1\n" } } diff --git a/tests/malformed/011.txt b/tests/malformed/011.txt index 167bb7a..72aafcb 100644 --- a/tests/malformed/011.txt +++ b/tests/malformed/011.txt @@ -16,8 +16,7 @@ Content-Type: text/plain 333 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -41,12 +40,14 @@ Content-Type: text/plain "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "2" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "2" + } } } } @@ -54,7 +55,7 @@ Content-Type: text/plain }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -63,12 +64,13 @@ Content-Type: text/plain } } }, + "is_encoding_problem": false, "body": "1" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -77,6 +79,7 @@ Content-Type: text/plain } } }, + "is_encoding_problem": true, "body": "22\n--1\nContent-Type: text/plain\n\n333\n" } } diff --git a/tests/malformed/012.txt b/tests/malformed/012.txt index e63ce1d..bbce9e2 100644 --- a/tests/malformed/012.txt +++ b/tests/malformed/012.txt @@ -22,8 +22,7 @@ Content-Type: text/plain 333 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -44,12 +43,14 @@ Content-Type: text/plain "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "2" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "2" + } } } } @@ -57,7 +58,7 @@ Content-Type: text/plain }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -66,16 +67,9 @@ Content-Type: text/plain } } }, + "is_encoding_problem": false, "body": { - "headers_rfc": { - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": null - } - } - }, + "headers_rfc": {}, "html_body": [ 0 ], @@ -86,7 +80,16 @@ Content-Type: text/plain "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "1" } } @@ -102,7 +105,7 @@ Content-Type: text/plain }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -111,16 +114,9 @@ Content-Type: text/plain } } }, + "is_encoding_problem": false, "body": { - "headers_rfc": { - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": null - } - } - }, + "headers_rfc": {}, "html_body": [], "text_body": [], "attachments": [ @@ -129,7 +125,16 @@ Content-Type: text/plain "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": true, "body": "22\n--1\nContent-Type: message/rfc822\n\nContent-Type: text/plain\n\n333\n" } } diff --git a/tests/malformed/013.txt b/tests/malformed/013.txt index 299e660..7135197 100644 --- a/tests/malformed/013.txt +++ b/tests/malformed/013.txt @@ -31,8 +31,7 @@ Content-Type: text/plain hello, world --1 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "mime_version": { "Text": "1.0" @@ -63,7 +62,7 @@ hello, world "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -72,77 +71,23 @@ hello, world } } }, + "is_encoding_problem": false, "body": "hello, world" } }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "1" - } - } - }, - "mime_version": { - "Text": "2.0" - } - } - }, - { - "Text": { - "headers": { + "headers_rfc": { + "mime_version": { + "Text": "2.0" + }, "content_type": { "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": null - } - } - }, - "body": "hello, world" - } - }, - { - "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "1" - } - } - }, - "mime_version": { - "Text": "abc" - } - } - }, - { - "Text": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": null - } - } - }, - "body": "hello, world" - } - }, - { - "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "1" + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "1" + } } } } @@ -150,7 +95,7 @@ hello, world }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -159,6 +104,70 @@ hello, world } } }, + "is_encoding_problem": false, + "body": "hello, world" + } + }, + { + "Multipart": { + "headers_rfc": { + "mime_version": { + "Text": "abc" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "1" + } + } + } + } + } + }, + { + "Text": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, + "body": "hello, world" + } + }, + { + "Multipart": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "1" + } + } + } + } + } + }, + { + "Text": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "hello, world" } } diff --git a/tests/malformed/014.txt b/tests/malformed/014.txt index 03a04d6..5b54c3c 100644 --- a/tests/malformed/014.txt +++ b/tests/malformed/014.txt @@ -6,8 +6,7 @@ Content-Type: text/plain hello, world --1 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -29,7 +28,7 @@ hello, world "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -38,6 +37,7 @@ hello, world } } }, + "is_encoding_problem": false, "body": "hello, world" } } diff --git a/tests/malformed/015.txt b/tests/malformed/015.txt index 199ef94..0b5c871 100644 --- a/tests/malformed/015.txt +++ b/tests/malformed/015.txt @@ -24,38 +24,8 @@ invalid --=-GNQXLhuj24Pl1aCkk4/d-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "to": { - "Address": { - "name": "Another User", - "address": "test2@example.org" - } - }, - "message_id": { - "Text": "1.2.3.4@example" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "signed", - "attributes": { - "boundary": "=-GNQXLhuj24Pl1aCkk4/d", - "micalg": "pgp-sha1", - "protocol": "application/pgp-signature" - } - } - }, - "subject": { - "Text": "Hello world" - }, - "from": { - "Address": { - "name": "Test User", - "address": "test@example.org" - } - }, "date": { "DateTime": { "year": 2007, @@ -72,6 +42,35 @@ invalid "return_path": { "Text": "test@example.org" }, + "subject": { + "Text": "Hello world" + }, + "from": { + "Address": { + "name": "Test User", + "address": "test@example.org" + } + }, + "to": { + "Address": { + "name": "Another User", + "address": "test2@example.org" + } + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "signed", + "attributes": { + "boundary": "=-GNQXLhuj24Pl1aCkk4/d", + "protocol": "application/pgp-signature", + "micalg": "pgp-sha1" + } + } + }, + "message_id": { + "Text": "1.2.3.4@example" + }, "mime_version": { "Text": "1.0" } @@ -88,24 +87,25 @@ invalid "parts": [ { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "quoted-printable" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": null } + }, + "content_transfer_encoding": { + "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "There was a day \na happy day\n" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "application", @@ -116,6 +116,7 @@ invalid } } }, + "is_encoding_problem": false, "body": [ 105, 110, diff --git a/tests/malformed/016.txt b/tests/malformed/016.txt index fb96c81..e9beb4c 100644 --- a/tests/malformed/016.txt +++ b/tests/malformed/016.txt @@ -23,8 +23,7 @@ Content-Type: text/plain 4444 ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -48,12 +47,14 @@ Content-Type: text/plain "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "123456789012345678901234567890123456789012345678901234567890123456789012345678901" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "123456789012345678901234567890123456789012345678901234567890123456789012345678901" + } } } } @@ -61,12 +62,14 @@ Content-Type: text/plain }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + } } } } @@ -74,7 +77,7 @@ Content-Type: text/plain }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -83,12 +86,13 @@ Content-Type: text/plain } } }, + "is_encoding_problem": false, "body": "1\n--1234567890123456789012345678901234567890123456789012345678901234567890123456789012\nContent-Type: text/plain\n\n22\n--123456789012345678901234567890123456789012345678901234567890123456789012345678901\nContent-Type: text/plain\n\n333" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -97,6 +101,7 @@ Content-Type: text/plain } } }, + "is_encoding_problem": true, "body": "4444\n" } } diff --git a/tests/rfc/000.txt b/tests/rfc/000.txt index 98f533a..ae3b8a6 100644 --- a/tests/rfc/000.txt +++ b/tests/rfc/000.txt @@ -71,15 +71,20 @@ Content-Transfer-Encoding: Quoted-printable --unique-boundary-1-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "mime_version": { + "Text": "1.0" + }, "from": { "Address": { "name": "Nathaniel Borenstein", "address": "nsb@nsb.fv.com" } }, + "subject": { + "Text": "A multipart example" + }, "date": { "DateTime": { "year": 1994, @@ -93,12 +98,6 @@ Content-Transfer-Encoding: Quoted-printable "tz_minute": 0 } }, - "mime_version": { - "Text": "1.0" - }, - "subject": { - "Text": "A multipart example" - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -132,13 +131,22 @@ Content-Transfer-Encoding: Quoted-printable "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "... Some text appears here ...\n\n[Note that the blank between the boundary and the start\nof the text in this part means no header fields were\ngiven and this is text in the US-ASCII character set.\nIt could have been done with explicit typing as in the\nnext part.]\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -149,17 +157,20 @@ Content-Transfer-Encoding: Quoted-printable } } }, + "is_encoding_problem": false, "body": "This could have been part of the previous part, but\nillustrates explicit versus implicit typing of body\nparts.\n" } }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "parallel", - "attributes": { - "boundary": "unique-boundary-2" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "parallel", + "attributes": { + "boundary": "unique-boundary-2" + } } } } @@ -167,24 +178,25 @@ Content-Transfer-Encoding: Quoted-printable }, { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "base64" + }, "content_type": { "ContentType": { "c_type": "audio", "c_subtype": "basic", "attributes": null } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": true, "body": "... base64-encoded 8000 Hz single-channel\n mu-law-format audio data goes here ...\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "base64" }, @@ -196,12 +208,13 @@ Content-Transfer-Encoding: Quoted-printable } } }, + "is_encoding_problem": true, "body": "... base64-encoded image data goes here ...\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -210,12 +223,13 @@ Content-Transfer-Encoding: Quoted-printable } } }, + "is_encoding_problem": false, "body": "This is enriched.\nas defined in RFC 1896\n\nIsn't it\ncool?\n" } }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -224,6 +238,7 @@ Content-Transfer-Encoding: Quoted-printable } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { "to": { @@ -232,18 +247,6 @@ Content-Transfer-Encoding: Quoted-printable "address": null } }, - "content_transfer_encoding": { - "Text": "Quoted-printable" - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": { - "charset": "ISO-8859-1" - } - } - }, "from": { "Address": { "name": "mailbox in US-ASCII", @@ -264,7 +267,21 @@ Content-Transfer-Encoding: Quoted-printable "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_transfer_encoding": { + "Text": "Quoted-printable" + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": { + "charset": "ISO-8859-1" + } + } + } + }, + "is_encoding_problem": false, "body": "... Additional text in ISO-8859-1 goes here ...\n" } } diff --git a/tests/rfc/001.txt b/tests/rfc/001.txt index 0cfd4e4..22afece 100644 --- a/tests/rfc/001.txt +++ b/tests/rfc/001.txt @@ -39,12 +39,26 @@ get RFC-MIME.DOC --42-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "mime_version": { "Text": "1.0" }, + "content_id": { + "Text": "id001@guppylake.bellcore.com" + }, + "to": { + "Address": { + "name": "Someone", + "address": null + } + }, + "from": { + "Address": { + "name": "Whomever", + "address": null + } + }, "content_type": { "ContentType": { "c_type": "multipart", @@ -54,26 +68,11 @@ get RFC-MIME.DOC } } }, - "from": { - "Address": { - "name": "Whomever", - "address": null - } - }, "message_id": { "Text": "id1@host.com" }, - "content_id": { - "Text": "id001@guppylake.bellcore.com" - }, "subject": { "Text": "whatever" - }, - "to": { - "Address": { - "name": "Someone", - "address": null - } } }, "html_body": [], @@ -86,22 +85,123 @@ get RFC-MIME.DOC "parts": [ { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", "c_subtype": "external-body", "attributes": { - "access-type": "ANON-FTP", - "site": "thumper.bellcore.com", + "expiration": "Fri, 14 Jun 1991 19:13:14 -0400 (EDT)", "mode": "image", + "site": "thumper.bellcore.com", "name": "BodyFormats.ps", - "directory": "pub", + "access-type": "ANON-FTP", + "directory": "pub" + } + } + } + }, + "is_encoding_problem": false, + "body": [ + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 116, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 112, + 111, + 115, + 116, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 73, + 68, + 58, + 32, + 60, + 105, + 100, + 52, + 50, + 64, + 103, + 117, + 112, + 112, + 121, + 108, + 97, + 107, + 101, + 46, + 98, + 101, + 108, + 108, + 99, + 111, + 114, + 101, + 46, + 99, + 111, + 109, + 62, + 10 + ] + } + }, + { + "Binary": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "message", + "c_subtype": "external-body", + "attributes": { + "site": "thumper.bellcore.com", + "access-type": "local-file", + "name": "/u/nsb/writing/rfcs/RFC-MIME.ps", "expiration": "Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" } } } }, + "is_encoding_problem": false, "body": [ 67, 111, @@ -187,118 +287,20 @@ get RFC-MIME.DOC }, { "Binary": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "message", - "c_subtype": "external-body", - "attributes": { - "access-type": "local-file", - "site": "thumper.bellcore.com", - "expiration": "Fri, 14 Jun 1991 19:13:14 -0400 (EDT)", - "name": "/u/nsb/writing/rfcs/RFC-MIME.ps" - } - } - } - }, - "body": [ - 67, - 111, - 110, - 116, - 101, - 110, - 116, - 45, - 116, - 121, - 112, - 101, - 58, - 32, - 97, - 112, - 112, - 108, - 105, - 99, - 97, - 116, - 105, - 111, - 110, - 47, - 112, - 111, - 115, - 116, - 115, - 99, - 114, - 105, - 112, - 116, - 10, - 67, - 111, - 110, - 116, - 101, - 110, - 116, - 45, - 73, - 68, - 58, - 32, - 60, - 105, - 100, - 52, - 50, - 64, - 103, - 117, - 112, - 112, - 121, - 108, - 97, - 107, - 101, - 46, - 98, - 101, - 108, - 108, - 99, - 111, - 114, - 101, - 46, - 99, - 111, - 109, - 62, - 10 - ] - } - }, - { - "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", "c_subtype": "external-body", "attributes": { + "access-type": "mail-server", "server": "listserv@bogus.bitnet", - "expiration": "Fri, 14 Jun 1991 19:13:14 -0400 (EDT)", - "access-type": "mail-server" + "expiration": "Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" } } } }, + "is_encoding_problem": false, "body": [ 67, 111, diff --git a/tests/rfc/002.txt b/tests/rfc/002.txt index 4d3802f..3575e29 100644 --- a/tests/rfc/002.txt +++ b/tests/rfc/002.txt @@ -71,21 +71,8 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz --D7F------------D7FD5A0B8AB9C65CCDBFA872-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "subject": { - "Text": "[Fwd: Map of Argentina with Description]" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "D7F------------D7FD5A0B8AB9C65CCDBFA872" - } - } - }, "from": { "Address": { "name": "Al Gore", @@ -97,6 +84,18 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz "name": "White House Transportation Coordinator", "address": "transport@whitehouse.gov" } + }, + "subject": { + "Text": "[Fwd: Map of Argentina with Description]" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "D7F------------D7FD5A0B8AB9C65CCDBFA872" + } + } } }, "html_body": [ @@ -111,7 +110,10 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz "parts": [ { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "7bit" + }, "content_type": { "ContentType": { "c_type": "text", @@ -120,19 +122,21 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz "charset": "us-ascii" } } - }, - "content_transfer_encoding": { - "Text": "7bit" } }, + "is_encoding_problem": false, "body": "Fred,\n\nFire up Air Force One! We're going South!\n\nThanks,\nAl" } }, { "Message": { - "headers": { - "content_transfer_encoding": { - "Text": "7bit" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "message", + "c_subtype": "rfc822", + "attributes": null + } }, "content_disposition": { "ContentType": { @@ -141,16 +145,25 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz "attributes": null } }, - "content_type": { - "ContentType": { - "c_type": "message", - "c_subtype": "rfc822", - "attributes": null - } + "content_transfer_encoding": { + "Text": "7bit" } }, + "is_encoding_problem": false, "body": { "headers_rfc": { + "message_id": { + "Text": "199804130742.RAA20366@mai1host.whitehouse.gov" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "DC8------------DC8638F443D87A7F0726DEF7" + } + } + }, "received": { "Collection": [ { @@ -161,18 +174,18 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz } ] }, - "return_path": { - "Text": "president@whitehouse.gov" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "DC8------------DC8638F443D87A7F0726DEF7" - } + "to": { + "Address": { + "name": "A1 Gore (The Enforcer)", + "address": "vice-president@whitehouse.gov" } }, + "subject": { + "Text": "Map of Argentina with Description" + }, + "mime_version": { + "Text": "1.0" + }, "date": { "DateTime": { "year": 1998, @@ -186,26 +199,14 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz "tz_minute": 0 } }, - "message_id": { - "Text": "199804130742.RAA20366@mai1host.whitehouse.gov" - }, "from": { "Address": { "name": "Bill Clinton", "address": "president@whitehouse.gov" } }, - "to": { - "Address": { - "name": "A1 Gore (The Enforcer)", - "address": "vice-president@whitehouse.gov" - } - }, - "subject": { - "Text": "Map of Argentina with Description" - }, - "mime_version": { - "Text": "1.0" + "return_path": { + "Text": "president@whitehouse.gov" } }, "html_body": [ @@ -222,10 +223,7 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz "parts": [ { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "7bit" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -234,14 +232,18 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz "charset": "us-ascii" } } + }, + "content_transfer_encoding": { + "Text": "7bit" } }, + "is_encoding_problem": false, "body": "Hi A1,\n\nI finally figured out this MIME thing. Pretty cool. I'll send you\nsome sax music in .au files next week!\n\nAnyway, the attached image is really too small to get a good look at\nArgentina. Try this for a much better map:\n\n http://www.1one1yp1anet.com/dest/sam/graphics/map-arg.htm\n\nThen again, shouldn't the CIA have something like that?\n\nBill" } }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "inline", @@ -251,6 +253,9 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz } } }, + "content_transfer_encoding": { + "Text": "base64" + }, "content_type": { "ContentType": { "c_type": "image", @@ -259,11 +264,9 @@ U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz "name": "map_of_Argentina.gif" } } - }, - "content_transfer_encoding": { - "Text": "base64" } }, + "is_encoding_problem": false, "body": [ 71, 77, diff --git a/tests/rfc/003.txt b/tests/rfc/003.txt index dbe1c54..4115939 100644 --- a/tests/rfc/003.txt +++ b/tests/rfc/003.txt @@ -23,8 +23,7 @@ Content-Type: application/x-whatever --boundary42-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "from": { "Address": { @@ -32,27 +31,15 @@ Content-Type: application/x-whatever "address": "nsb@bellcore.com" } }, + "subject": { + "Text": "Formatted text mail" + }, "to": { "Address": { "name": "Ned Freed", "address": "ned@innosoft.com" } }, - "subject": { - "Text": "Formatted text mail" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "boundary42" - } - } - }, - "mime_version": { - "Text": "1.0" - }, "date": { "DateTime": { "year": 1993, @@ -65,6 +52,18 @@ Content-Type: application/x-whatever "tz_hour": 8, "tz_minute": 0 } + }, + "mime_version": { + "Text": "1.0" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "boundary42" + } + } } }, "html_body": [ @@ -80,7 +79,7 @@ Content-Type: application/x-whatever "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -91,12 +90,13 @@ Content-Type: application/x-whatever } } }, + "is_encoding_problem": false, "body": "... plain text version of message goes here ...\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -105,12 +105,13 @@ Content-Type: application/x-whatever } } }, + "is_encoding_problem": false, "body": "... RFC 1896 text/enriched version of same message\n goes here ...\n" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "application", @@ -119,6 +120,7 @@ Content-Type: application/x-whatever } } }, + "is_encoding_problem": false, "body": [ 46, 46, diff --git a/tests/rfc/004.txt b/tests/rfc/004.txt index 068ae30..c0416a4 100644 --- a/tests/rfc/004.txt +++ b/tests/rfc/004.txt @@ -34,9 +34,17 @@ Subject: my different opinion ------ main boundary ------ ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "mime_version": { + "Text": "1.0" + }, + "to": { + "Address": { + "name": "Recipient-List", + "address": null + } + }, "content_type": { "ContentType": { "c_type": "multipart", @@ -46,6 +54,15 @@ Subject: my different opinion } } }, + "from": { + "Address": { + "name": "Moderator-Address", + "address": null + } + }, + "subject": { + "Text": "Internet Digest, volume 42" + }, "date": { "DateTime": { "year": 1994, @@ -58,24 +75,6 @@ Subject: my different opinion "tz_hour": 0, "tz_minute": 0 } - }, - "from": { - "Address": { - "name": "Moderator-Address", - "address": null - } - }, - "to": { - "Address": { - "name": "Recipient-List", - "address": null - } - }, - "subject": { - "Text": "Internet Digest, volume 42" - }, - "mime_version": { - "Text": "1.0" } }, "html_body": [ @@ -91,18 +90,29 @@ Subject: my different opinion "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "...Introductory text or table of contents...\n" } }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "digest", - "attributes": { - "boundary": "---- next message ----" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "digest", + "attributes": { + "boundary": "---- next message ----" + } } } } @@ -110,7 +120,7 @@ Subject: my different opinion }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -119,11 +129,9 @@ Subject: my different opinion } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { - "subject": { - "Text": "my opinion" - }, "from": { "Address": { "name": "someone-else", @@ -142,6 +150,9 @@ Subject: my different opinion "tz_hour": 2, "tz_minute": 0 } + }, + "subject": { + "Text": "my opinion" } }, "html_body": [ @@ -154,7 +165,16 @@ Subject: my different opinion "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "...body goes here ...\n" } } @@ -170,7 +190,7 @@ Subject: my different opinion }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -179,11 +199,9 @@ Subject: my different opinion } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { - "subject": { - "Text": "my different opinion" - }, "date": { "DateTime": { "year": 1993, @@ -202,6 +220,9 @@ Subject: my different opinion "name": "someone-else-again", "address": null } + }, + "subject": { + "Text": "my different opinion" } }, "html_body": [ @@ -214,7 +235,16 @@ Subject: my different opinion "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "... another body goes here ...\n" } } diff --git a/tests/rfc/005.txt b/tests/rfc/005.txt index 7b52f75..e333b19 100644 --- a/tests/rfc/005.txt +++ b/tests/rfc/005.txt @@ -23,15 +23,29 @@ It DOES end with a linebreak. This is the epilogue. It is also to be ignored. ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "mime_version": { + "Text": "1.0" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "simple boundary" + } + } + }, "from": { "Address": { "name": "Nathaniel Borenstein", "address": "nsb@bellcore.com" } }, + "subject": { + "Text": "Sample message" + }, "date": { "DateTime": { "year": 1993, @@ -45,26 +59,11 @@ This is the epilogue. It is also to be ignored. "tz_minute": 0 } }, - "subject": { - "Text": "Sample message" - }, "to": { "Address": { "name": "Ned Freed", "address": "ned@innosoft.com" } - }, - "mime_version": { - "Text": "1.0" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "simple boundary" - } - } } }, "html_body": [ @@ -79,13 +78,22 @@ This is the epilogue. It is also to be ignored. "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "This is implicitly typed plain US-ASCII text.\nIt does NOT end with a linebreak." } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -96,6 +104,7 @@ This is the epilogue. It is also to be ignored. } } }, + "is_encoding_problem": false, "body": "This is explicitly typed plain US-ASCII text.\nIt DOES end with a linebreak.\n" } } diff --git a/tests/rfc/006.txt b/tests/rfc/006.txt index d4572cd..0e64be2 100644 --- a/tests/rfc/006.txt +++ b/tests/rfc/006.txt @@ -21,8 +21,7 @@ Content-Disposition: inline --boundary-string-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "from": { "Address": { @@ -30,15 +29,6 @@ Content-Disposition: inline "address": "sender@example.com" } }, - "subject": { - "Text": "Multipart Email Example" - }, - "to": { - "Address": { - "name": null, - "address": "recipient@example.com" - } - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -47,6 +37,15 @@ Content-Disposition: inline "boundary": "boundary-string" } } + }, + "subject": { + "Text": "Multipart Email Example" + }, + "to": { + "Address": { + "name": null, + "address": "recipient@example.com" + } } }, "html_body": [ @@ -59,14 +58,7 @@ Content-Disposition: inline "parts": [ { "Text": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": null - } - }, + "headers_rfc": { "content_transfer_encoding": { "Text": "quoted-printable" }, @@ -78,14 +70,31 @@ Content-Disposition: inline "charset": "utf-8" } } + }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": null + } } }, + "is_encoding_problem": false, "body": "Plain text email goes here!\nThis is the fallback if email client does not support HTML\n" } }, { "Html": { - "headers": { + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "html", + "attributes": { + "charset": "utf-8" + } + } + }, "content_transfer_encoding": { "Text": "quoted-printable" }, @@ -95,17 +104,9 @@ Content-Disposition: inline "c_subtype": null, "attributes": null } - }, - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "html", - "attributes": { - "charset": "utf-8" - } - } } }, + "is_encoding_problem": false, "body": "

This is the HTML Section!

\n

This is what displays in most modern email clients

\n" } } diff --git a/tests/rfc/007.txt b/tests/rfc/007.txt index 8ce792d..f0bba4e 100644 --- a/tests/rfc/007.txt +++ b/tests/rfc/007.txt @@ -71,8 +71,7 @@ Content-Disposition: inline K --1-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "subject": { "Text": "RFC 8621 Section 4.1.4 test" @@ -109,33 +108,36 @@ K "parts": [ { "Text": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": null - } - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": null } + }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": null + } } }, + "is_encoding_problem": false, "body": "A" } }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "2" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "2" + } } } } @@ -143,12 +145,14 @@ K }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "3" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "3" + } } } } @@ -156,12 +160,14 @@ K }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "mixed", - "attributes": { - "boundary": "4" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "4" + } } } } @@ -169,28 +175,29 @@ K }, { "Text": { - "headers": { - "content_disposition": { - "ContentType": { - "c_type": "inline", - "c_subtype": null, - "attributes": null - } - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": null } + }, + "content_disposition": { + "ContentType": { + "c_type": "inline", + "c_subtype": null, + "attributes": null + } } }, + "is_encoding_problem": false, "body": "B" } }, { "InlineBinary": { - "headers": { + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "inline", @@ -206,6 +213,7 @@ K } } }, + "is_encoding_problem": false, "body": [ 67 ] @@ -213,33 +221,36 @@ K }, { "Text": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "text", - "c_subtype": "plain", - "attributes": null - } - }, + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "inline", "c_subtype": null, "attributes": null } + }, + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } } }, + "is_encoding_problem": false, "body": "D" } }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "related", - "attributes": { - "boundary": "5" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "related", + "attributes": { + "boundary": "5" + } } } } @@ -247,7 +258,7 @@ K }, { "Html": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -256,12 +267,13 @@ K } } }, + "is_encoding_problem": false, "body": "E" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "image", @@ -270,6 +282,7 @@ K } } }, + "is_encoding_problem": false, "body": [ 70 ] @@ -277,22 +290,23 @@ K }, { "Binary": { - "headers": { - "content_type": { - "ContentType": { - "c_type": "image", - "c_subtype": "jpeg", - "attributes": null - } - }, + "headers_rfc": { "content_disposition": { "ContentType": { "c_type": "attachment", "c_subtype": null, "attributes": null } + }, + "content_type": { + "ContentType": { + "c_type": "image", + "c_subtype": "jpeg", + "attributes": null + } } }, + "is_encoding_problem": false, "body": [ 71 ] @@ -300,7 +314,7 @@ K }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "application", @@ -309,6 +323,7 @@ K } } }, + "is_encoding_problem": false, "body": [ 72 ] @@ -316,7 +331,7 @@ K }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -325,6 +340,7 @@ K } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { "subject": { @@ -341,7 +357,16 @@ K "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "J" } } @@ -357,7 +382,7 @@ K }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -373,6 +398,7 @@ K } } }, + "is_encoding_problem": false, "body": "K" } } diff --git a/tests/rfc/008.txt b/tests/rfc/008.txt index b35c3a7..670376d 100644 --- a/tests/rfc/008.txt +++ b/tests/rfc/008.txt @@ -28,8 +28,7 @@ CiAgPC9oZWFkPg0KICA8Ym9keT4NCiAgICBUaGlzIGlzIGFuIDxiPkhUTUw8L2I+IHRlc3QgbWVz c2FnZQ0KICA8L2JvZHk+DQo8L2h0bWw+DQoNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh YWFhYWFhYWFhYWFhYS0tDQo= --bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -53,7 +52,7 @@ YWFhYWFhYWFhYWFhYS0tDQo= "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -67,12 +66,13 @@ YWFhYWFhYWFhYWFhYS0tDQo= "Text": "7bit" } }, + "is_encoding_problem": false, "body": "This is a message with a base64 encoded attached email" } }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -93,17 +93,9 @@ YWFhYWFhYWFhYWFhYS0tDQo= } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { - "content_language": { - "Text": "en-US" - }, - "subject": { - "Text": "HTML test" - }, - "message_id": { - "Text": "random-message-id@example.com" - }, "date": { "DateTime": { "year": 2021, @@ -117,18 +109,6 @@ YWFhYWFhYWFhYWFhYS0tDQo= "tz_minute": 0 } }, - "mime_version": { - "Text": "1.0" - }, - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - } - }, "from": { "Address": { "name": "Name", @@ -140,6 +120,27 @@ YWFhYWFhYWFhYWFhYS0tDQo= "name": "email@example.com", "address": "email@example.com" } + }, + "content_language": { + "Text": "en-US" + }, + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + } + }, + "subject": { + "Text": "HTML test" + }, + "message_id": { + "Text": "random-message-id@example.com" + }, + "mime_version": { + "Text": "1.0" } }, "html_body": [ @@ -152,27 +153,31 @@ YWFhYWFhYWFhYWFhYS0tDQo= "parts": [ { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "7bit" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": { - "format": "flowed", - "charset": "utf-8" + "charset": "utf-8", + "format": "flowed" } } + }, + "content_transfer_encoding": { + "Text": "7bit" } }, + "is_encoding_problem": false, "body": "This is an *HTML* test message\r" } }, { "Html": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "7bit" + }, "content_type": { "ContentType": { "c_type": "text", @@ -181,11 +186,9 @@ YWFhYWFhYWFhYWFhYS0tDQo= "charset": "utf-8" } } - }, - "content_transfer_encoding": { - "Text": "7bit" } }, + "is_encoding_problem": false, "body": "\r\n \r\n \r\n \r\n \r\n This is an HTML test message\r\n \r\n\r\n\r" } } diff --git a/tests/thirdparty/000.txt b/tests/thirdparty/000.txt index f44a58c..c05fb2d 100644 --- a/tests/thirdparty/000.txt +++ b/tests/thirdparty/000.txt @@ -18,8 +18,7 @@ Content-Transfer-Encoding: base64 ZWg= --bound-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "mime_version": { "Text": "1.0" @@ -46,7 +45,7 @@ ZWg= "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -58,12 +57,13 @@ ZWg= "Text": "base64" } }, + "is_encoding_problem": false, "body": "we have\ra lot \nof \u0000binary stuff in here\nb adjig sadjg jasidgjiaehga3wht8a3w8ghxjc dsgad hasdghsd gasd dsjdsoga sjdga0w3tjhawjgsertniq3n5oqerjqw2r89q23h awhrqh835r8a" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -75,6 +75,7 @@ ZWg= "Text": "base64" } }, + "is_encoding_problem": false, "body": "eh" } } diff --git a/tests/thirdparty/001.txt b/tests/thirdparty/001.txt index 9400c49..200ac49 100644 --- a/tests/thirdparty/001.txt +++ b/tests/thirdparty/001.txt @@ -23,9 +23,11 @@ hello world --bound-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "mime_version": { + "Text": "1.0" + }, "content_type": { "ContentType": { "c_type": "multipart", @@ -34,9 +36,6 @@ hello world "boundary": "bound" } } - }, - "mime_version": { - "Text": "1.0" } }, "html_body": [ @@ -53,24 +52,25 @@ hello world "parts": [ { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "binary" + }, "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": null } - }, - "content_transfer_encoding": { - "Text": "binary" } }, + "is_encoding_problem": false, "body": "d2UgaGF2ZQ1hIGxvdCAKb2YgAGJpbmFyeSBzdHVmZiBpbiBoZXJlCmIgYWRqaWcgc2FkamcgamFz\r\naWRnamlhZWhnYTN3aHQ4YTN3OGdoeGpjIGRzZ2FkIGhhc2RnaHNkIGdhc2QgZHNqZHNvZ2Egc2pk\r\nZ2EwdzN0amhhd2pnc2VydG5pcTNuNW9xZXJqcXcycjg5cTIzaCBhd2hycWg4MzVyOGE=\r" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "binary" }, @@ -82,12 +82,13 @@ hello world } } }, + "is_encoding_problem": false, "body": "ZWg=" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -96,6 +97,7 @@ hello world } } }, + "is_encoding_problem": false, "body": "hello world\r\n\r" } } diff --git a/tests/thirdparty/002.txt b/tests/thirdparty/002.txt index 8931301..6bf2932 100644 --- a/tests/thirdparty/002.txt +++ b/tests/thirdparty/002.txt @@ -18,8 +18,7 @@ Content-Type: text/plain; charset=utf-8 ?garbage --foo-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -45,7 +44,7 @@ Content-Type: text/plain; charset=utf-8 "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -59,12 +58,13 @@ Content-Type: text/plain; charset=utf-8 "Text": "quoted-printable" } }, + "is_encoding_problem": false, "body": "päivää\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "base64" }, @@ -78,12 +78,13 @@ Content-Type: text/plain; charset=utf-8 } } }, + "is_encoding_problem": false, "body": "yötä vaan.\n�\t�" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "base64" }, @@ -97,6 +98,7 @@ Content-Type: text/plain; charset=utf-8 } } }, + "is_encoding_problem": true, "body": "?garbage" } } diff --git a/tests/thirdparty/003.txt b/tests/thirdparty/003.txt index 0d834bb..3841c0f 100644 --- a/tests/thirdparty/003.txt +++ b/tests/thirdparty/003.txt @@ -33,8 +33,7 @@ TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== --1-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -67,7 +66,7 @@ TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -81,15 +80,13 @@ TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== "Text": "7bit" } }, + "is_encoding_problem": false, "body": "Move black king to queen's bishop\n" } }, { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "binary" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -98,14 +95,18 @@ TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== "charset": "UTF-8" } } + }, + "content_transfer_encoding": { + "Text": "binary" } }, + "is_encoding_problem": false, "body": "Move ♚ to ♛'s ♝\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "8bit" }, @@ -119,12 +120,13 @@ TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== } } }, + "is_encoding_problem": false, "body": "Move ♚ to ♛'s ♝\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "quoted-printable" }, @@ -138,12 +140,13 @@ TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== } } }, + "is_encoding_problem": false, "body": "Move ♚ to ♛'s ♝\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "base64" }, @@ -157,6 +160,7 @@ TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== } } }, + "is_encoding_problem": false, "body": "Move ♚ to ♛'s ♝\n" } } diff --git a/tests/thirdparty/004.txt b/tests/thirdparty/004.txt index f1c5eee..7e88e52 100644 --- a/tests/thirdparty/004.txt +++ b/tests/thirdparty/004.txt @@ -39,8 +39,7 @@ Move =E2=99=9A to =E2=99=9B's =E2=99=9D --1-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -75,7 +74,7 @@ Move =E2=99=9A to =E2=99=9B's =E2=99=9D "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "6bit" }, @@ -89,12 +88,13 @@ Move =E2=99=9A to =E2=99=9B's =E2=99=9D } } }, + "is_encoding_problem": false, "body": "Move black king to queen's bishop\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "7bits" }, @@ -108,12 +108,13 @@ Move =E2=99=9A to =E2=99=9B's =E2=99=9D } } }, + "is_encoding_problem": false, "body": "Move ♚ to ♛'s ♝\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -127,15 +128,13 @@ Move =E2=99=9A to =E2=99=9B's =E2=99=9D "Text": "8 bit" } }, + "is_encoding_problem": false, "body": "Move ♚ to ♛'s ♝\n" } }, { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "7-bit" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -144,14 +143,18 @@ Move =E2=99=9A to =E2=99=9B's =E2=99=9D "charset": "UTF-8" } } + }, + "content_transfer_encoding": { + "Text": "7-bit" } }, + "is_encoding_problem": false, "body": "Move ♚ to ♛'s ♝\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_transfer_encoding": { "Text": "8-bit" }, @@ -165,12 +168,13 @@ Move =E2=99=9A to =E2=99=9B's =E2=99=9D } } }, + "is_encoding_problem": false, "body": "Move ♚ to ♛'s ♝\n" } }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -181,6 +185,7 @@ Move =E2=99=9A to =E2=99=9B's =E2=99=9D } } }, + "is_encoding_problem": false, "body": "Move =E2=99=9A to =E2=99=9B's =E2=99=9D\n" } } diff --git a/tests/thirdparty/005.txt b/tests/thirdparty/005.txt index 0fd4238..a45996c 100644 Binary files a/tests/thirdparty/005.txt and b/tests/thirdparty/005.txt differ diff --git a/tests/thirdparty/006.txt b/tests/thirdparty/006.txt index 021e77f..93bd004 100644 --- a/tests/thirdparty/006.txt +++ b/tests/thirdparty/006.txt @@ -28,9 +28,11 @@ Signed by undersigned --2-- --1-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "subject": { + "Text": "Hide and seek" + }, "content_type": { "ContentType": { "c_type": "multipart", @@ -40,9 +42,6 @@ Signed by undersigned } } }, - "subject": { - "Text": "Hide and seek" - }, "mime_version": { "Text": "1.0" } @@ -59,14 +58,16 @@ Signed by undersigned "parts": [ { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "signed", - "attributes": { - "protocol": "signature/plain", - "boundary": "2", - "migalc": "pen+paper" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "signed", + "attributes": { + "migalc": "pen+paper", + "protocol": "signature/plain", + "boundary": "2" + } } } } @@ -74,12 +75,14 @@ Signed by undersigned }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "3" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "3" + } } } } @@ -87,7 +90,7 @@ Signed by undersigned }, { "Html": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -98,29 +101,31 @@ Signed by undersigned } } }, + "is_encoding_problem": false, "body": "Search me

Don't find me here

\n" } }, { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "binary" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": null } + }, + "content_transfer_encoding": { + "Text": "binary" } }, + "is_encoding_problem": false, "body": "Search me, and Find me here" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "signature", @@ -131,6 +136,7 @@ Signed by undersigned } } }, + "is_encoding_problem": false, "body": [ 83, 105, diff --git a/tests/thirdparty/007.txt b/tests/thirdparty/007.txt index 574fae0..b4ad902 100644 --- a/tests/thirdparty/007.txt +++ b/tests/thirdparty/007.txt @@ -32,15 +32,8 @@ Content-Transfer-Encoding: binary Foobar --2-- --1-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { - "from": { - "Address": { - "name": "Moderator-Address", - "address": "moderator" - } - }, "content_type": { "ContentType": { "c_type": "multipart", @@ -49,6 +42,12 @@ Foobar "boundary": "1" } } + }, + "from": { + "Address": { + "name": "Moderator-Address", + "address": "moderator" + } } }, "html_body": [], @@ -61,7 +60,7 @@ Foobar "parts": [ { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -70,16 +69,17 @@ Foobar } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { + "subject": { + "Text": "my opinion" + }, "from": { "Address": { "name": "someone-else", "address": "someone@else" } - }, - "subject": { - "Text": "my opinion" } }, "html_body": [ @@ -92,7 +92,16 @@ Foobar "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "This is my opinion" } } @@ -108,7 +117,7 @@ Foobar }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -117,16 +126,17 @@ Foobar } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { - "subject": { - "Text": "i disagree" - }, "from": { "Address": { "name": "another one", "address": "another@one" } + }, + "subject": { + "Text": "i disagree" } }, "html_body": [ @@ -139,7 +149,16 @@ Foobar "parts": [ { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "Not agreeing one bit!" } } @@ -155,7 +174,7 @@ Foobar }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -164,14 +183,9 @@ Foobar } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { - "from": { - "Address": { - "name": "attachment", - "address": "attachment@user" - } - }, "subject": { "Text": "funny hat" }, @@ -183,6 +197,12 @@ Foobar "boundary": "2" } } + }, + "from": { + "Address": { + "name": "attachment", + "address": "attachment@user" + } } }, "html_body": [ @@ -197,24 +217,25 @@ Foobar "parts": [ { "Text": { - "headers": { + "headers_rfc": { + "content_transfer_encoding": { + "Text": "binary" + }, "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": null } - }, - "content_transfer_encoding": { - "Text": "binary" } }, + "is_encoding_problem": false, "body": "Lovely attachment for you" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "application", @@ -229,6 +250,7 @@ Foobar "Text": "binary" } }, + "is_encoding_problem": false, "body": [ 70, 111, diff --git a/tests/thirdparty/008.txt b/tests/thirdparty/008.txt index ba0f7be..07dfd8d 100644 --- a/tests/thirdparty/008.txt +++ b/tests/thirdparty/008.txt @@ -55,8 +55,7 @@ Another part Root MIME epilogue ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { "content_type": { "ContentType": { @@ -103,7 +102,7 @@ Root MIME epilogue "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -114,12 +113,13 @@ Root MIME epilogue } } }, + "is_encoding_problem": false, "body": "hello\n" } }, { "Message": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", @@ -128,11 +128,25 @@ Root MIME epilogue } } }, + "is_encoding_problem": false, "body": { "headers_rfc": { "subject": { "Text": "submsg" }, + "date": { + "DateTime": { + "year": 2012, + "month": 8, + "day": 12, + "hour": 12, + "minute": 34, + "second": 56, + "tz_before_gmt": false, + "tz_hour": 3, + "tz_minute": 0 + } + }, "from": { "Address": { "name": null, @@ -147,19 +161,6 @@ Root MIME epilogue "boundary": "sub1" } } - }, - "date": { - "DateTime": { - "year": 2012, - "month": 8, - "day": 12, - "hour": 12, - "minute": 34, - "second": 56, - "tz_before_gmt": false, - "tz_hour": 3, - "tz_minute": 0 - } } }, "html_body": [ @@ -175,7 +176,7 @@ Root MIME epilogue "parts": [ { "Html": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -184,17 +185,20 @@ Root MIME epilogue } } }, + "is_encoding_problem": false, "body": "

Hello world

\n" } }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "sub2" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "sub2" + } } } } @@ -202,12 +206,14 @@ Root MIME epilogue }, { "Multipart": { - "content_type": { - "ContentType": { - "c_type": "multipart", - "c_subtype": "alternative", - "attributes": { - "boundary": "sub3" + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "sub3" + } } } } @@ -215,19 +221,46 @@ Root MIME epilogue }, { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "sub3 text" } }, { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "sub3 text2" } }, { "Text": { - "headers": {}, + "headers_rfc": { + "content_type": { + "ContentType": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + } + }, + "is_encoding_problem": false, "body": "sub2 text2" } } @@ -270,7 +303,7 @@ Root MIME epilogue }, { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -279,6 +312,7 @@ Root MIME epilogue } } }, + "is_encoding_problem": false, "body": "Another part" } } diff --git a/tests/thirdparty/009.txt b/tests/thirdparty/009.txt index 51cc061..add5a82 100644 --- a/tests/thirdparty/009.txt +++ b/tests/thirdparty/009.txt @@ -19,9 +19,14 @@ Content-Transfer-Encoding: base64 dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo= --1-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "mime_version": { + "Text": "1.0" + }, + "subject": { + "Text": "In parts" + }, "content_type": { "ContentType": { "c_type": "multipart", @@ -30,12 +35,6 @@ dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo= "boundary": "1" } } - }, - "mime_version": { - "Text": "1.0" - }, - "subject": { - "Text": "In parts" } }, "html_body": [ @@ -50,7 +49,7 @@ dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo= "parts": [ { "Text": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", @@ -62,24 +61,26 @@ dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo= "Text": "binary" } }, + "is_encoding_problem": false, "body": "Hi, this is the fancy thing I was talking about!" } }, { "Binary": { - "headers": { + "headers_rfc": { "content_type": { "ContentType": { "c_type": "message", "c_subtype": "partial", "attributes": { + "number": "1", "id": "heks68ewe@example.org", - "total": "5", - "number": "1" + "total": "5" } } } }, + "is_encoding_problem": false, "body": [ 88, 45, diff --git a/tests/thirdparty/010.txt b/tests/thirdparty/010.txt index 404f5f9..f3ddc1d 100644 --- a/tests/thirdparty/010.txt +++ b/tests/thirdparty/010.txt @@ -10,9 +10,11 @@ Content-Language: ja 人権の無視及 --1-- ----- EXPECTED STRUCTURE ---- -{ +---- EXPECTED STRUCTURE ----{ "headers_rfc": { + "subject": { + "Text": "こんにちは" + }, "mime_version": { "Text": "1.0" }, @@ -21,13 +23,10 @@ Content-Language: ja "c_type": "multipart", "c_subtype": "mixed", "attributes": { - "boundary": "1", - "comment": "人権の無視及" + "comment": "人権の無視及", + "boundary": "1" } } - }, - "subject": { - "Text": "こんにちは" } }, "html_body": [ @@ -40,21 +39,22 @@ Content-Language: ja "parts": [ { "Text": { - "headers": { - "content_transfer_encoding": { - "Text": "binary" - }, - "content_language": { - "Text": "ja" - }, + "headers_rfc": { "content_type": { "ContentType": { "c_type": "text", "c_subtype": "plain", "attributes": null } + }, + "content_transfer_encoding": { + "Text": "binary" + }, + "content_language": { + "Text": "ja" } }, + "is_encoding_problem": false, "body": "人権の無視及" } }