Refactoring or MessageStream to use iterators more efficiently.

This commit is contained in:
Mauro D
2022-10-13 14:09:43 +00:00
parent ef19d20f9c
commit 6fcc57a3d9
117 changed files with 113078 additions and 2038 deletions
+3 -1
View File
@@ -1,9 +1,11 @@
mail-parser 0.6.2
mail-parser 0.7.0
================================
- Base64/QuotedPrintable decoding optimizations.
- Added "ludicrous mode" Cargo option to use some unsafe code for additional performance.
- Fixed support for empty messages.
- Fixed raw offsets of multipart/* parts to include MIME epilogue.
- Automatic parsing of base64/qp encoded nested messages.
- Refactoring or ``MessageStream`` to use iterators more efficiently.
mail-parser 0.6.1
================================
+1 -1
View File
@@ -1,7 +1,7 @@
[package]
name = "mail-parser"
description = "Fast and robust e-mail parsing library for Rust"
version = "0.6.2"
version = "0.7.0"
edition = "2018"
authors = [ "Stalwart Labs <hello@stalw.art>"]
license = "Apache-2.0 OR MIT"
+172 -178
View File
@@ -11,7 +11,7 @@
use std::borrow::Cow;
use crate::parsers::message::MessageStream;
use crate::parsers::MessageStream;
pub fn decode_base64(bytes: &[u8]) -> Option<Vec<u8>> {
let mut chunk: u32 = 0;
@@ -79,214 +79,209 @@ pub fn decode_base64(bytes: &[u8]) -> Option<Vec<u8>> {
buf.into()
}
//impl<'x> MessageStream<'x> {
impl<'x> MessageStream<'x> {
pub fn decode_base64_mime(&mut self, boundary: &[u8]) -> (usize, Cow<'x, [u8]>) {
let mut chunk: u32 = 0;
let mut byte_count: u8 = 0;
pub fn decode_base64_mime<'x>(
stream: &mut MessageStream<'x>,
boundary: &[u8],
) -> (usize, Cow<'x, [u8]>) {
let mut chunk: u32 = 0;
let mut byte_count: u8 = 0;
let mut buf = Vec::with_capacity(self.remaining() / 4 * 3);
let mut last_ch = b'\n';
let mut before_last_ch = 0;
let mut end_pos = self.offset();
let mut buf = Vec::with_capacity((stream.data.len() - stream.pos) / 4 * 3);
let mut pos = stream.pos;
self.checkpoint();
let mut last_ch = b'\n';
let mut end_pos = stream.pos;
let mut iter = stream.data[stream.pos..].iter();
while let Some(&ch) = self.next() {
#[cfg(feature = "ludicrous_mode")]
let val = unsafe {
*BASE64_MAP
.get_unchecked(byte_count as usize)
.get_unchecked(ch as usize)
};
#[cfg(not(feature = "ludicrous_mode"))]
let val = BASE64_MAP[byte_count as usize][ch as usize];
while let Some(&ch) = iter.next() {
pos += 1;
if val < 0x01ffffff {
byte_count = (byte_count + 1) & 3;
#[cfg(feature = "ludicrous_mode")]
let val = unsafe {
*BASE64_MAP
.get_unchecked(byte_count as usize)
.get_unchecked(ch as usize)
};
#[cfg(not(feature = "ludicrous_mode"))]
let val = BASE64_MAP[byte_count as usize][ch as usize];
if byte_count == 1 {
chunk = val;
} else {
chunk |= val;
if val < 0x01ffffff {
byte_count = (byte_count + 1) & 3;
if byte_count == 1 {
chunk = val;
} else {
chunk |= val;
if byte_count == 0 {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.extend_from_slice(chunk.to_le_bytes().get_unchecked(0..3));
if byte_count == 0 {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.extend_from_slice(chunk.to_le_bytes().get_unchecked(0..3));
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.extend_from_slice(&chunk.to_le_bytes()[0..3]);
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.extend_from_slice(&chunk.to_le_bytes()[0..3]);
}
}
} else {
match ch {
b'=' => match byte_count {
1 | 2 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.push(*chunk.to_le_bytes().get_unchecked(0));
} else {
match ch {
b'=' => match byte_count {
1 | 2 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.push(*chunk.to_le_bytes().get_unchecked(0));
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.push(chunk.to_le_bytes()[0]);
byte_count = 0;
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.push(chunk.to_le_bytes()[0]);
byte_count = 0;
3 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.extend_from_slice(chunk.to_le_bytes().get_unchecked(0..2));
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.extend_from_slice(&chunk.to_le_bytes()[0..2]);
byte_count = 0;
}
0 => (),
_ => {
self.restore();
return (usize::MAX, b""[..].into());
}
},
b'\n' => {
end_pos = if last_ch == b'\r' {
self.offset() - 2
} else {
self.offset() - 1
}
}
3 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.extend_from_slice(chunk.to_le_bytes().get_unchecked(0..2));
b' ' | b'\t' | b'\r' => (),
b'-' => {
if last_ch == b'-' {
return if !boundary.is_empty() && self.try_skip(boundary) {
buf.shrink_to_fit();
(
if before_last_ch == b'\n' {
end_pos
} else {
self.offset() - boundary.len() - 2
},
buf.into(),
)
} else {
self.restore();
(usize::MAX, b""[..].into())
};
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.extend_from_slice(&chunk.to_le_bytes()[0..2]);
byte_count = 0;
}
0 => (),
_ => {
self.restore();
return (usize::MAX, b""[..].into());
}
},
b'\n' => end_pos = if last_ch == b'\r' { pos - 2 } else { pos - 1 },
b' ' | b'\t' | b'\r' => (),
b'-' => {
return if !boundary.is_empty()
&& matches!(iter.next(), Some(b'-'))
&& stream.data.get(pos + 1..pos + 1 + boundary.len()) == Some(boundary)
&& matches!(
stream.data.get(pos + 1 + boundary.len()..),
Some([b'\n' | b'\r' | b' ' | b'\t', ..])
| Some([b'-', b'-', ..])
| Some([])
| None
) {
stream.pos = pos + boundary.len() + 1;
buf.shrink_to_fit();
(if last_ch == b'\n' { end_pos } else { pos - 1 }, buf.into())
} else {
(usize::MAX, b""[..].into())
};
}
_ => {
return (usize::MAX, b""[..].into());
}
}
before_last_ch = last_ch;
last_ch = ch;
}
last_ch = ch;
buf.shrink_to_fit();
(
if boundary.is_empty() {
self.offset()
} else {
self.restore();
usize::MAX
},
buf.into(),
)
}
buf.shrink_to_fit();
(
if boundary.is_empty() {
stream.pos = pos;
pos
} else {
usize::MAX
},
buf.into(),
)
}
pub fn decode_base64_word(&mut self) -> Option<Vec<u8>> {
let mut chunk: u32 = 0;
let mut byte_count: u8 = 0;
let mut buf = Vec::with_capacity(64);
pub fn decode_base64_word(bytes: &[u8]) -> (usize, Vec<u8>) {
let mut chunk: u32 = 0;
let mut byte_count: u8 = 0;
let mut bytes_read = 0;
let mut buf = Vec::with_capacity(64);
let mut iter = bytes.iter();
while let Some(&ch) = iter.next() {
bytes_read += 1;
match ch {
b'=' => {
match byte_count {
1 | 2 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.push(*chunk.to_le_bytes().get_unchecked(0));
while let Some(&ch) = self.next() {
match ch {
b'=' => {
match byte_count {
1 | 2 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.push(*chunk.to_le_bytes().get_unchecked(0));
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.push(chunk.to_le_bytes()[0]);
byte_count = 0;
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.push(chunk.to_le_bytes()[0]);
byte_count = 0;
}
3 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.extend_from_slice(chunk.to_le_bytes().get_unchecked(0..2));
3 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.extend_from_slice(chunk.to_le_bytes().get_unchecked(0..2));
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.extend_from_slice(&chunk.to_le_bytes()[0..2]);
byte_count = 0;
}
0 => (),
_ => {
// Invalid
break;
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.extend_from_slice(&chunk.to_le_bytes()[0..2]);
byte_count = 0;
}
0 => (),
_ => {
// Invalid
}
b'?' => {
if let Some(b'=') = self.next() {
return Some(buf);
} else {
break;
}
}
b'\n' => {
if !self.next_is_space() {
break;
}
}
b' ' | b'\t' | b'\r' => (),
_ => {
#[cfg(feature = "ludicrous_mode")]
let val = unsafe {
*BASE64_MAP
.get_unchecked(byte_count as usize)
.get_unchecked(ch as usize)
};
#[cfg(not(feature = "ludicrous_mode"))]
let val = BASE64_MAP[byte_count as usize][ch as usize];
if val < 0x01ffffff {
byte_count = (byte_count + 1) & 3;
if byte_count == 1 {
chunk = val;
} else {
chunk |= val;
if byte_count == 0 {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.extend_from_slice(chunk.to_le_bytes().get_unchecked(0..3));
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.extend_from_slice(&chunk.to_le_bytes()[0..3]);
}
}
} else {
break;
}
}
}
b'?' => {
if let Some(b'=') = iter.next() {
return (bytes_read + 1, buf);
} else {
break;
}
}
b'\n' => {
if let Some(b' ' | b'\t') = iter.next() {
bytes_read += 1;
} else {
break;
}
}
b' ' | b'\t' | b'\r' => (),
_ => {
#[cfg(feature = "ludicrous_mode")]
let val = unsafe {
*BASE64_MAP
.get_unchecked(byte_count as usize)
.get_unchecked(ch as usize)
};
#[cfg(not(feature = "ludicrous_mode"))]
let val = BASE64_MAP[byte_count as usize][ch as usize];
if val < 0x01ffffff {
byte_count = (byte_count + 1) & 3;
if byte_count == 1 {
chunk = val;
} else {
chunk |= val;
if byte_count == 0 {
#[cfg(feature = "ludicrous_mode")]
unsafe {
buf.extend_from_slice(chunk.to_le_bytes().get_unchecked(0..3));
}
#[cfg(not(feature = "ludicrous_mode"))]
buf.extend_from_slice(&chunk.to_le_bytes()[0..3]);
}
}
} else {
break;
}
}
}
}
(usize::MAX, buf)
None
}
}
//}
#[cfg(test)]
mod tests {
use crate::parsers::message::MessageStream;
use crate::parsers::MessageStream;
#[test]
fn decode_base64() {
@@ -346,7 +341,7 @@ mod tests {
),
] {
let mut s = MessageStream::new(encoded_str.as_bytes());
let (_, result) = super::decode_base64_mime(&mut s, b"boundary");
let (_, result) = s.decode_base64_mime(b"boundary");
assert_eq!(
result,
@@ -366,10 +361,9 @@ mod tests {
("w6HDqcOtw7PDug================?=", "áéíóú"),
("?=", ""),
] {
let (bytes, result) = super::decode_base64_word(encoded_str.as_bytes());
assert!(bytes != usize::MAX);
let mut s = MessageStream::new(encoded_str.as_bytes());
assert_eq!(
result,
s.decode_base64_word().unwrap(),
expected_result.as_bytes(),
"Failed for {:?}",
encoded_str
+68 -77
View File
@@ -9,11 +9,9 @@
* except according to those terms.
*/
use crate::{decoders::charsets::map::get_charset_decoder, parsers::message::MessageStream};
use crate::{decoders::charsets::map::get_charset_decoder, parsers::MessageStream};
use super::{
base64::decode_base64_word, quoted_printable::decode_quoted_printable_word, DecodeWordFnc,
};
use super::DecodeWordFnc;
enum Rfc2047State {
Init,
@@ -22,89 +20,82 @@ enum Rfc2047State {
Data,
}
pub fn decode_rfc2047(stream: &MessageStream, start_pos: usize) -> (usize, Option<String>) {
let mut read_pos: usize = start_pos;
let mut state = Rfc2047State::Init;
impl<'x> MessageStream<'x> {
pub fn decode_rfc2047(&mut self) -> Option<String> {
let mut state = Rfc2047State::Init;
let mut charset_start = 0;
let mut charset_end = 0;
let mut decode_fnc: Option<DecodeWordFnc> = None;
let mut charset_start = 0;
let mut charset_end = 0;
let mut decode_fnc: Option<DecodeWordFnc> = None;
for ch in stream.data[start_pos..].iter() {
read_pos += 1;
match state {
Rfc2047State::Init => {
if ch != &b'?' {
return (0, None);
}
state = Rfc2047State::Charset;
charset_start = read_pos;
charset_end = read_pos;
}
Rfc2047State::Charset => match ch {
b'?' => {
if charset_end == charset_start {
charset_end = read_pos - 1;
while let Some(ch) = self.next() {
match state {
Rfc2047State::Init => {
if ch != &b'?' {
return None;
}
if (charset_end - charset_start) < 2 {
return (0, None);
state = Rfc2047State::Charset;
charset_start = self.offset();
charset_end = self.offset();
}
Rfc2047State::Charset => match ch {
b'?' => {
if charset_end == charset_start {
charset_end = self.offset() - 1;
}
if (charset_end - charset_start) < 2 {
return None;
}
state = Rfc2047State::Encoding;
}
state = Rfc2047State::Encoding;
}
b'*' => {
if charset_end == charset_start {
charset_end = read_pos - 1;
b'*' => {
if charset_end == charset_start {
charset_end = self.offset() - 1;
}
}
}
b'\n' => {
return (0, None);
}
_ => (),
},
Rfc2047State::Encoding => {
match ch {
b'q' | b'Q' => decode_fnc = Some(decode_quoted_printable_word),
b'b' | b'B' => decode_fnc = Some(decode_base64_word),
_ => {
return (0, None);
b'\n' => {
return None;
}
}
state = Rfc2047State::Data;
}
Rfc2047State::Data => {
if ch != &b'?' {
return (0, None);
} else {
break;
}
}
}
}
if let (Some(decode_fnc), Some(enc_bytes)) = (decode_fnc, stream.data.get(read_pos..)) {
let (bytes_read, bytes) = decode_fnc(enc_bytes);
if bytes_read != usize::MAX {
return (
(read_pos - start_pos) + bytes_read,
if let Some(decoder) = get_charset_decoder(&stream.data[charset_start..charset_end])
{
decoder(&bytes).into()
} else {
String::from_utf8(bytes)
.unwrap_or_else(|e| String::from_utf8_lossy(e.as_bytes()).into_owned())
.into()
_ => (),
},
);
Rfc2047State::Encoding => {
match ch {
b'q' | b'Q' => {
decode_fnc = Some(MessageStream::decode_quoted_printable_word)
}
b'b' | b'B' => decode_fnc = Some(MessageStream::decode_base64_word),
_ => {
return None;
}
}
state = Rfc2047State::Data;
}
Rfc2047State::Data => {
if ch != &b'?' {
return None;
} else {
break;
}
}
}
}
if let Some(bytes) = decode_fnc.and_then(|fnc| fnc(self)) {
if let Some(decoder) = get_charset_decoder(self.get_bytes(charset_start..charset_end)) {
decoder(&bytes).into()
} else {
String::from_utf8(bytes)
.unwrap_or_else(|e| String::from_utf8_lossy(e.as_bytes()).into_owned())
.into()
}
} else {
None
}
}
(0, None)
}
#[cfg(test)]
mod tests {
use crate::parsers::message::MessageStream;
use crate::parsers::MessageStream;
#[test]
fn decode_rfc2047() {
@@ -176,8 +167,8 @@ mod tests {
true,
),
] {
match super::decode_rfc2047(&MessageStream::new(input.as_bytes()), 0) {
(_, Some(result)) => {
match MessageStream::new(input.as_bytes()).decode_rfc2047() {
Some(result) => {
//println!("Decoded '{}'", string);
assert_eq!(result, expected_result);
}
+2 -2
View File
@@ -11,7 +11,7 @@
use std::borrow::Cow;
use crate::parsers::message::MessageStream;
use crate::parsers::MessageStream;
pub mod base64;
pub mod charsets;
@@ -21,4 +21,4 @@ pub mod html;
pub mod quoted_printable;
pub type DecodeFnc<'x> = fn(&mut MessageStream<'x>, &[u8]) -> (usize, Cow<'x, [u8]>);
pub type DecodeWordFnc<'x> = fn(&[u8]) -> (usize, Vec<u8>);
pub type DecodeWordFnc<'x> = fn(&mut MessageStream<'x>) -> Option<Vec<u8>>;
+154 -170
View File
@@ -11,7 +11,7 @@
use std::borrow::Cow;
use crate::parsers::message::MessageStream;
use crate::parsers::MessageStream;
#[derive(PartialEq, Debug)]
enum QuotedPrintableState {
@@ -83,199 +83,186 @@ pub fn decode_quoted_printable(bytes: &[u8]) -> Option<Vec<u8>> {
buf.into()
}
pub fn decode_quoted_printable_mime<'x>(
stream: &mut MessageStream<'x>,
boundary: &[u8],
) -> (usize, Cow<'x, [u8]>) {
let mut buf = Vec::with_capacity(stream.data.len() - stream.pos);
impl<'x> MessageStream<'x> {
pub fn decode_quoted_printable_mime(&mut self, boundary: &[u8]) -> (usize, Cow<'x, [u8]>) {
let mut buf = Vec::with_capacity(128);
let mut state = QuotedPrintableState::None;
let mut hex1 = 0;
let mut state = QuotedPrintableState::None;
let mut hex1 = 0;
let mut last_ch = 0;
let mut before_last_ch = 0;
let mut end_pos = self.offset();
let mut iter = stream.data[stream.pos..].iter().peekable();
let mut last_ch = 0;
let mut pos = stream.pos;
let mut end_pos = stream.pos;
self.checkpoint();
while let Some(&ch) = iter.next() {
pos += 1;
match ch {
b'=' => {
if let QuotedPrintableState::None = state {
state = QuotedPrintableState::Eq
} else {
return (usize::MAX, b""[..].into());
while let Some(&ch) = self.next() {
match ch {
b'=' => {
if let QuotedPrintableState::None = state {
state = QuotedPrintableState::Eq
} else {
self.restore();
return (usize::MAX, b""[..].into());
}
}
}
b'\n' => {
end_pos = if last_ch == b'\r' { pos - 2 } else { pos - 1 };
if QuotedPrintableState::Eq == state {
state = QuotedPrintableState::None;
} else {
buf.push(b'\n');
}
}
b'\r' => (),
b'-' if !boundary.is_empty()
&& matches!(iter.peek(), Some(b'-'))
&& stream.data.get(pos + 1..pos + 1 + boundary.len()) == Some(boundary)
&& matches!(
stream.data.get(pos + 1 + boundary.len()..),
Some([b'\n' | b'\r' | b' ' | b'\t', ..])
| Some([b'-', b'-', ..])
| Some([])
| None
) =>
{
if last_ch == b'\n' {
buf.pop();
} else {
end_pos = pos - 1;
}
stream.pos = pos + boundary.len() + 1;
buf.shrink_to_fit();
return (end_pos, buf.into());
}
_ => match state {
QuotedPrintableState::None => {
buf.push(ch);
}
QuotedPrintableState::Eq => {
hex1 = {
#[cfg(feature = "ludicrous_mode")]
unsafe {
*HEX_MAP.get_unchecked(ch as usize)
}
#[cfg(not(feature = "ludicrous_mode"))]
HEX_MAP[ch as usize]
b'\n' => {
end_pos = if last_ch == b'\r' {
self.offset() - 2
} else {
self.offset() - 1
};
if hex1 != -1 {
state = QuotedPrintableState::Hex1;
if QuotedPrintableState::Eq == state {
state = QuotedPrintableState::None;
} else {
return (usize::MAX, b""[..].into());
buf.push(b'\n');
}
}
QuotedPrintableState::Hex1 => {
#[cfg(feature = "ludicrous_mode")]
let hex2 = unsafe { *HEX_MAP.get_unchecked(ch as usize) };
#[cfg(not(feature = "ludicrous_mode"))]
let hex2 = HEX_MAP[ch as usize];
b'\r' => (),
b'-' if !boundary.is_empty() && last_ch == b'-' && self.try_skip(boundary) => {
if before_last_ch == b'\n' {
buf.truncate(buf.len() - 2);
} else {
buf.truncate(buf.len() - 1);
end_pos = self.offset() - boundary.len() - 2;
}
state = QuotedPrintableState::None;
if hex2 != -1 {
buf.push(((hex1 as u8) << 4) | hex2 as u8);
} else {
return (usize::MAX, b""[..].into());
}
return (end_pos, buf.into());
}
},
_ => match state {
QuotedPrintableState::None => {
buf.push(ch);
}
QuotedPrintableState::Eq => {
hex1 = {
#[cfg(feature = "ludicrous_mode")]
unsafe {
*HEX_MAP.get_unchecked(ch as usize)
}
#[cfg(not(feature = "ludicrous_mode"))]
HEX_MAP[ch as usize]
};
if hex1 != -1 {
state = QuotedPrintableState::Hex1;
} else {
self.restore();
return (usize::MAX, b""[..].into());
}
}
QuotedPrintableState::Hex1 => {
#[cfg(feature = "ludicrous_mode")]
let hex2 = unsafe { *HEX_MAP.get_unchecked(ch as usize) };
#[cfg(not(feature = "ludicrous_mode"))]
let hex2 = HEX_MAP[ch as usize];
state = QuotedPrintableState::None;
if hex2 != -1 {
buf.push(((hex1 as u8) << 4) | hex2 as u8);
} else {
self.restore();
return (usize::MAX, b""[..].into());
}
}
},
}
before_last_ch = last_ch;
last_ch = ch;
}
last_ch = ch;
(
if boundary.is_empty() {
self.offset()
} else {
self.restore();
usize::MAX
},
buf.into(),
)
}
buf.shrink_to_fit();
(
if boundary.is_empty() {
stream.pos = pos;
pos
} else {
usize::MAX
},
buf.into(),
)
}
pub fn decode_quoted_printable_word(&mut self) -> Option<Vec<u8>> {
let mut buf = Vec::with_capacity(64);
pub fn decode_quoted_printable_word(bytes: &[u8]) -> (usize, Vec<u8>) {
let mut bytes_read = 0;
let mut state = QuotedPrintableState::None;
let mut hex1 = 0;
let mut buf = Vec::with_capacity(64);
let mut state = QuotedPrintableState::None;
let mut hex1 = 0;
let mut iter = bytes.iter().peekable();
while let Some(&ch) = iter.next() {
bytes_read += 1;
match ch {
b'=' => {
if let QuotedPrintableState::None = state {
state = QuotedPrintableState::Eq
} else {
break;
while let Some(&ch) = self.next() {
match ch {
b'=' => {
if let QuotedPrintableState::None = state {
state = QuotedPrintableState::Eq
} else {
break;
}
}
}
b'?' => {
if let Some(b'=') = iter.peek() {
return (bytes_read + 1, buf);
} else {
buf.push(b'?');
b'?' => {
if let Some(b'=') = self.peek() {
self.next();
return buf.into();
} else {
buf.push(b'?');
}
}
}
b'\n' => {
if let Some(b' ' | b'\t') = iter.peek() {
loop {
iter.next();
bytes_read += 1;
if !matches!(iter.peek(), Some(b' ' | b'\t')) {
b'\n' => {
if let Some(b' ' | b'\t') = self.peek() {
loop {
self.next();
if !self.peek_next_is_space() {
break;
}
}
} else {
break;
}
}
b'_' => {
buf.push(b' ');
}
b'\r' => (),
_ => match state {
QuotedPrintableState::None => {
buf.push(ch);
}
QuotedPrintableState::Eq => {
hex1 = {
#[cfg(feature = "ludicrous_mode")]
unsafe {
*HEX_MAP.get_unchecked(ch as usize)
}
#[cfg(not(feature = "ludicrous_mode"))]
HEX_MAP[ch as usize]
};
if hex1 != -1 {
state = QuotedPrintableState::Hex1;
} else {
// Failed
break;
}
}
} else {
break;
}
}
b'_' => {
buf.push(b' ');
}
b'\r' => (),
_ => match state {
QuotedPrintableState::None => {
buf.push(ch);
}
QuotedPrintableState::Eq => {
hex1 = {
QuotedPrintableState::Hex1 => {
#[cfg(feature = "ludicrous_mode")]
unsafe {
*HEX_MAP.get_unchecked(ch as usize)
}
let hex2 = unsafe { *HEX_MAP.get_unchecked(ch as usize) };
#[cfg(not(feature = "ludicrous_mode"))]
HEX_MAP[ch as usize]
};
if hex1 != -1 {
state = QuotedPrintableState::Hex1;
} else {
// Failed
break;
}
}
QuotedPrintableState::Hex1 => {
#[cfg(feature = "ludicrous_mode")]
let hex2 = unsafe { *HEX_MAP.get_unchecked(ch as usize) };
#[cfg(not(feature = "ludicrous_mode"))]
let hex2 = HEX_MAP[ch as usize];
let hex2 = HEX_MAP[ch as usize];
state = QuotedPrintableState::None;
if hex2 != -1 {
buf.push(((hex1 as u8) << 4) | hex2 as u8);
} else {
// Failed
break;
state = QuotedPrintableState::None;
if hex2 != -1 {
buf.push(((hex1 as u8) << 4) | hex2 as u8);
} else {
// Failed
break;
}
}
}
},
},
}
}
None
}
(usize::MAX, buf)
}
#[cfg(test)]
mod tests {
use crate::parsers::message::MessageStream;
use crate::parsers::MessageStream;
#[test]
fn decode_quoted_printable() {
@@ -378,7 +365,7 @@ mod tests {
),
] {
let mut s = MessageStream::new(encoded_str.as_bytes());
let (_, result) = super::decode_quoted_printable_mime(&mut s, b"boundary");
let (_, result) = s.decode_quoted_printable_mime(b"boundary");
assert_eq!(
result,
@@ -407,13 +394,10 @@ mod tests {
("????????=", "???????"),
("\n\n", ""),
] {
let (bytes, mut result) = super::decode_quoted_printable_word(encoded_str.as_bytes());
if bytes == usize::MAX {
result.clear();
}
let mut s = MessageStream::new(encoded_str.as_bytes());
assert_eq!(
result,
s.decode_quoted_printable_word().unwrap_or_default(),
expected_result.as_bytes(),
"Failed for {:?}",
encoded_str
+323 -338
View File
@@ -11,10 +11,7 @@
use std::borrow::Cow;
use crate::{
decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, Addr, Group,
HeaderValue,
};
use crate::{parsers::MessageStream, Addr, Group, HeaderValue};
#[derive(PartialEq, Clone, Copy, Debug)]
enum AddressState {
@@ -45,45 +42,336 @@ pub struct AddressParser<'x> {
result: Vec<Group<'x>>,
}
pub fn add_token<'x>(
parser: &mut AddressParser<'x>,
stream: &MessageStream<'x>,
add_trail_space: bool,
) {
if parser.token_start > 0 {
let token = String::from_utf8_lossy(&stream.data[parser.token_start - 1..parser.token_end]);
let mut add_space = false;
let list = match parser.state {
AddressState::Address => &mut parser.mail_tokens,
AddressState::Name => {
if parser.is_token_email {
&mut parser.mail_tokens
} else {
add_space = true;
&mut parser.name_tokens
impl<'x> AddressParser<'x> {
pub fn add_token(&mut self, stream: &MessageStream<'x>, add_trail_space: bool) {
if self.token_start > 0 {
let token = String::from_utf8_lossy(&stream.data[self.token_start - 1..self.token_end]);
let mut add_space = false;
let list = match self.state {
AddressState::Address => &mut self.mail_tokens,
AddressState::Name => {
if self.is_token_email {
&mut self.mail_tokens
} else {
add_space = true;
&mut self.name_tokens
}
}
AddressState::Quote => &mut self.name_tokens,
AddressState::Comment => {
add_space = true;
&mut self.comment_tokens
}
};
if add_space && !list.is_empty() {
list.push(" ".into());
}
AddressState::Quote => &mut parser.name_tokens,
AddressState::Comment => {
add_space = true;
&mut parser.comment_tokens
list.push(token);
if add_trail_space {
list.push(" ".into());
}
self.token_start = 0;
self.is_token_email = false;
self.is_token_start = true;
self.is_escaped = false;
}
}
pub fn add_address(&mut self) {
let has_mail = !self.mail_tokens.is_empty();
let has_name = !self.name_tokens.is_empty();
let has_comment = !self.comment_tokens.is_empty();
self.addresses.push(if has_mail && has_name && has_comment {
Addr {
name: Some(
format!(
"{} ({})",
concat_tokens(&mut self.name_tokens),
concat_tokens(&mut self.comment_tokens)
)
.into(),
),
address: concat_tokens(&mut self.mail_tokens).into(),
}
} else if has_name && has_mail {
Addr {
name: concat_tokens(&mut self.name_tokens).into(),
address: concat_tokens(&mut self.mail_tokens).into(),
}
} else if has_mail && has_comment {
Addr {
name: concat_tokens(&mut self.comment_tokens).into(),
address: concat_tokens(&mut self.mail_tokens).into(),
}
} else if has_mail {
Addr {
name: None,
address: concat_tokens(&mut self.mail_tokens).into(),
}
} else if has_name && has_comment {
Addr {
name: concat_tokens(&mut self.comment_tokens).into(),
address: concat_tokens(&mut self.name_tokens).into(),
}
} else if has_name {
Addr {
name: concat_tokens(&mut self.name_tokens).into(),
address: None,
}
} else if has_comment {
Addr {
name: concat_tokens(&mut self.comment_tokens).into(),
address: None,
}
} else {
return;
});
}
pub fn add_group_details(&mut self) {
if !self.name_tokens.is_empty() {
self.group_name = concat_tokens(&mut self.name_tokens).into();
}
if !self.comment_tokens.is_empty() {
self.group_comment = concat_tokens(&mut self.comment_tokens).into();
}
if !self.mail_tokens.is_empty() {
if self.group_name.is_none() {
self.group_name = concat_tokens(&mut self.mail_tokens).into();
} else {
self.group_name = Some(
(self.group_name.as_ref().unwrap().as_ref().to_owned()
+ " "
+ concat_tokens(&mut self.mail_tokens).as_ref())
.into(),
);
}
}
}
pub fn add_group(&mut self) {
let has_name = self.group_name.is_some();
let has_comment = self.group_comment.is_some();
let has_addresses = !self.addresses.is_empty();
self.result
.push(if has_name && has_addresses && has_comment {
Group {
name: Some(
format!(
"{} ({})",
self.group_name.take().unwrap(),
self.group_comment.take().unwrap()
)
.into(),
),
addresses: std::mem::take(&mut self.addresses),
}
} else if has_addresses && has_name {
Group {
name: self.group_name.take(),
addresses: std::mem::take(&mut self.addresses),
}
} else if has_addresses {
Group {
name: self.group_comment.take(),
addresses: std::mem::take(&mut self.addresses),
}
} else if has_name {
Group {
name: self.group_name.take(),
addresses: Vec::new(),
}
} else {
return;
});
}
}
impl<'x> MessageStream<'x> {
pub fn parse_address(&mut self) -> HeaderValue<'x> {
let mut parser = AddressParser {
token_start: 0,
token_end: 0,
is_token_email: false,
is_token_start: true,
is_escaped: false,
name_tokens: Vec::with_capacity(3),
mail_tokens: Vec::with_capacity(3),
comment_tokens: Vec::with_capacity(3),
state: AddressState::Name,
state_stack: Vec::with_capacity(5),
addresses: Vec::new(),
group_name: None,
group_comment: None,
result: Vec::new(),
};
if add_space && !list.is_empty() {
list.push(" ".into());
while let Some(ch) = self.next() {
match ch {
b'\n' => {
parser.add_token(self, false);
if self.try_next_is_space() {
if !parser.is_token_start {
parser.is_token_start = true;
}
continue;
} else {
break;
}
}
b'\\' if parser.state != AddressState::Name => {
if parser.token_start > 0 {
if parser.state == AddressState::Quote {
parser.token_end = self.offset() - 1;
}
parser.add_token(self, false);
}
parser.is_escaped = true;
continue;
}
b',' if parser.state == AddressState::Name => {
parser.add_token(self, false);
parser.add_address();
continue;
}
b'<' if parser.state == AddressState::Name => {
parser.add_token(self, false);
parser.state_stack.push(AddressState::Name);
parser.state = AddressState::Address;
continue;
}
b'>' if parser.state == AddressState::Address => {
parser.add_token(self, false);
parser.state = parser.state_stack.pop().unwrap();
continue;
}
b'"' if !parser.is_escaped => match parser.state {
AddressState::Name => {
parser.state_stack.push(AddressState::Name);
parser.state = AddressState::Quote;
parser.add_token(self, false);
continue;
}
AddressState::Quote => {
parser.add_token(self, false);
parser.state = parser.state_stack.pop().unwrap();
continue;
}
_ => (),
},
b'@' if parser.state == AddressState::Name => {
parser.is_token_email = true;
}
b'=' if parser.is_token_start && !parser.is_escaped && self.peek_char(b'?') => {
self.checkpoint();
if let Some(token) = self.decode_rfc2047() {
let add_space = parser.state != AddressState::Quote; // Make borrow-checker happy
parser.add_token(self, add_space);
(if parser.state != AddressState::Comment {
&mut parser.name_tokens
} else {
&mut parser.comment_tokens
})
.push(token.into());
continue;
}
self.restore();
}
b' ' | b'\t' => {
if !parser.is_token_start {
parser.is_token_start = true;
}
if parser.is_escaped {
parser.is_escaped = false;
}
if parser.state == AddressState::Quote {
if parser.token_start == 0 {
parser.token_start = self.offset();
parser.token_end = parser.token_start;
} else {
parser.token_end = self.offset();
}
}
continue;
}
b'\r' => continue,
b'(' if parser.state != AddressState::Quote && !parser.is_escaped => {
parser.state_stack.push(parser.state);
if parser.state != AddressState::Comment {
parser.add_token(self, false);
parser.state = AddressState::Comment;
continue;
}
}
b')' if parser.state == AddressState::Comment && !parser.is_escaped => {
let new_state = parser.state_stack.pop().unwrap();
if parser.state != new_state {
parser.add_token(self, false);
parser.state = new_state;
continue;
}
}
b':' if parser.state == AddressState::Name && !parser.is_escaped => {
parser.add_group();
parser.add_token(self, false);
parser.add_group_details();
continue;
}
b';' if parser.state == AddressState::Name => {
parser.add_token(self, false);
parser.add_address();
parser.add_group();
continue;
}
_ => (),
}
if parser.is_escaped {
parser.is_escaped = false;
}
if parser.is_token_start {
parser.is_token_start = false;
}
if parser.token_start == 0 {
parser.token_start = self.offset();
parser.token_end = parser.token_start;
} else {
parser.token_end = self.offset();
}
}
list.push(token);
parser.add_address();
if add_trail_space {
list.push(" ".into());
if parser.group_name.is_some() || !parser.result.is_empty() {
parser.add_group();
if parser.result.len() > 1 {
HeaderValue::GroupList(parser.result)
} else {
HeaderValue::Group(parser.result.pop().unwrap())
}
} else if !parser.addresses.is_empty() {
if parser.addresses.len() > 1 {
HeaderValue::AddressList(parser.addresses)
} else {
HeaderValue::Address(parser.addresses.pop().unwrap())
}
} else {
HeaderValue::Empty
}
parser.token_start = 0;
parser.is_token_email = false;
parser.is_token_start = true;
parser.is_escaped = false;
}
}
@@ -97,307 +385,6 @@ fn concat_tokens<'x>(tokens: &mut Vec<Cow<'x, str>>) -> Cow<'x, str> {
}
}
pub fn add_address(parser: &mut AddressParser) {
let has_mail = !parser.mail_tokens.is_empty();
let has_name = !parser.name_tokens.is_empty();
let has_comment = !parser.comment_tokens.is_empty();
parser
.addresses
.push(if has_mail && has_name && has_comment {
Addr {
name: Some(
format!(
"{} ({})",
concat_tokens(&mut parser.name_tokens),
concat_tokens(&mut parser.comment_tokens)
)
.into(),
),
address: concat_tokens(&mut parser.mail_tokens).into(),
}
} else if has_name && has_mail {
Addr {
name: concat_tokens(&mut parser.name_tokens).into(),
address: concat_tokens(&mut parser.mail_tokens).into(),
}
} else if has_mail && has_comment {
Addr {
name: concat_tokens(&mut parser.comment_tokens).into(),
address: concat_tokens(&mut parser.mail_tokens).into(),
}
} else if has_mail {
Addr {
name: None,
address: concat_tokens(&mut parser.mail_tokens).into(),
}
} else if has_name && has_comment {
Addr {
name: concat_tokens(&mut parser.comment_tokens).into(),
address: concat_tokens(&mut parser.name_tokens).into(),
}
} else if has_name {
Addr {
name: concat_tokens(&mut parser.name_tokens).into(),
address: None,
}
} else if has_comment {
Addr {
name: concat_tokens(&mut parser.comment_tokens).into(),
address: None,
}
} else {
return;
});
}
pub fn add_group_details(parser: &mut AddressParser) {
if !parser.name_tokens.is_empty() {
parser.group_name = concat_tokens(&mut parser.name_tokens).into();
}
if !parser.comment_tokens.is_empty() {
parser.group_comment = concat_tokens(&mut parser.comment_tokens).into();
}
if !parser.mail_tokens.is_empty() {
if parser.group_name.is_none() {
parser.group_name = concat_tokens(&mut parser.mail_tokens).into();
} else {
parser.group_name = Some(
(parser.group_name.as_ref().unwrap().as_ref().to_owned()
+ " "
+ concat_tokens(&mut parser.mail_tokens).as_ref())
.into(),
);
}
}
}
pub fn add_group(parser: &mut AddressParser) {
let has_name = parser.group_name.is_some();
let has_comment = parser.group_comment.is_some();
let has_addresses = !parser.addresses.is_empty();
parser
.result
.push(if has_name && has_addresses && has_comment {
Group {
name: Some(
format!(
"{} ({})",
parser.group_name.take().unwrap(),
parser.group_comment.take().unwrap()
)
.into(),
),
addresses: std::mem::take(&mut parser.addresses),
}
} else if has_addresses && has_name {
Group {
name: parser.group_name.take(),
addresses: std::mem::take(&mut parser.addresses),
}
} else if has_addresses {
Group {
name: parser.group_comment.take(),
addresses: std::mem::take(&mut parser.addresses),
}
} else if has_name {
Group {
name: parser.group_name.take(),
addresses: Vec::new(),
}
} else {
return;
});
}
pub fn parse_address<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut parser = AddressParser {
token_start: 0,
token_end: 0,
is_token_email: false,
is_token_start: true,
is_escaped: false,
name_tokens: Vec::with_capacity(3),
mail_tokens: Vec::with_capacity(3),
comment_tokens: Vec::with_capacity(3),
state: AddressState::Name,
state_stack: Vec::with_capacity(5),
addresses: Vec::new(),
group_name: None,
group_comment: None,
result: Vec::new(),
};
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => {
add_token(&mut parser, stream, false);
match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
iter.next();
stream.pos += 1;
if !parser.is_token_start {
parser.is_token_start = true;
}
continue;
}
_ => break,
}
}
b'\\' if parser.state != AddressState::Name => {
if parser.token_start > 0 {
if parser.state == AddressState::Quote {
parser.token_end = stream.pos - 1;
}
add_token(&mut parser, stream, false);
}
parser.is_escaped = true;
continue;
}
b',' if parser.state == AddressState::Name => {
add_token(&mut parser, stream, false);
add_address(&mut parser);
continue;
}
b'<' if parser.state == AddressState::Name => {
add_token(&mut parser, stream, false);
parser.state_stack.push(AddressState::Name);
parser.state = AddressState::Address;
continue;
}
b'>' if parser.state == AddressState::Address => {
add_token(&mut parser, stream, false);
parser.state = parser.state_stack.pop().unwrap();
continue;
}
b'"' if !parser.is_escaped => match parser.state {
AddressState::Name => {
parser.state_stack.push(AddressState::Name);
parser.state = AddressState::Quote;
add_token(&mut parser, stream, false);
continue;
}
AddressState::Quote => {
add_token(&mut parser, stream, false);
parser.state = parser.state_stack.pop().unwrap();
continue;
}
_ => (),
},
b'@' if parser.state == AddressState::Name => {
parser.is_token_email = true;
}
b'=' if parser.is_token_start && !parser.is_escaped => {
if let (d_bytes_read, Some(token)) = decode_rfc2047(stream, stream.pos) {
let add_space = parser.state != AddressState::Quote; // Make borrow-checker happy
add_token(&mut parser, stream, add_space);
(if parser.state != AddressState::Comment {
&mut parser.name_tokens
} else {
&mut parser.comment_tokens
})
.push(token.into());
stream.pos += d_bytes_read;
iter = stream.data[stream.pos..].iter();
continue;
}
}
b' ' | b'\t' => {
if !parser.is_token_start {
parser.is_token_start = true;
}
if parser.is_escaped {
parser.is_escaped = false;
}
if parser.state == AddressState::Quote {
if parser.token_start == 0 {
parser.token_start = stream.pos;
parser.token_end = parser.token_start;
} else {
parser.token_end = stream.pos;
}
}
continue;
}
b'\r' => continue,
b'(' if parser.state != AddressState::Quote && !parser.is_escaped => {
parser.state_stack.push(parser.state);
if parser.state != AddressState::Comment {
add_token(&mut parser, stream, false);
parser.state = AddressState::Comment;
continue;
}
}
b')' if parser.state == AddressState::Comment && !parser.is_escaped => {
let new_state = parser.state_stack.pop().unwrap();
if parser.state != new_state {
add_token(&mut parser, stream, false);
parser.state = new_state;
continue;
}
}
b':' if parser.state == AddressState::Name && !parser.is_escaped => {
add_group(&mut parser);
add_token(&mut parser, stream, false);
add_group_details(&mut parser);
continue;
}
b';' if parser.state == AddressState::Name => {
add_token(&mut parser, stream, false);
add_address(&mut parser);
add_group(&mut parser);
continue;
}
_ => (),
}
if parser.is_escaped {
parser.is_escaped = false;
}
if parser.is_token_start {
parser.is_token_start = false;
}
if parser.token_start == 0 {
parser.token_start = stream.pos;
parser.token_end = parser.token_start;
} else {
parser.token_end = stream.pos;
}
}
add_address(&mut parser);
if parser.group_name.is_some() || !parser.result.is_empty() {
add_group(&mut parser);
if parser.result.len() > 1 {
HeaderValue::GroupList(parser.result)
} else {
HeaderValue::Group(parser.result.pop().unwrap())
}
} else if !parser.addresses.is_empty() {
if parser.addresses.len() > 1 {
HeaderValue::AddressList(parser.addresses)
} else {
HeaderValue::Address(parser.addresses.pop().unwrap())
}
} else {
HeaderValue::Empty
}
}
pub fn parse_address_local_part(addr: &str) -> Option<&str> {
let addr = addr.as_bytes();
let mut iter = addr.iter().enumerate();
@@ -486,8 +473,6 @@ pub fn parse_address_detail_part(addr: &str) -> Option<&str> {
mod tests {
#[test]
fn parse_addresses() {
use crate::parsers::fields::address::parse_address;
use super::*;
let inputs = [
@@ -1008,7 +993,7 @@ mod tests {
for input in inputs {
let str = input.0.to_string();
let result = parse_address(&mut MessageStream::new(str.as_bytes()));
let result = MessageStream::new(str.as_bytes()).parse_address();
let expected: HeaderValue = serde_yaml::from_str(input.1).unwrap_or(HeaderValue::Empty);
/*if input.0.len() >= 70 {
+416 -424
View File
@@ -12,8 +12,8 @@
use std::borrow::Cow;
use crate::{
decoders::{charsets::map::get_charset_decoder, encoded_word::decode_rfc2047, hex::decode_hex},
parsers::message::MessageStream,
decoders::{charsets::map::get_charset_decoder, hex::decode_hex},
parsers::MessageStream,
ContentType, HeaderValue,
};
@@ -55,476 +55,470 @@ struct ContentTypeParser<'x> {
is_token_start: bool,
}
#[inline(always)]
fn reset_parser(parser: &mut ContentTypeParser) {
parser.token_start = 0;
parser.is_token_start = true;
}
fn add_attribute<'x>(parser: &mut ContentTypeParser<'x>, stream: &MessageStream<'x>) -> bool {
if parser.token_start > 0 {
let mut attr = Some(String::from_utf8_lossy(
&stream.data[parser.token_start - 1..parser.token_end],
));
if !parser.is_lower_case {
attr.as_mut().unwrap().to_mut().make_ascii_lowercase();
parser.is_lower_case = true;
}
match parser.state {
ContentState::AttributeName => parser.attr_name = attr,
ContentState::Type => parser.c_type = attr,
ContentState::SubType => parser.c_subtype = attr,
_ => unreachable!(),
}
reset_parser(parser);
true
} else {
false
impl<'x> ContentTypeParser<'x> {
#[inline(always)]
fn reset_parser(&mut self) {
self.token_start = 0;
self.is_token_start = true;
}
}
fn add_attribute_parameter<'x>(parser: &mut ContentTypeParser<'x>, stream: &MessageStream<'x>) {
if parser.token_start > 0 {
let attr_part =
String::from_utf8_lossy(&stream.data[parser.token_start - 1..parser.token_end]);
fn add_attribute(&mut self, stream: &MessageStream<'x>) -> bool {
if self.token_start > 0 {
let mut attr = Some(String::from_utf8_lossy(
&stream.data[self.token_start - 1..self.token_end],
));
if parser.attr_charset.is_none() {
parser.attr_charset = attr_part.into();
} else {
let attr_name = parser
.attr_name
.as_ref()
.unwrap_or(&"unknown".into())
.clone()
+ "-language";
if !parser.attributes.iter().any(|(name, _)| name == &attr_name) {
parser.attributes.push((attr_name, attr_part));
} else {
parser.values.push("'".into());
parser.values.push(attr_part);
if !self.is_lower_case {
attr.as_mut().unwrap().to_mut().make_ascii_lowercase();
self.is_lower_case = true;
}
}
reset_parser(parser);
}
}
fn add_partial_value<'x>(
parser: &mut ContentTypeParser<'x>,
stream: &MessageStream<'x>,
to_cur_pos: bool,
) {
if parser.token_start > 0 {
let in_quote = parser.state == ContentState::AttributeQuotedValue;
parser.values.push(String::from_utf8_lossy(
&stream.data[parser.token_start - 1..if in_quote && to_cur_pos {
stream.pos - 1
} else {
parser.token_end
}],
));
if !in_quote {
parser.values.push(" ".into());
}
reset_parser(parser);
}
}
fn add_value<'x>(parser: &mut ContentTypeParser<'x>, stream: &MessageStream<'x>) {
if parser.attr_name.is_none() {
return;
}
let has_values = !parser.values.is_empty();
let value = if parser.token_start > 0 {
let value = &stream.data[parser.token_start - 1..parser.token_end];
Some(if !parser.remove_crlf {
String::from_utf8_lossy(value)
} else {
parser.remove_crlf = false;
match String::from_utf8(
value
.iter()
.filter(|&&ch| ch != b'\r' && ch != b'\n')
.copied()
.collect::<Vec<_>>(),
) {
Ok(value) => value.into(),
Err(err) => String::from_utf8_lossy(err.as_bytes()).into_owned().into(),
match self.state {
ContentState::AttributeName => self.attr_name = attr,
ContentState::Type => self.c_type = attr,
ContentState::SubType => self.c_subtype = attr,
_ => unreachable!(),
}
})
} else {
if !has_values {
self.reset_parser();
true
} else {
false
}
}
fn add_attribute_parameter(&mut self, stream: &MessageStream<'x>) {
if self.token_start > 0 {
let attr_part =
String::from_utf8_lossy(&stream.data[self.token_start - 1..self.token_end]);
if self.attr_charset.is_none() {
self.attr_charset = attr_part.into();
} else {
let attr_name =
self.attr_name.as_ref().unwrap_or(&"unknown".into()).clone() + "-language";
if !self.attributes.iter().any(|(name, _)| name == &attr_name) {
self.attributes.push((attr_name, attr_part));
} else {
self.values.push("'".into());
self.values.push(attr_part);
}
}
self.reset_parser();
}
}
fn add_partial_value(&mut self, stream: &MessageStream<'x>, to_cur_pos: bool) {
if self.token_start > 0 {
let in_quote = self.state == ContentState::AttributeQuotedValue;
self.values.push(String::from_utf8_lossy(
&stream.data[self.token_start - 1..if in_quote && to_cur_pos {
stream.offset() - 1
} else {
self.token_end
}],
));
if !in_quote {
self.values.push(" ".into());
}
self.reset_parser();
}
}
fn add_value(&mut self, stream: &MessageStream<'x>) {
if self.attr_name.is_none() {
return;
}
None
};
if !parser.is_continuation {
parser.attributes.push((
parser.attr_name.take().unwrap(),
if !has_values {
value.unwrap()
let has_values = !self.values.is_empty();
let value = if self.token_start > 0 {
let value = &stream.data[self.token_start - 1..self.token_end];
Some(if !self.remove_crlf {
String::from_utf8_lossy(value)
} else {
if let Some(value) = value {
parser.values.push(value);
self.remove_crlf = false;
match String::from_utf8(
value
.iter()
.filter(|&&ch| ch != b'\r' && ch != b'\n')
.copied()
.collect::<Vec<_>>(),
) {
Ok(value) => value.into(),
Err(err) => String::from_utf8_lossy(err.as_bytes()).into_owned().into(),
}
parser.values.concat().into()
},
));
} else {
let attr_name = parser.attr_name.take().unwrap();
let mut value = if let Some(value) = value {
if has_values {
Cow::from(parser.values.concat()) + value
} else {
value
}
})
} else {
parser.values.concat().into()
if !has_values {
return;
}
None
};
if parser.is_encoded_attribute {
if let (true, decoded_bytes) = decode_hex(value.as_bytes()) {
value = if let Some(decoder) = parser
.attr_charset
.as_ref()
.and_then(|c| get_charset_decoder(c.as_bytes()))
{
decoder(&decoded_bytes).into()
if !self.is_continuation {
self.attributes.push((
self.attr_name.take().unwrap(),
if !has_values {
value.unwrap()
} else {
String::from_utf8(decoded_bytes)
.unwrap_or_else(|e| String::from_utf8_lossy(e.as_bytes()).into_owned())
.into()
if let Some(value) = value {
self.values.push(value);
}
self.values.concat().into()
},
));
} else {
let attr_name = self.attr_name.take().unwrap();
let mut value = if let Some(value) = value {
if has_values {
Cow::from(self.values.concat()) + value
} else {
value
}
}
parser.is_encoded_attribute = false;
}
if parser.attr_position > 0 {
let continuation = (attr_name, parser.attr_position, value);
if let Some(continuations) = parser.continuations.as_mut() {
continuations.push(continuation);
} else {
parser.continuations = Some(vec![continuation]);
}
self.values.concat().into()
};
parser.attr_position = 0;
} else {
parser.attributes.push((attr_name, value));
}
parser.is_continuation = false;
parser.attr_charset = None;
}
if has_values {
parser.values.clear();
}
reset_parser(parser);
}
fn add_attr_position(parser: &mut ContentTypeParser, stream: &MessageStream) -> bool {
if parser.token_start > 0 {
parser.attr_position =
String::from_utf8_lossy(&stream.data[parser.token_start - 1..parser.token_end])
.parse()
.unwrap_or(0);
reset_parser(parser);
true
} else {
false
}
}
fn merge_continuations(parser: &mut ContentTypeParser) {
let continuations = parser.continuations.as_mut().unwrap();
continuations.sort();
for (key, _, value) in continuations.drain(..) {
if let Some((_, old_value)) = parser.attributes.iter_mut().find(|(name, _)| name == &key) {
*old_value = format!("{}{}", old_value.to_owned(), value).into();
} else {
parser.attributes.push((key, value));
}
}
}
pub fn parse_content_type<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut parser = ContentTypeParser {
state: ContentState::Type,
state_stack: Vec::new(),
c_type: None,
c_subtype: None,
attr_name: None,
attr_charset: None,
attr_position: 0,
attributes: Vec::new(),
values: Vec::new(),
continuations: None,
is_continuation: false,
is_encoded_attribute: false,
is_lower_case: true,
is_token_start: true,
is_escaped: false,
remove_crlf: false,
token_start: 0,
token_end: 0,
};
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b' ' | b'\t' => {
if !parser.is_token_start {
parser.is_token_start = true;
}
if let ContentState::AttributeQuotedValue = parser.state {
if parser.token_start == 0 {
parser.token_start = stream.pos;
parser.token_end = parser.token_start;
} else {
parser.token_end = stream.pos;
}
}
continue;
}
b'A'..=b'Z' => {
if parser.is_lower_case {
if let ContentState::Type
| ContentState::SubType
| ContentState::AttributeName = parser.state
if self.is_encoded_attribute {
if let (true, decoded_bytes) = decode_hex(value.as_bytes()) {
value = if let Some(decoder) = self
.attr_charset
.as_ref()
.and_then(|c| get_charset_decoder(c.as_bytes()))
{
parser.is_lower_case = false;
decoder(&decoded_bytes).into()
} else {
String::from_utf8(decoded_bytes)
.unwrap_or_else(|e| String::from_utf8_lossy(e.as_bytes()).into_owned())
.into()
}
}
self.is_encoded_attribute = false;
}
b'\n' => {
let next_is_space = matches!(stream.data.get(stream.pos), Some(b' ' | b'\t'));
match parser.state {
ContentState::Type | ContentState::AttributeName | ContentState::SubType => {
add_attribute(&mut parser, stream);
}
ContentState::AttributeValue => {
add_value(&mut parser, stream);
}
ContentState::AttributeQuotedValue => {
if next_is_space {
parser.remove_crlf = true;
continue;
} else {
add_value(&mut parser, stream);
}
}
_ => (),
}
if next_is_space {
parser.state = ContentState::AttributeName;
stream.pos += 1;
iter.next();
if !parser.is_token_start {
parser.is_token_start = true;
}
continue;
if self.attr_position > 0 {
let continuation = (attr_name, self.attr_position, value);
if let Some(continuations) = self.continuations.as_mut() {
continuations.push(continuation);
} else {
if parser.continuations.is_some() {
merge_continuations(&mut parser);
}
self.continuations = Some(vec![continuation]);
}
return if let Some(content_type) = parser.c_type {
HeaderValue::ContentType(ContentType {
c_type: content_type,
c_subtype: parser.c_subtype.take(),
attributes: if !parser.attributes.is_empty() {
Some(parser.attributes)
} else {
None
},
})
} else {
HeaderValue::Empty
};
}
self.attr_position = 0;
} else {
self.attributes.push((attr_name, value));
}
b'/' if parser.state == ContentState::Type => {
add_attribute(&mut parser, stream);
parser.state = ContentState::SubType;
continue;
}
b';' => match parser.state {
ContentState::Type | ContentState::SubType | ContentState::AttributeName => {
add_attribute(&mut parser, stream);
parser.state = ContentState::AttributeName;
continue;
}
ContentState::AttributeValue => {
if !parser.is_escaped {
add_value(&mut parser, stream);
parser.state = ContentState::AttributeName;
} else {
parser.is_escaped = false;
}
continue;
}
_ => (),
},
b'*' if parser.state == ContentState::AttributeName => {
if !parser.is_continuation {
parser.is_continuation = add_attribute(&mut parser, stream);
} else if !parser.is_encoded_attribute {
add_attr_position(&mut parser, stream);
parser.is_encoded_attribute = true;
} else {
// Malformed data, reset parser.
reset_parser(&mut parser);
}
continue;
}
b'=' => match parser.state {
ContentState::AttributeName => {
if !parser.is_continuation {
if !add_attribute(&mut parser, stream) {
continue;
}
} else if !parser.is_encoded_attribute {
/* If is_continuation=true && is_encoded_attribute=false,
the last character was a '*' which means encoding */
parser.is_encoded_attribute = !add_attr_position(&mut parser, stream);
} else {
reset_parser(&mut parser);
}
parser.state = ContentState::AttributeValue;
continue;
}
ContentState::AttributeValue | ContentState::AttributeQuotedValue
if parser.is_token_start =>
{
if let (d_bytes_read, Some(token)) = decode_rfc2047(stream, stream.pos) {
add_partial_value(&mut parser, stream, false);
parser.values.push(token.into());
stream.pos += d_bytes_read;
iter = stream.data[stream.pos..].iter();
continue;
}
}
_ => (),
},
b'\"' => match parser.state {
ContentState::AttributeValue => {
if !parser.is_token_start {
parser.is_token_start = true;
}
parser.state = ContentState::AttributeQuotedValue;
continue;
}
ContentState::AttributeQuotedValue => {
if !parser.is_escaped {
add_value(&mut parser, stream);
parser.state = ContentState::AttributeName;
continue;
} else {
parser.is_escaped = false;
}
}
_ => continue,
},
b'\\' => match parser.state {
ContentState::AttributeQuotedValue | ContentState::AttributeValue => {
if !parser.is_escaped {
add_partial_value(&mut parser, stream, true);
parser.is_escaped = true;
continue;
} else {
parser.is_escaped = false;
}
}
ContentState::Comment => parser.is_escaped = !parser.is_escaped,
_ => continue,
},
b'\''
if parser.is_encoded_attribute
&& !parser.is_escaped
&& (parser.state == ContentState::AttributeValue
|| parser.state == ContentState::AttributeQuotedValue) =>
self.is_continuation = false;
self.attr_charset = None;
}
if has_values {
self.values.clear();
}
self.reset_parser();
}
fn add_attr_position(&mut self, stream: &MessageStream) -> bool {
if self.token_start > 0 {
self.attr_position =
String::from_utf8_lossy(&stream.data[self.token_start - 1..self.token_end])
.parse()
.unwrap_or(0);
self.reset_parser();
true
} else {
false
}
}
fn merge_continuations(&mut self) {
let continuations = self.continuations.as_mut().unwrap();
continuations.sort();
for (key, _, value) in continuations.drain(..) {
if let Some((_, old_value)) = self.attributes.iter_mut().find(|(name, _)| name == &key)
{
add_attribute_parameter(&mut parser, stream);
continue;
*old_value = format!("{}{}", old_value.to_owned(), value).into();
} else {
self.attributes.push((key, value));
}
b'(' if parser.state != ContentState::AttributeQuotedValue => {
if !parser.is_escaped {
}
}
}
impl<'x> MessageStream<'x> {
pub fn parse_content_type(&mut self) -> HeaderValue<'x> {
let mut parser = ContentTypeParser {
state: ContentState::Type,
state_stack: Vec::new(),
c_type: None,
c_subtype: None,
attr_name: None,
attr_charset: None,
attr_position: 0,
attributes: Vec::new(),
values: Vec::new(),
continuations: None,
is_continuation: false,
is_encoded_attribute: false,
is_lower_case: true,
is_token_start: true,
is_escaped: false,
remove_crlf: false,
token_start: 0,
token_end: 0,
};
while let Some(ch) = self.next() {
match ch {
b' ' | b'\t' => {
if !parser.is_token_start {
parser.is_token_start = true;
}
if let ContentState::AttributeQuotedValue = parser.state {
if parser.token_start == 0 {
parser.token_start = self.offset();
parser.token_end = parser.token_start;
} else {
parser.token_end = self.offset();
}
}
continue;
}
b'A'..=b'Z' => {
if parser.is_lower_case {
if let ContentState::Type
| ContentState::SubType
| ContentState::AttributeName = parser.state
{
parser.is_lower_case = false;
}
}
}
b'\n' => {
let next_is_space = self.peek_next_is_space();
match parser.state {
ContentState::Type
| ContentState::AttributeName
| ContentState::SubType => {
add_attribute(&mut parser, stream);
parser.add_attribute(self);
}
ContentState::AttributeValue => {
add_value(&mut parser, stream);
parser.add_value(self);
}
ContentState::AttributeQuotedValue => {
if next_is_space {
parser.remove_crlf = true;
continue;
} else {
parser.add_value(self);
}
}
_ => (),
}
parser.state_stack.push(parser.state);
parser.state = ContentState::Comment;
} else {
parser.is_escaped = false;
if next_is_space {
parser.state = ContentState::AttributeName;
self.next();
if !parser.is_token_start {
parser.is_token_start = true;
}
continue;
} else {
if parser.continuations.is_some() {
parser.merge_continuations();
}
return if let Some(content_type) = parser.c_type {
HeaderValue::ContentType(ContentType {
c_type: content_type,
c_subtype: parser.c_subtype.take(),
attributes: if !parser.attributes.is_empty() {
Some(parser.attributes)
} else {
None
},
})
} else {
HeaderValue::Empty
};
}
}
continue;
}
b')' if parser.state == ContentState::Comment => {
if !parser.is_escaped {
parser.state = parser.state_stack.pop().unwrap();
reset_parser(&mut parser);
} else {
parser.is_escaped = false;
b'/' if parser.state == ContentState::Type => {
parser.add_attribute(self);
parser.state = ContentState::SubType;
continue;
}
continue;
b';' => match parser.state {
ContentState::Type | ContentState::SubType | ContentState::AttributeName => {
parser.add_attribute(self);
parser.state = ContentState::AttributeName;
continue;
}
ContentState::AttributeValue => {
if !parser.is_escaped {
parser.add_value(self);
parser.state = ContentState::AttributeName;
} else {
parser.is_escaped = false;
}
continue;
}
_ => (),
},
b'*' if parser.state == ContentState::AttributeName => {
if !parser.is_continuation {
parser.is_continuation = parser.add_attribute(self);
} else if !parser.is_encoded_attribute {
parser.add_attr_position(self);
parser.is_encoded_attribute = true;
} else {
// Malformed data, reset parser.
parser.reset_parser();
}
continue;
}
b'=' => match parser.state {
ContentState::AttributeName => {
if !parser.is_continuation {
if !parser.add_attribute(self) {
continue;
}
} else if !parser.is_encoded_attribute {
/* If is_continuation=true && is_encoded_attribute=false,
the last character was a '*' which means encoding */
parser.is_encoded_attribute = !parser.add_attr_position(self);
} else {
parser.reset_parser();
}
parser.state = ContentState::AttributeValue;
continue;
}
ContentState::AttributeValue | ContentState::AttributeQuotedValue
if parser.is_token_start && self.peek_char(b'?') =>
{
self.checkpoint();
if let Some(token) = self.decode_rfc2047() {
parser.add_partial_value(self, false);
parser.values.push(token.into());
continue;
}
self.restore();
}
_ => (),
},
b'\"' => match parser.state {
ContentState::AttributeValue => {
if !parser.is_token_start {
parser.is_token_start = true;
}
parser.state = ContentState::AttributeQuotedValue;
continue;
}
ContentState::AttributeQuotedValue => {
if !parser.is_escaped {
parser.add_value(self);
parser.state = ContentState::AttributeName;
continue;
} else {
parser.is_escaped = false;
}
}
_ => continue,
},
b'\\' => match parser.state {
ContentState::AttributeQuotedValue | ContentState::AttributeValue => {
if !parser.is_escaped {
parser.add_partial_value(self, true);
parser.is_escaped = true;
continue;
} else {
parser.is_escaped = false;
}
}
ContentState::Comment => parser.is_escaped = !parser.is_escaped,
_ => continue,
},
b'\''
if parser.is_encoded_attribute
&& !parser.is_escaped
&& (parser.state == ContentState::AttributeValue
|| parser.state == ContentState::AttributeQuotedValue) =>
{
parser.add_attribute_parameter(self);
continue;
}
b'(' if parser.state != ContentState::AttributeQuotedValue => {
if !parser.is_escaped {
match parser.state {
ContentState::Type
| ContentState::AttributeName
| ContentState::SubType => {
parser.add_attribute(self);
}
ContentState::AttributeValue => {
parser.add_value(self);
}
_ => (),
}
parser.state_stack.push(parser.state);
parser.state = ContentState::Comment;
} else {
parser.is_escaped = false;
}
continue;
}
b')' if parser.state == ContentState::Comment => {
if !parser.is_escaped {
parser.state = parser.state_stack.pop().unwrap();
parser.reset_parser();
} else {
parser.is_escaped = false;
}
continue;
}
b'\r' => continue,
_ => (),
}
if parser.is_escaped {
parser.is_escaped = false;
}
if parser.is_token_start {
parser.is_token_start = false;
}
if parser.token_start == 0 {
parser.token_start = self.offset();
parser.token_end = parser.token_start;
} else {
parser.token_end = self.offset();
}
b'\r' => continue,
_ => (),
}
if parser.is_escaped {
parser.is_escaped = false;
}
if parser.is_token_start {
parser.is_token_start = false;
}
if parser.token_start == 0 {
parser.token_start = stream.pos;
parser.token_end = parser.token_start;
} else {
parser.token_end = stream.pos;
}
HeaderValue::Empty
}
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
use std::{borrow::Cow, collections::HashMap};
use serde::{Deserialize, Serialize};
use crate::{parsers::message::MessageStream, HeaderValue};
use crate::{parsers::MessageStream, HeaderValue};
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug)]
pub struct ContentTypeMap<'x> {
@@ -541,8 +535,6 @@ mod tests {
#[test]
fn parse_content_fields() {
use super::parse_content_type;
let inputs =
[
(
@@ -1571,7 +1563,7 @@ mod tests {
let str = input.0.to_string();
// TODO: Redo tests without using hashmaps.
let result = match parse_content_type(&mut MessageStream::new(str.as_bytes())) {
let result = match MessageStream::new(str.as_bytes()).parse_content_type() {
HeaderValue::ContentType(ct) => HeaderValueMap::ContentType(ContentTypeMap {
c_type: ct.c_type,
c_subtype: ct.c_subtype,
+118 -129
View File
@@ -11,15 +11,12 @@
use std::fmt;
use crate::{parsers::message::MessageStream, DateTime, HeaderValue};
use crate::{parsers::MessageStream, DateTime, HeaderValue};
impl DateTime {
/// Parses an RFC822 date
pub fn parse_rfc822(&self, value: &str) -> Option<Self> {
match parse_date(&mut MessageStream {
data: value.as_bytes(),
pos: 0,
}) {
match MessageStream::new(value.as_bytes()).parse_date() {
HeaderValue::DateTime(dt) => dt.into(),
_ => None,
}
@@ -107,142 +104,137 @@ impl fmt::Display for DateTime {
}
}
pub fn parse_date<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut pos = 0;
let mut parts = [0u32; 7];
let mut parts_sizes = [
2u32, // Day (0)
2u32, // Month (1)
4u32, // Year (2)
2u32, // Hour (3)
2u32, // Minute (4)
2u32, // Second (5)
4u32, // TZ (6)
];
let mut month_hash: usize = 0;
let mut month_pos: usize = 0;
impl<'x> MessageStream<'x> {
pub fn parse_date(&mut self) -> HeaderValue<'x> {
let mut pos = 0;
let mut parts = [0u32; 7];
let mut parts_sizes = [
2u32, // Day (0)
2u32, // Month (1)
4u32, // Year (2)
2u32, // Hour (3)
2u32, // Minute (4)
2u32, // Second (5)
4u32, // TZ (6)
];
let mut month_hash: usize = 0;
let mut month_pos: usize = 0;
let mut is_plus = true;
let mut is_new_token = true;
let mut ignore = true;
let mut comment_count = 0;
let mut is_plus = true;
let mut is_new_token = true;
let mut ignore = true;
let mut comment_count = 0;
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = self.next() {
let mut next_part = false;
while let Some(ch) = iter.next() {
let mut next_part = false;
stream.pos += 1;
match ch {
b'\n' => match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
iter.next();
stream.pos += 1;
if !is_new_token && !ignore && comment_count == 0 {
next_part = true;
match ch {
b'\n' => {
if self.try_next_is_space() {
if !is_new_token && !ignore && comment_count == 0 {
next_part = true;
} else {
continue;
}
} else {
continue;
break;
}
}
_ => break,
},
_ if comment_count > 0 => {
if *ch == b')' {
comment_count -= 1;
} else if *ch == b'(' {
_ if comment_count > 0 => {
if *ch == b')' {
comment_count -= 1;
} else if *ch == b'(' {
comment_count += 1;
} else if *ch == b'\\' {
self.try_skip_char(b')');
}
continue;
}
b'0'..=b'9' => {
if pos < 7 && parts_sizes[pos] > 0 {
parts_sizes[pos] -= 1;
parts[pos] += (*ch - b'0') as u32 * u32::pow(10, parts_sizes[pos]);
if ignore {
ignore = false;
}
}
if is_new_token {
is_new_token = false;
}
}
b':' => {
if !is_new_token && !ignore && (pos == 3 || pos == 4) {
next_part = true;
}
}
b'+' => {
pos = 6;
}
b'-' => {
is_plus = false;
pos = 6;
}
b' ' | b'\t' => {
if !is_new_token && !ignore {
next_part = true;
}
}
b'a'..=b'z' | b'A'..=b'Z' => {
if pos == 1 {
if (1..=2).contains(&month_pos) {
month_hash += MONTH_HASH
[(if *ch <= b'Z' { *ch + 32 } else { *ch }) as usize]
as usize;
}
month_pos += 1;
}
if is_new_token {
is_new_token = false;
}
}
b'(' => {
comment_count += 1;
} else if *ch == b'\\' {
if let Some(b')') = stream.data.get(stream.pos) {
stream.pos += 1;
}
is_new_token = true;
continue;
}
continue;
b',' | b'\r' => (),
_ => (),
}
b'0'..=b'9' => {
if next_part {
if pos < 7 && parts_sizes[pos] > 0 {
parts_sizes[pos] -= 1;
parts[pos] += (*ch - b'0') as u32 * u32::pow(10, parts_sizes[pos]);
if ignore {
ignore = false;
}
parts[pos] /= u32::pow(10, parts_sizes[pos]);
}
if is_new_token {
is_new_token = false;
}
}
b':' => {
if !is_new_token && !ignore && (pos == 3 || pos == 4) {
next_part = true;
}
}
b'+' => {
pos = 6;
}
b'-' => {
is_plus = false;
pos = 6;
}
b' ' | b'\t' => {
if !is_new_token && !ignore {
next_part = true;
}
}
b'a'..=b'z' | b'A'..=b'Z' => {
if pos == 1 {
if (1..=2).contains(&month_pos) {
month_hash += MONTH_HASH
[(if *ch <= b'Z' { *ch + 32 } else { *ch }) as usize]
as usize;
}
month_pos += 1;
}
if is_new_token {
is_new_token = false;
}
}
b'(' => {
comment_count += 1;
pos += 1;
is_new_token = true;
continue;
}
b',' | b'\r' => (),
_ => (),
}
if next_part {
if pos < 7 && parts_sizes[pos] > 0 {
parts[pos] /= u32::pow(10, parts_sizes[pos]);
}
pos += 1;
is_new_token = true;
if pos >= 6 {
HeaderValue::DateTime(DateTime {
year: if (1..=99).contains(&parts[2]) {
parts[2] + 1900
} else {
parts[2]
} as u16,
month: if month_pos == 3 && month_hash <= 30 {
MONTH_MAP[month_hash] as u8
} else {
parts[1] as u8
},
day: parts[0] as u8,
hour: parts[3] as u8,
minute: parts[4] as u8,
second: parts[5] as u8,
tz_hour: (parts[6] / 100) as u8,
tz_minute: (parts[6] % 100) as u8,
tz_before_gmt: !is_plus,
})
} else {
HeaderValue::Empty
}
}
if pos >= 6 {
HeaderValue::DateTime(DateTime {
year: if (1..=99).contains(&parts[2]) {
parts[2] + 1900
} else {
parts[2]
} as u16,
month: if month_pos == 3 && month_hash <= 30 {
MONTH_MAP[month_hash] as u8
} else {
parts[1] as u8
},
day: parts[0] as u8,
hour: parts[3] as u8,
minute: parts[4] as u8,
second: parts[5] as u8,
tz_hour: (parts[6] / 100) as u8,
tz_minute: (parts[6] % 100) as u8,
tz_before_gmt: !is_plus,
})
} else {
HeaderValue::Empty
}
}
static MONTH_HASH: &[u8] = &[
@@ -267,10 +259,7 @@ pub static MONTH_MAP: &[u8; 31] = &[
mod tests {
use chrono::{FixedOffset, LocalResult, SecondsFormat, TimeZone, Utc};
use crate::{
parsers::{fields::date::parse_date, message::MessageStream},
HeaderValue,
};
use crate::{parsers::MessageStream, HeaderValue};
#[test]
fn parse_dates() {
@@ -335,7 +324,7 @@ mod tests {
];
for (input, expected_result) in inputs {
match parse_date(&mut MessageStream::new(input.as_bytes())) {
match MessageStream::new(input.as_bytes()).parse_date() {
HeaderValue::DateTime(datetime) => {
assert_eq!(expected_result, datetime.to_rfc3339());
+57 -64
View File
@@ -9,82 +9,75 @@
* except according to those terms.
*/
use crate::{parsers::message::MessageStream, HeaderValue};
use crate::{parsers::MessageStream, HeaderValue};
pub fn parse_id<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
let mut token_invalid_start: usize = 0; // Handle broken clients
let mut token_invalid_end: usize = 0; // Handle broken clients
let mut is_id_part = false;
let mut ids = Vec::new();
impl<'x> MessageStream<'x> {
pub fn parse_id(&mut self) -> HeaderValue<'x> {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
let mut token_invalid_start: usize = 0; // Handle broken clients
let mut token_invalid_end: usize = 0; // Handle broken clients
let mut is_id_part = false;
let mut ids = Vec::new();
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
iter.next();
stream.pos += 1;
continue;
}
_ => {
return match ids.len() {
1 => HeaderValue::Text(ids.pop().unwrap()),
0 => {
if token_invalid_start > 0 {
HeaderValue::Text(String::from_utf8_lossy(
&stream.data[token_invalid_start - 1..token_invalid_end],
))
} else {
HeaderValue::Empty
while let Some(&ch) = self.next() {
match ch {
b'\n' => {
if !self.try_next_is_space() {
return match ids.len() {
1 => HeaderValue::Text(ids.pop().unwrap()),
0 => {
if token_invalid_start > 0 {
HeaderValue::Text(String::from_utf8_lossy(
self.get_bytes(token_invalid_start - 1..token_invalid_end),
))
} else {
HeaderValue::Empty
}
}
}
_ => HeaderValue::TextList(ids),
};
_ => HeaderValue::TextList(ids),
};
} else {
continue;
}
}
},
b'<' => {
is_id_part = true;
continue;
}
b'>' => {
is_id_part = false;
if token_start > 0 {
ids.push(String::from_utf8_lossy(
&stream.data[token_start - 1..token_end],
));
token_start = 0;
} else {
b'<' => {
is_id_part = true;
continue;
}
b'>' => {
is_id_part = false;
if token_start > 0 {
ids.push(String::from_utf8_lossy(
self.get_bytes(token_start - 1..token_end),
));
token_start = 0;
} else {
continue;
}
}
b' ' | b'\t' | b'\r' => continue,
_ => {}
}
b' ' | b'\t' | b'\r' => continue,
_ => {}
}
if is_id_part {
if token_start == 0 {
token_start = stream.pos;
if is_id_part {
if token_start == 0 {
token_start = self.offset();
}
token_end = self.offset();
} else {
if token_invalid_start == 0 {
token_invalid_start = self.offset();
}
token_invalid_end = self.offset();
}
token_end = stream.pos;
} else {
if token_invalid_start == 0 {
token_invalid_start = stream.pos;
}
token_invalid_end = stream.pos;
}
HeaderValue::Empty
}
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
use crate::parsers::fields::id::parse_id;
use crate::parsers::message::MessageStream;
use crate::HeaderValue;
use crate::{parsers::MessageStream, HeaderValue};
#[test]
fn parse_message_ids() {
@@ -132,7 +125,7 @@ mod tests {
for input in inputs {
let str = input.0.to_string();
match parse_id(&mut MessageStream::new(str.as_bytes())) {
match MessageStream::new(str.as_bytes()).parse_id() {
HeaderValue::TextList(ids) => {
assert_eq!(ids, input.1, "Failed to parse '{:?}'", input.0);
}
+77 -88
View File
@@ -11,7 +11,7 @@
use std::borrow::Cow;
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, HeaderValue};
use crate::{parsers::MessageStream, HeaderValue};
struct ListParser<'x> {
token_start: usize,
@@ -21,116 +21,105 @@ struct ListParser<'x> {
list: Vec<Cow<'x, str>>,
}
fn add_token<'x>(parser: &mut ListParser<'x>, stream: &MessageStream<'x>, add_space: bool) {
if parser.token_start > 0 {
if !parser.tokens.is_empty() {
parser.tokens.push(" ".into());
}
parser.tokens.push(String::from_utf8_lossy(
&stream.data[parser.token_start - 1..parser.token_end],
));
impl<'x> ListParser<'x> {
fn add_token(&mut self, stream: &MessageStream<'x>, add_space: bool) {
if self.token_start > 0 {
if !self.tokens.is_empty() {
self.tokens.push(" ".into());
}
self.tokens.push(String::from_utf8_lossy(
&stream.data[self.token_start - 1..self.token_end],
));
if add_space {
parser.tokens.push(" ".into());
}
if add_space {
self.tokens.push(" ".into());
}
parser.token_start = 0;
parser.is_token_start = true;
self.token_start = 0;
self.is_token_start = true;
}
}
fn add_tokens_to_list(&mut self) {
if !self.tokens.is_empty() {
self.list.push(if self.tokens.len() == 1 {
self.tokens.pop().unwrap()
} else {
let value = self.tokens.concat();
self.tokens.clear();
value.into()
});
}
}
}
fn add_tokens_to_list(parser: &mut ListParser) {
if !parser.tokens.is_empty() {
parser.list.push(if parser.tokens.len() == 1 {
parser.tokens.pop().unwrap()
} else {
let value = parser.tokens.concat();
parser.tokens.clear();
value.into()
});
}
}
impl<'x> MessageStream<'x> {
pub fn parse_comma_separared(&mut self) -> HeaderValue<'x> {
let mut parser = ListParser {
token_start: 0,
token_end: 0,
is_token_start: true,
tokens: Vec::new(),
list: Vec::new(),
};
pub fn parse_comma_separared<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut parser = ListParser {
token_start: 0,
token_end: 0,
is_token_start: true,
tokens: Vec::new(),
list: Vec::new(),
};
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => {
add_token(&mut parser, stream, false);
match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
if !parser.is_token_start {
parser.is_token_start = true;
}
iter.next();
stream.pos += 1;
continue;
}
_ => {
add_tokens_to_list(&mut parser);
while let Some(ch) = self.next() {
match ch {
b'\n' => {
parser.add_token(self, false);
if !self.try_next_is_space() {
parser.add_tokens_to_list();
return match parser.list.len() {
1 => HeaderValue::Text(parser.list.pop().unwrap()),
0 => HeaderValue::Empty,
_ => HeaderValue::TextList(parser.list),
};
} else {
continue;
}
}
}
b' ' | b'\t' => {
if !parser.is_token_start {
parser.is_token_start = true;
}
continue;
}
b'=' if parser.is_token_start => {
if let (bytes_read, Some(token)) = decode_rfc2047(stream, stream.pos) {
add_token(&mut parser, stream, true);
parser.tokens.push(token.into());
stream.pos += bytes_read;
iter = stream.data[stream.pos..].iter();
b' ' | b'\t' => {
if !parser.is_token_start {
parser.is_token_start = true;
}
continue;
}
b'=' if parser.is_token_start && self.peek_char(b'?') => {
self.checkpoint();
if let Some(token) = self.decode_rfc2047() {
parser.add_token(self, true);
parser.tokens.push(token.into());
continue;
}
self.restore();
}
b',' => {
parser.add_token(self, false);
parser.add_tokens_to_list();
continue;
}
b'\r' => continue,
_ => (),
}
b',' => {
add_token(&mut parser, stream, false);
add_tokens_to_list(&mut parser);
continue;
if parser.is_token_start {
parser.is_token_start = false;
}
b'\r' => continue,
_ => (),
if parser.token_start == 0 {
parser.token_start = self.offset();
}
parser.token_end = self.offset();
}
if parser.is_token_start {
parser.is_token_start = false;
}
if parser.token_start == 0 {
parser.token_start = stream.pos;
}
parser.token_end = stream.pos;
HeaderValue::Empty
}
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
use crate::parsers::fields::list::parse_comma_separared;
use crate::parsers::message::MessageStream;
use crate::HeaderValue;
use crate::{parsers::MessageStream, HeaderValue};
#[test]
fn parse_comma_separated_text() {
@@ -174,7 +163,7 @@ mod tests {
for input in inputs {
let str = input.0.to_string();
match parse_comma_separared(&mut MessageStream::new(str.as_bytes())) {
match MessageStream::new(str.as_bytes()).parse_comma_separared() {
HeaderValue::TextList(ids) => {
assert_eq!(ids, input.1, "Failed to parse '{:?}'", input.0);
}
+34 -51
View File
@@ -9,61 +9,46 @@
* except according to those terms.
*/
use crate::{parsers::message::MessageStream, HeaderValue};
use crate::{parsers::MessageStream, HeaderValue};
pub fn parse_raw<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
impl<'x> MessageStream<'x> {
pub fn parse_raw(&mut self) -> HeaderValue<'x> {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
iter.next();
stream.pos += 1;
continue;
}
_ => {
return if token_start > 0 {
HeaderValue::Text(String::from_utf8_lossy(
&stream.data[token_start - 1..token_end],
))
while let Some(ch) = self.next() {
match ch {
b'\n' => {
if !self.try_next_is_space() {
return if token_start > 0 {
HeaderValue::Text(String::from_utf8_lossy(
self.get_bytes(token_start - 1..token_end),
))
} else {
HeaderValue::Empty
};
} else {
HeaderValue::Empty
};
continue;
}
}
},
b' ' | b'\t' | b'\r' => continue,
_ => (),
b' ' | b'\t' | b'\r' => continue,
_ => (),
}
if token_start == 0 {
token_start = self.offset();
}
token_end = self.offset();
}
if token_start == 0 {
token_start = stream.pos;
}
token_end = stream.pos;
HeaderValue::Empty
}
HeaderValue::Empty
}
pub fn parse_and_ignore(stream: &mut MessageStream) {
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = iter.next() {
stream.pos += 1;
if ch == &b'\n' {
match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
iter.next();
stream.pos += 1;
continue;
}
_ => break,
pub fn parse_and_ignore(&mut self) {
while let Some(&ch) = self.next() {
if ch == b'\n' && !self.try_next_is_space() {
break;
}
}
}
@@ -71,9 +56,7 @@ pub fn parse_and_ignore(stream: &mut MessageStream) {
#[cfg(test)]
mod tests {
use crate::parsers::fields::raw::parse_raw;
use crate::parsers::message::MessageStream;
use crate::Message;
use crate::{parsers::MessageStream, Message};
#[test]
fn parse_raw_text() {
@@ -97,7 +80,7 @@ mod tests {
for input in inputs {
let str = input.0.to_string();
assert_eq!(
parse_raw(&mut MessageStream::new(str.as_bytes())).unwrap_text(),
MessageStream::new(str.as_bytes()).parse_raw().unwrap_text(),
input.1,
"Failed for '{:?}'",
input.0
+52 -54
View File
@@ -11,91 +11,87 @@
use std::borrow::Cow;
use crate::{decoders::encoded_word::decode_rfc2047, parsers::message::MessageStream, HeaderValue};
use crate::{parsers::MessageStream, HeaderValue};
struct UnstructuredParser<'x> {
token_start: usize,
token_end: usize,
tokens: Vec<Cow<'x, str>>,
}
fn add_token<'x>(parser: &mut UnstructuredParser<'x>, stream: &MessageStream<'x>, add_space: bool) {
if parser.token_start > 0 {
if !parser.tokens.is_empty() {
parser.tokens.push(" ".into());
}
parser.tokens.push(String::from_utf8_lossy(
&stream.data[parser.token_start - 1..parser.token_end],
));
impl<'x> UnstructuredParser<'x> {
fn add_token(&mut self, stream: &MessageStream<'x>, add_space: bool) {
if self.token_start > 0 {
if !self.tokens.is_empty() {
self.tokens.push(" ".into());
}
self.tokens.push(String::from_utf8_lossy(
stream.get_bytes(self.token_start - 1..self.token_end),
));
if add_space {
parser.tokens.push(" ".into());
}
if add_space {
self.tokens.push(" ".into());
}
parser.token_start = 0;
self.token_start = 0;
}
}
}
pub fn parse_unstructured<'x>(stream: &mut MessageStream<'x>) -> HeaderValue<'x> {
let mut parser = UnstructuredParser {
token_start: 0,
token_end: 0,
tokens: Vec::new(),
};
impl<'x> MessageStream<'x> {
pub fn parse_unstructured(&mut self) -> HeaderValue<'x> {
let mut parser = UnstructuredParser {
token_start: 0,
token_end: 0,
tokens: Vec::new(),
};
let mut iter = stream.data[stream.pos..].iter();
while let Some(ch) = self.next() {
match ch {
b'\n' => {
parser.add_token(self, false);
while let Some(ch) = iter.next() {
stream.pos += 1;
match ch {
b'\n' => {
add_token(&mut parser, stream, false);
match stream.data.get(stream.pos) {
Some(b' ' | b'\t') => {
iter.next();
stream.pos += 1;
continue;
}
_ => {
if !self.try_next_is_space() {
return match parser.tokens.len() {
1 => HeaderValue::Text(parser.tokens.pop().unwrap()),
0 => HeaderValue::Empty,
_ => HeaderValue::Text(parser.tokens.concat().into()),
};
} else {
continue;
}
}
}
b' ' | b'\t' | b'\r' => {
continue;
}
b'=' => {
if let (bytes_read, Some(token)) = decode_rfc2047(stream, stream.pos) {
add_token(&mut parser, stream, true);
parser.tokens.push(token.into());
stream.pos += bytes_read;
iter = stream.data[stream.pos..].iter();
b' ' | b'\t' | b'\r' => {
continue;
}
b'=' if self.peek_char(b'?') => {
self.checkpoint();
if let Some(token) = self.decode_rfc2047() {
parser.add_token(self, true);
parser.tokens.push(token.into());
continue;
}
self.restore();
}
_ => (),
}
_ => (),
if parser.token_start == 0 {
parser.token_start = self.offset();
}
parser.token_end = self.offset();
}
if parser.token_start == 0 {
parser.token_start = stream.pos;
}
parser.token_end = stream.pos;
HeaderValue::Empty
}
HeaderValue::Empty
}
#[cfg(test)]
mod tests {
use crate::parsers::MessageStream;
#[test]
fn parse_unstructured() {
use crate::parsers::message::MessageStream;
let inputs = [
("Saying Hello\n", "Saying Hello", true),
("Re: Saying Hello\r\n", "Re: Saying Hello", true),
@@ -195,7 +191,9 @@ mod tests {
for (input, expected_result, _) in inputs {
assert_eq!(
super::parse_unstructured(&mut MessageStream::new(input.as_bytes()),).unwrap_text(),
MessageStream::new(input.as_bytes())
.parse_unstructured()
.unwrap_text(),
expected_result,
"Failed to parse '{:?}'",
input
+209 -205
View File
@@ -9,154 +9,172 @@
* except according to those terms.
*/
use std::borrow::Cow;
use crate::{Header, HeaderName, HeaderValue, RfcHeader};
use super::{
fields::{
address::parse_address,
content_type::parse_content_type,
date::parse_date,
id::parse_id,
list::parse_comma_separared,
raw::{parse_and_ignore, parse_raw},
unstructured::parse_unstructured,
},
message::MessageStream,
};
use super::MessageStream;
#[derive(Debug, PartialEq, Eq)]
pub enum HeaderParserResult<'x> {
Rfc(RfcHeader),
Other(Cow<'x, str>),
Lf,
Eof,
}
impl<'x> MessageStream<'x> {
pub fn parse_headers(&mut self, headers: &mut Vec<Header<'x>>) -> bool {
loop {
loop {
match self.peek() {
Some(b'\n') => {
self.next();
return true;
}
None => return false,
Some(ch) if !ch.is_ascii_whitespace() => {
break;
}
_ => {
self.next();
}
}
}
pub fn parse_headers<'x>(headers: &mut Vec<Header<'x>>, stream: &mut MessageStream<'x>) -> bool {
loop {
let offset_field = stream.pos;
let (bytes_read, result) = parse_header_name(&stream.data[stream.pos..]);
stream.pos += bytes_read;
let offset_field = self.offset();
match result {
HeaderParserResult::Rfc(name) => {
let (_, parser) = {
if let Some(header_name) = self.parse_header_name() {
if let HeaderName::Rfc(rfc_name) = &header_name {
let from_offset = self.offset();
let value = match rfc_name {
RfcHeader::Subject
| RfcHeader::Comments
| RfcHeader::ContentDescription
| RfcHeader::ContentLocation
| RfcHeader::ContentTransferEncoding => self.parse_unstructured(),
RfcHeader::From
| RfcHeader::To
| RfcHeader::Cc
| RfcHeader::Bcc
| RfcHeader::ReplyTo
| RfcHeader::Sender
| RfcHeader::ResentTo
| RfcHeader::ResentFrom
| RfcHeader::ResentBcc
| RfcHeader::ResentCc
| RfcHeader::ResentSender
| RfcHeader::ListArchive
| RfcHeader::ListHelp
| RfcHeader::ListId
| RfcHeader::ListOwner
| RfcHeader::ListPost
| RfcHeader::ListSubscribe
| RfcHeader::ListUnsubscribe => self.parse_address(),
RfcHeader::Date | RfcHeader::ResentDate => self.parse_date(),
RfcHeader::MessageId
| RfcHeader::References
| RfcHeader::InReplyTo
| RfcHeader::ReturnPath
| RfcHeader::ContentId
| RfcHeader::ResentMessageId => self.parse_id(),
RfcHeader::Keywords | RfcHeader::ContentLanguage => {
self.parse_comma_separared()
}
RfcHeader::Received | RfcHeader::MimeVersion => self.parse_raw(),
RfcHeader::ContentType | RfcHeader::ContentDisposition => {
self.parse_content_type()
}
};
headers.push(Header {
name: header_name,
value,
offset_field,
offset_start: from_offset,
offset_end: self.offset(),
});
} else {
let from_offset = self.offset();
self.parse_and_ignore();
headers.push(Header {
name: header_name,
value: HeaderValue::Text(String::from_utf8_lossy(
self.get_bytes(from_offset..self.offset()),
)),
offset_field,
offset_start: from_offset,
offset_end: self.offset(),
});
}
} else if self.is_eof() {
return false;
}
}
}
pub fn parse_header_name(&mut self) -> Option<HeaderName<'x>> {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
let mut token_len: usize = 0;
let mut token_hash: usize = 0;
let mut last_ch: u8 = 0;
while let Some(&ch) = self.next() {
match ch {
b':' => {
if token_start != 0 {
break;
}
}
b'\n' => {
return None;
}
_ => {
if !ch.is_ascii_whitespace() {
if token_start == 0 {
token_start = self.offset();
token_end = token_start;
} else {
token_end = self.offset();
last_ch = ch;
}
if let 0 | 9 = token_len {
token_hash += {
#[cfg(feature = "ludicrous_mode")]
unsafe {
*HDR_HASH.get_unchecked(ch.to_ascii_lowercase() as usize)
}
#[cfg(not(feature = "ludicrous_mode"))]
HDR_HASH[ch.to_ascii_lowercase() as usize]
} as usize;
}
token_len += 1;
}
}
}
}
if token_start != 0 {
let field = self.get_bytes(token_start - 1..token_end);
if (2..=25).contains(&token_len) {
token_hash += token_len + {
#[cfg(feature = "ludicrous_mode")]
unsafe {
HDR_PARSER.get_unchecked(name as usize)
*HDR_HASH.get_unchecked(last_ch.to_ascii_lowercase() as usize)
}
#[cfg(not(feature = "ludicrous_mode"))]
HDR_PARSER[name as usize]
};
let from_offset = stream.pos;
HDR_HASH[last_ch.to_ascii_lowercase() as usize]
} as usize;
headers.push(Header {
name: HeaderName::Rfc(name),
value: parser(stream),
offset_field,
offset_start: from_offset,
offset_end: stream.pos,
});
}
HeaderParserResult::Other(name) => {
let from_offset = stream.pos;
parse_and_ignore(stream);
if (4..=72).contains(&token_hash) {
let token_hash = token_hash - 4;
headers.push(Header {
name: HeaderName::Other(name),
value: HeaderValue::Text(String::from_utf8_lossy(
&stream.data[from_offset..stream.pos],
)),
offset_field,
offset_start: from_offset,
offset_end: stream.pos,
});
}
HeaderParserResult::Lf => return true,
HeaderParserResult::Eof => return false,
}
}
}
pub fn parse_header_name(data: &[u8]) -> (usize, HeaderParserResult) {
let mut token_start: usize = 0;
let mut token_end: usize = 0;
let mut token_len: usize = 0;
let mut token_hash: usize = 0;
let mut last_ch: u8 = 0;
let mut bytes_read: usize = 0;
for &ch in data.iter() {
bytes_read += 1;
match ch {
b':' => {
if token_start != 0 {
break;
}
}
b'\n' => {
return (bytes_read - 1, HeaderParserResult::Lf);
}
_ => {
if !ch.is_ascii_whitespace() {
if token_start == 0 {
token_start = bytes_read;
token_end = token_start;
} else {
token_end = bytes_read;
last_ch = ch;
if field.eq_ignore_ascii_case(HDR_NAMES[token_hash]) {
return Some(HeaderName::Rfc(HDR_MAP[token_hash]));
}
if let 0 | 9 = token_len {
token_hash += {
#[cfg(feature = "ludicrous_mode")]
unsafe {
*HDR_HASH.get_unchecked(ch.to_ascii_lowercase() as usize)
}
#[cfg(not(feature = "ludicrous_mode"))]
HDR_HASH[ch.to_ascii_lowercase() as usize]
} as usize;
}
token_len += 1;
}
}
Some(HeaderName::Other(String::from_utf8_lossy(field)))
} else {
None
}
}
if token_start != 0 {
let field = &data[token_start - 1..token_end];
if (2..=25).contains(&token_len) {
token_hash += token_len + {
#[cfg(feature = "ludicrous_mode")]
unsafe {
*HDR_HASH.get_unchecked(last_ch.to_ascii_lowercase() as usize)
}
#[cfg(not(feature = "ludicrous_mode"))]
HDR_HASH[last_ch.to_ascii_lowercase() as usize]
} as usize;
if (4..=72).contains(&token_hash) {
let token_hash = token_hash - 4;
if field.eq_ignore_ascii_case(HDR_NAMES[token_hash]) {
return (bytes_read, HeaderParserResult::Rfc(HDR_MAP[token_hash]));
}
}
}
return (
bytes_read,
HeaderParserResult::Other(String::from_utf8_lossy(field)),
);
} else {
(bytes_read, HeaderParserResult::Eof)
}
}
impl RfcHeader {
@@ -210,95 +228,81 @@ impl From<RfcHeader> for u8 {
}
}
impl<'x> From<HeaderParserResult<'x>> for HeaderName<'x> {
fn from(result: HeaderParserResult<'x>) -> Self {
match result {
HeaderParserResult::Rfc(header) => HeaderName::Rfc(header),
HeaderParserResult::Other(header) => HeaderName::Other(header),
_ => HeaderName::Other("".into()),
}
}
}
#[cfg(test)]
mod tests {
use crate::{parsers::header::parse_header_name, RfcHeader};
use super::HeaderParserResult;
use crate::{parsers::MessageStream, HeaderName, RfcHeader};
#[test]
fn header_name_parse() {
let inputs = [
("From: ", HeaderParserResult::Rfc(RfcHeader::From)),
("receiVED: ", HeaderParserResult::Rfc(RfcHeader::Received)),
(" subject : ", HeaderParserResult::Rfc(RfcHeader::Subject)),
("From: ", HeaderName::Rfc(RfcHeader::From)),
("receiVED: ", HeaderName::Rfc(RfcHeader::Received)),
(" subject : ", HeaderName::Rfc(RfcHeader::Subject)),
(
"X-Custom-Field : ",
HeaderParserResult::Other("X-Custom-Field".into()),
),
(" T : ", HeaderParserResult::Other("T".into())),
(
"mal formed: ",
HeaderParserResult::Other("mal formed".into()),
),
(
"MIME-version : ",
HeaderParserResult::Rfc(RfcHeader::MimeVersion),
HeaderName::Other("X-Custom-Field".into()),
),
(" T : ", HeaderName::Other("T".into())),
("mal formed: ", HeaderName::Other("mal formed".into())),
("MIME-version : ", HeaderName::Rfc(RfcHeader::MimeVersion)),
];
for input in inputs {
let str = input.0.to_string();
let (_, result) = parse_header_name(str.as_bytes());
assert_eq!(input.1, result, "Failed to parse '{:?}'", input.0);
for (input, expected_result) in inputs {
assert_eq!(
expected_result,
MessageStream::new(input.as_bytes())
.parse_header_name()
.unwrap(),
"Failed to parse '{:?}'",
input
);
}
}
}
#[allow(clippy::type_complexity)]
static HDR_PARSER: &[(
bool,
for<'x, 'y> fn(&mut MessageStream<'x>) -> HeaderValue<'x>,
)] = &[
(false, parse_unstructured), // Subject = 0,
(false, parse_address), // From = 1,
(false, parse_address), // To = 2,
(false, parse_address), // Cc = 3,
(false, parse_date), // Date = 4,
(false, parse_address), // Bcc = 5,
(false, parse_address), // ReplyTo = 6,
(false, parse_address), // Sender = 7,
(true, parse_unstructured), // Comments = 8,
(false, parse_id), // InReplyTo = 9,
(true, parse_comma_separared), // Keywords = 10,
(true, parse_raw), // Received = 11,
(false, parse_id), // MessageId = 12,
(true, parse_id), // References = 13, (RFC 5322 recommends One)
(false, parse_id), // ReturnPath = 14,
(false, parse_raw), // MimeVersion = 15,
(false, parse_unstructured), // ContentDescription = 16,
(false, parse_id), // ContentId = 17,
(false, parse_comma_separared), // ContentLanguage = 18
(false, parse_unstructured), // ContentLocation = 19
(false, parse_unstructured), // ContentTransferEncoding = 20,
(false, parse_content_type), // ContentType = 21,
(false, parse_content_type), // ContentDisposition = 22,
(true, parse_address), // ResentTo = 23,
(true, parse_address), // ResentFrom = 24,
(true, parse_address), // ResentBcc = 25,
(true, parse_address), // ResentCc = 26,
(true, parse_address), // ResentSender = 27,
(true, parse_date), // ResentDate = 28,
(true, parse_id), // ResentMessageId = 29,
(false, parse_address), // ListArchive = 30,
(false, parse_address), // ListHelp = 31,
(false, parse_address), // ListId = 32,
(false, parse_address), // ListOwner = 33,
(false, parse_address), // ListPost = 34,
(false, parse_address), // ListSubscribe = 35,
(false, parse_address), // ListUnsubscribe = 36,
(true, parse_raw), // Other = 37,
];
/*
type ParserFnc<'x> = fn(&mut MessageStream<'x>) -> HeaderValue<'x>;
static HDR_PARSER: &[(bool, for<'x> fn(&mut MessageStream<'x>) -> HeaderValue<'x>] = &[
(false, MessageStream::parse_unstructured), // Subject = 0,
(false, MessageStream::parse_address), // From = 1,
(false, MessageStream::parse_address), // To = 2,
(false, MessageStream::parse_address), // Cc = 3,
(false, MessageStream::parse_date), // Date = 4,
(false, MessageStream::parse_address), // Bcc = 5,
(false, MessageStream::parse_address), // ReplyTo = 6,
(false, MessageStream::parse_address), // Sender = 7,
(true, MessageStream::parse_unstructured), // Comments = 8,
(false, MessageStream::parse_id), // InReplyTo = 9,
(true, MessageStream::parse_comma_separared), // Keywords = 10,
(true, MessageStream::parse_raw), // Received = 11,
(false, MessageStream::parse_id), // MessageId = 12,
(true, MessageStream::parse_id), // References = 13, (RFC 5322 recommends One)
(false, MessageStream::parse_id), // ReturnPath = 14,
(false, MessageStream::parse_raw), // MimeVersion = 15,
(false, MessageStream::parse_unstructured), // ContentDescription = 16,
(false, MessageStream::parse_id), // ContentId = 17,
(false, MessageStream::parse_comma_separared), // ContentLanguage = 18
(false, MessageStream::parse_unstructured), // ContentLocation = 19
(false, MessageStream::parse_unstructured), // ContentTransferEncoding = 20,
(false, MessageStream::parse_content_type), // ContentType = 21,
(false, MessageStream::parse_content_type), // ContentDisposition = 22,
(true, MessageStream::parse_address), // ResentTo = 23,
(true, MessageStream::parse_address), // ResentFrom = 24,
(true, MessageStream::parse_address), // ResentBcc = 25,
(true, MessageStream::parse_address), // ResentCc = 26,
(true, MessageStream::parse_address), // ResentSender = 27,
(true, MessageStream::parse_date), // ResentDate = 28,
(true, MessageStream::parse_id), // ResentMessageId = 29,
(false, MessageStream::parse_address), // ListArchive = 30,
(false, MessageStream::parse_address), // ListHelp = 31,
(false, MessageStream::parse_address), // ListId = 32,
(false, MessageStream::parse_address), // ListOwner = 33,
(false, MessageStream::parse_address), // ListPost = 34,
(false, MessageStream::parse_address), // ListSubscribe = 35,
(false, MessageStream::parse_address), // ListUnsubscribe = 36,
(true, MessageStream::parse_raw), // Other = 37,
];*/
static HDR_HASH: &[u8] = &[
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
+71 -56
View File
@@ -9,24 +9,15 @@
* except according to those terms.
*/
use std::{borrow::Cow, iter::Peekable, slice::Iter};
use std::borrow::Cow;
use crate::{
decoders::{
base64::decode_base64_mime, charsets::map::get_charset_decoder,
quoted_printable::decode_quoted_printable_mime, DecodeFnc,
},
parsers::mime::seek_next_part_offset,
decoders::{charsets::map::get_charset_decoder, DecodeFnc},
ContentType, Encoding, GetHeader, HeaderValue, Message, MessagePart, MessagePartId, PartType,
RfcHeader,
};
use super::{
header::parse_headers,
mime::{
get_mime_part, seek_crlf, seek_next_part, seek_part_end, skip_crlf, skip_multipart_end,
},
};
use super::MessageStream;
const MAX_NESTED_ENCODED: usize = 3;
@@ -120,24 +111,6 @@ impl MessageParserState {
}
}
pub struct MessageStream<'x> {
pub data: &'x [u8],
//pub iter: Peekable<Iter<'x, u8>>,
pub pos: usize,
//pub restore_pos: usize,
}
impl<'x> MessageStream<'x> {
pub fn new(data: &'x [u8]) -> MessageStream<'x> {
MessageStream {
data,
//iter: data.iter().peekable(),
pos: 0,
//restore_pos: 0,
}
}
}
impl<'x> Message<'x> {
fn new() -> Message<'x> {
Message {
@@ -172,10 +145,11 @@ impl<'x> Message<'x> {
'outer: loop {
// Parse headers
state.offset_header = stream.pos;
if !parse_headers(&mut part_headers, &mut stream) {
state.offset_header = stream.offset();
if !stream.parse_headers(&mut part_headers) {
break;
}
state.offset_body = stream.offset();
state.parts += 1;
state.sub_part_ids.push(message.parts.len());
@@ -191,9 +165,7 @@ impl<'x> Message<'x> {
if let Some(mime_boundary) =
content_type.map_or_else(|| None, |f| f.get_attribute("boundary"))
{
state.offset_body = seek_crlf(&stream, stream.pos);
if seek_next_part(&mut stream, mime_boundary.as_bytes()) {
if stream.seek_next_part(mime_boundary.as_bytes()) {
let part_id = message.parts.len();
let new_state = MessageParserState {
in_alternative: state.in_alternative
@@ -219,7 +191,7 @@ impl<'x> Message<'x> {
});
state_stack.push((state, None));
state = new_state;
skip_crlf(&mut stream);
stream.skip_crlf();
continue;
} else {
mime_type = MimeType::TextOther;
@@ -228,21 +200,21 @@ impl<'x> Message<'x> {
}
}
skip_crlf(&mut stream);
state.offset_body = stream.pos;
let (mut encoding, decode_fnc): (Encoding, DecodeFnc) = match part_headers
.get_rfc(&RfcHeader::ContentTransferEncoding)
{
Some(HeaderValue::Text(encoding)) if encoding.eq_ignore_ascii_case("base64") => {
(Encoding::Base64, decode_base64_mime)
(Encoding::Base64, MessageStream::decode_base64_mime)
}
Some(HeaderValue::Text(encoding))
if encoding.eq_ignore_ascii_case("quoted-printable") =>
{
(Encoding::QuotedPrintable, decode_quoted_printable_mime)
(
Encoding::QuotedPrintable,
MessageStream::decode_quoted_printable_mime,
)
}
_ => (Encoding::None, get_mime_part),
_ => (Encoding::None, MessageStream::get_mime_part),
};
if mime_type == MimeType::Message && encoding == Encoding::None {
@@ -284,7 +256,7 @@ impl<'x> Message<'x> {
is_text = true;
let (offset_end, boundary_found) =
seek_part_end(&mut stream, state.mime_boundary.as_deref());
stream.seek_part_end(state.mime_boundary.as_deref());
state.offset_end = offset_end;
bytes = stream.data[state.offset_body..state.offset_end].into();
@@ -432,7 +404,7 @@ impl<'x> Message<'x> {
.mime_boundary
.as_ref()
.map(|b| {
let pos = stream.pos.saturating_sub(b.len() + 2);
let pos = stream.offset().saturating_sub(b.len() + 2);
stream.data.get(pos - 2).map_or(pos - 1, |&ch| {
if ch == b'\r' {
pos - 2
@@ -441,7 +413,7 @@ impl<'x> Message<'x> {
}
})
})
.unwrap_or(stream.pos);
.unwrap_or_else(|| stream.offset());
message.raw_message = raw_message.into();
//raw_message[state.offset_header..offset_end].as_ref().into();
@@ -461,7 +433,7 @@ impl<'x> Message<'x> {
}
}
if skip_multipart_end(&mut stream) {
if stream.is_multipart_end() {
// End of MIME part reached
if MimeType::MultipartAlernative == state.mime_type
@@ -499,7 +471,7 @@ impl<'x> Message<'x> {
if let Some(ref mime_boundary) = state.mime_boundary {
// Ancestor has a MIME boundary, seek it.
if let Some(offset) =
seek_next_part_offset(&mut stream, mime_boundary)
stream.seek_next_part_offset(mime_boundary)
{
part.offset_end = offset;
continue 'inner;
@@ -508,19 +480,18 @@ impl<'x> Message<'x> {
}
// This part has no boundary, update end offset
part.offset_end = seek_crlf(&stream, stream.pos);
part.offset_end = stream.offset();
} else {
debug_assert!(false, "Invalid part ID, could not find multipart.");
}
break 'outer;
} else {
skip_crlf(&mut stream);
// Headers of next part expected next, break inner look.
break 'inner;
}
}
} else if stream.pos >= stream.data.len() {
} else if stream.offset() >= stream.data.len() {
break 'outer;
}
}
@@ -528,18 +499,18 @@ impl<'x> Message<'x> {
// Corrupted MIME message, try to recover whatever is possible.
while let Some((prev_state, prev_message)) = state_stack.pop() {
if let Some(mut prev_message) = prev_message {
message.raw_message = raw_message[state.offset_header..stream.pos].as_ref().into();
message.raw_message = raw_message.into(); //raw_message[state.offset_header..stream.offset()].as_ref().into();
if let Some(part) = prev_message.parts.get_mut(state.part_id) {
part.body = PartType::Message(message);
part.offset_end = stream.pos;
part.offset_end = stream.offset();
} else {
debug_assert!(false, "Invalid part ID, could not find message.");
}
message = prev_message;
} else if let Some(part) = message.parts.get_mut(state.part_id) {
part.offset_end = stream.pos;
part.offset_end = stream.offset();
part.body = PartType::Multipart(state.sub_part_ids);
} else {
debug_assert!(false, "This should not have happened.");
@@ -588,12 +559,14 @@ mod tests {
for file_name in fs::read_dir(&test_dir).unwrap() {
let mut file_name = file_name.unwrap().path();
if file_name.extension().map_or(false, |e| e == "eml") {
let raw_message = fs::read(&file_name).unwrap();
let raw_original = fs::read(&file_name).unwrap();
tests_run += 1;
// Test without CRs
let raw_message = strip_crlf(&raw_original);
file_name.set_extension("json");
let expected_result = fs::read(&file_name).unwrap();
tests_run += 1;
let message = Message::parse(&raw_message).unwrap();
let json_message = serde_json::to_string_pretty(&message).unwrap();
@@ -605,6 +578,23 @@ mod tests {
file_name.display()
);
}
// Test with CRs
let raw_message = add_crlf(&raw_original);
file_name.set_extension("crlf.json");
let expected_result = fs::read(&file_name).unwrap();
let message = Message::parse(&raw_message).unwrap();
let json_message = serde_json::to_string_pretty(&message).unwrap();
if json_message.as_bytes() != expected_result {
file_name.set_extension("crlf.failed");
fs::write(&file_name, json_message.as_bytes()).unwrap();
panic!(
"Test failed, parsed message saved to {}",
file_name.display()
);
}
}
}
@@ -615,4 +605,29 @@ mod tests {
);
}
}
fn add_crlf(bytes: &[u8]) -> Vec<u8> {
let mut result = Vec::with_capacity(bytes.len());
let mut last_ch = 0;
for &ch in bytes {
if ch == b'\n' && last_ch != b'\r' {
result.push(b'\r');
}
result.push(ch);
last_ch = ch;
}
result
}
fn strip_crlf(bytes: &[u8]) -> Vec<u8> {
let mut result = Vec::with_capacity(bytes.len());
for &ch in bytes {
if !ch != b'\r' {
result.push(ch);
}
}
result
}
}
+139 -163
View File
@@ -11,186 +11,162 @@
use std::borrow::Cow;
use super::message::MessageStream;
use super::MessageStream;
pub fn seek_next_part(stream: &mut MessageStream, boundary: &[u8]) -> bool {
if !boundary.is_empty() {
let mut pos = stream.pos;
impl<'x> MessageStream<'x> {
pub fn seek_next_part(&mut self, boundary: &[u8]) -> bool {
if !boundary.is_empty() {
let mut last_ch = 0;
let mut iter = stream.data[stream.pos..].iter().peekable();
while let Some(&ch) = iter.next() {
pos += 1;
self.checkpoint();
if ch == b'-'
&& matches!(iter.peek(), Some(b'-'))
&& stream.data.get(pos + 1..pos + 1 + boundary.len()) == Some(boundary)
{
stream.pos = pos + boundary.len() + 1;
return true;
}
}
}
false
}
pub fn seek_next_part_offset(stream: &mut MessageStream, boundary: &[u8]) -> Option<usize> {
let mut pos = stream.pos;
let mut last_ch = b'\n';
let mut iter = stream.data[stream.pos..].iter().peekable();
let mut offset_pos = stream.pos;
while let Some(&ch) = iter.next() {
pos += 1;
if ch == b'\n' {
offset_pos = if last_ch == b'\r' { pos - 2 } else { pos - 1 };
} else if ch == b'-'
&& matches!(iter.peek(), Some(b'-'))
&& stream.data.get(pos + 1..pos + 1 + boundary.len()) == Some(boundary)
{
stream.pos = pos + boundary.len() + 1;
return offset_pos.into();
}
last_ch = ch;
}
None
}
pub fn get_mime_part<'x>(
stream: &mut MessageStream<'x>,
boundary: &[u8],
) -> (usize, Cow<'x, [u8]>) {
let mut last_ch = b'\n';
let start_pos = stream.pos;
let mut end_pos = stream.pos;
let mut pos = stream.pos;
let mut iter = stream.data[stream.pos..].iter().peekable();
while let Some(&ch) = iter.next() {
pos += 1;
if ch == b'\n' {
end_pos = if last_ch == b'\r' { pos - 2 } else { pos - 1 };
} else if ch == b'-'
&& !boundary.is_empty()
&& matches!(iter.peek(), Some(b'-'))
&& stream.data.get(pos + 1..pos + 1 + boundary.len()) == Some(boundary)
&& matches!(
stream.data.get(pos + 1 + boundary.len()..),
Some([b'\n' | b'\r' | b' ' | b'\t', ..]) | Some([b'-', b'-', ..]) | Some([]) | None
)
{
stream.pos = pos + boundary.len() + 1;
if last_ch != b'\n' {
end_pos = pos - 1;
}
return (end_pos, stream.data[start_pos..end_pos].into());
}
last_ch = ch;
}
(
if boundary.is_empty() {
stream.pos = pos;
stream.pos
} else {
usize::MAX
},
stream.data[start_pos..pos].into(),
)
}
pub fn seek_part_end<'x>(stream: &mut MessageStream<'x>, boundary: Option<&[u8]>) -> (usize, bool) {
let mut last_ch = b'\n';
let mut end_pos = stream.pos;
if let Some(boundary) = boundary {
let mut iter = stream.data[stream.pos..].iter().peekable();
while let Some(&ch) = iter.next() {
stream.pos += 1;
if ch == b'\n' {
end_pos = if last_ch == b'\r' {
stream.pos - 2
} else {
stream.pos - 1
};
} else if ch == b'-'
&& matches!(iter.peek(), Some(b'-'))
&& stream
.data
.get(stream.pos + 1..stream.pos + 1 + boundary.len())
== Some(boundary)
&& matches!(
stream.data.get(stream.pos + 1 + boundary.len()..),
Some([b'\n' | b'\r' | b' ' | b'\t', ..])
| Some([b'-', b'-', ..])
| Some([])
| None
)
{
if last_ch != b'\n' {
end_pos = stream.pos - 1;
while let Some(&ch) = self.next() {
if ch == b'-' && last_ch == b'-' && self.try_skip(boundary) {
return true;
}
stream.pos += boundary.len() + 1;
return (end_pos, true);
last_ch = ch;
}
self.restore();
}
false
}
pub fn seek_next_part_offset(&mut self, boundary: &[u8]) -> Option<usize> {
let mut last_ch = b'\n';
let mut offset_pos = self.offset();
self.checkpoint();
while let Some(&ch) = self.next() {
if ch == b'\n' {
offset_pos = if last_ch == b'\r' {
self.offset() - 2
} else {
self.offset() - 1
};
} else if ch == b'-' && last_ch == b'-' && self.try_skip(boundary) {
return offset_pos.into();
}
last_ch = ch;
}
(stream.pos, false)
} else {
stream.pos = stream.data.len();
(stream.pos, true)
}
}
self.restore();
pub fn skip_multipart_end(stream: &mut MessageStream) -> bool {
match stream.data.get(stream.pos..stream.pos + 2) {
Some(b"--") => {
if let Some(byte) = stream.data.get(stream.pos + 2) {
if !(*byte).is_ascii_whitespace() {
return false;
None
}
pub fn get_mime_part(&mut self, boundary: &[u8]) -> (usize, Cow<'x, [u8]>) {
let mut last_ch = b'\n';
let mut before_last_ch = 0;
let start_pos = self.offset();
let mut end_pos = self.offset();
self.checkpoint();
while let Some(&ch) = self.next() {
if ch == b'\n' {
end_pos = if last_ch == b'\r' {
self.offset() - 2
} else {
self.offset() - 1
};
} else if ch == b'-'
&& !boundary.is_empty()
&& last_ch == b'-'
&& self.try_skip(boundary)
{
if before_last_ch != b'\n' {
end_pos = self.offset() - boundary.len() - 2;
}
return (end_pos, self.get_bytes(start_pos..end_pos).into());
}
stream.pos += 2;
true
}
_ => false,
}
}
#[inline(always)]
pub fn skip_crlf(stream: &mut MessageStream) {
for ch in &stream.data[stream.pos..] {
match ch {
b'\r' | b' ' | b'\t' => stream.pos += 1,
b'\n' => {
stream.pos += 1;
break;
}
_ => break,
before_last_ch = last_ch;
last_ch = ch;
}
}
}
#[inline(always)]
pub fn seek_crlf(stream: &MessageStream, mut start_pos: usize) -> usize {
for ch in &stream.data[start_pos..] {
match ch {
b'\r' | b' ' | b'\t' => start_pos += 1,
b'\n' => {
start_pos += 1;
break;
(
if boundary.is_empty() {
self.offset()
} else {
self.restore();
usize::MAX
},
self.get_bytes(start_pos..self.len()).into(),
)
}
pub fn seek_part_end(&mut self, boundary: Option<&[u8]>) -> (usize, bool) {
let mut last_ch = b'\n';
let mut before_last_ch = 0;
let mut end_pos = self.offset();
if let Some(boundary) = boundary {
while let Some(&ch) = self.next() {
if ch == b'\n' {
end_pos = if last_ch == b'\r' {
self.offset() - 2
} else {
self.offset() - 1
};
} else if ch == b'-' && last_ch == b'-' && self.try_skip(boundary) {
if before_last_ch != b'\n' {
end_pos = self.offset() - boundary.len() - 2;
}
return (end_pos, true);
}
before_last_ch = last_ch;
last_ch = ch;
}
_ => break,
(self.offset(), false)
} else {
self.seek_end();
(self.offset(), true)
}
}
start_pos
pub fn is_multipart_end(&mut self) -> bool {
self.checkpoint();
match (self.next(), self.peek()) {
(Some(&a), Some(&&b)) if a == b'\r' && b == b'\n' => {
self.next();
false
}
(Some(&a), Some(&&b)) if a == b'-' && b == b'-' => {
self.next();
true
}
(Some(&a), _) if a == b'\n' => false,
(Some(&a), _) if a.is_ascii_whitespace() => {
self.skip_crlf();
false
}
_ => {
self.restore();
false
}
}
}
#[inline(always)]
pub fn skip_crlf(&mut self) {
while let Some(ch) = self.peek() {
match ch {
b'\r' | b' ' | b'\t' => {
self.next();
}
b'\n' => {
self.next();
break;
}
_ => break,
}
}
}
}
+84 -6
View File
@@ -9,7 +9,7 @@
* except according to those terms.
*/
use std::{iter::Peekable, slice::Iter};
use std::{iter::Peekable, ops::Range, slice::Iter};
pub mod fields;
pub mod header;
@@ -17,7 +17,7 @@ pub mod message;
pub mod mime;
pub mod preview;
/*pub struct MessageStream<'x> {
pub struct MessageStream<'x> {
data: &'x [u8],
iter: Peekable<Iter<'x, u8>>,
pos: usize,
@@ -41,17 +41,17 @@ impl<'x> MessageStream<'x> {
#[inline(always)]
pub fn offset(&self) -> usize {
self.pos
std::cmp::min(self.pos, self.data.len())
}
#[inline(always)]
pub fn remaining(&self) -> usize {
self.data.len() - self.pos
self.data.len() - self.offset()
}
#[inline(always)]
pub fn checkpoint(&mut self) {
self.restore_pos = self.pos;
self.restore_pos = self.offset();
}
#[inline(always)]
@@ -65,6 +65,85 @@ impl<'x> MessageStream<'x> {
pub fn reset(&mut self) {
self.restore_pos = 0;
}
#[inline(always)]
pub fn peek_bytes(&self, len: usize) -> Option<&[u8]> {
let pos = self.offset();
self.data.get(pos..pos + len)
}
#[inline(always)]
pub fn peek_char(&mut self, ch: u8) -> bool {
matches!(self.peek(), Some(&&ch_) if ch_ == ch)
}
#[inline(always)]
pub fn skip_bytes(&mut self, len: usize) {
self.pos += len;
self.iter = self.data[self.pos..].iter().peekable();
}
#[inline(always)]
pub fn try_skip(&mut self, bytes: &[u8]) -> bool {
if self.peek_bytes(bytes.len()) == Some(bytes) {
self.skip_bytes(bytes.len());
true
} else {
false
}
}
#[inline(always)]
pub fn try_skip_char(&mut self, ch: u8) -> bool {
if self.peek_char(ch) {
self.next();
true
} else {
false
}
}
#[inline(always)]
pub fn get_bytes(&self, range: Range<usize>) -> &'x [u8] {
&self.data[range]
}
#[inline(always)]
pub fn seek_end(&mut self) {
self.pos = self.data.len();
self.iter = [][..].iter().peekable();
}
#[inline(always)]
pub fn next_is_space(&mut self) -> bool {
matches!(self.next(), Some(b' ' | b'\t'))
}
#[inline(always)]
pub fn peek_next_is_space(&mut self) -> bool {
matches!(self.peek(), Some(b' ' | b'\t'))
}
#[inline(always)]
pub fn try_next_is_space(&mut self) -> bool {
if self.peek_next_is_space() {
self.next();
true
} else {
false
}
}
#[allow(clippy::len_without_is_empty)]
#[inline(always)]
pub fn len(&self) -> usize {
self.data.len()
}
#[inline(always)]
pub fn is_eof(&mut self) -> bool {
self.iter.peek().is_none()
}
}
impl<'x> Iterator for MessageStream<'x> {
@@ -76,4 +155,3 @@ impl<'x> Iterator for MessageStream<'x> {
self.iter.next()
}
}
*/
File diff suppressed because it is too large Load Diff
+196
View File
@@ -0,0 +1,196 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"AddressList": [
{
"name": "Joe Blow",
"address": "jblow@example.com"
},
{
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
]
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 149
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_field": 149,
"offset_start": 157,
"offset_end": 228
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 18,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 228,
"offset_start": 233,
"offset_end": 267
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com"
},
"offset_field": 267,
"offset_start": 278,
"offset_end": 328
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 328,
"offset_start": 341,
"offset_end": 347
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"utf-7"
]
]
}
},
"offset_field": 347,
"offset_start": 360,
"offset_end": 392
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 392,
"offset_start": 418,
"offset_end": 437
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 437,
"offset_start": 448,
"offset_end": 461
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 461,
"offset_start": 479,
"offset_end": 488
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 488,
"offset_start": 497,
"offset_end": 550
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 550,
"offset_start": 561,
"offset_end": 570
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 570,
"offset_start": 580,
"offset_end": 628
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 0,
"offset_body": 630,
"offset_end": 1525
}
]
}
+168
View File
@@ -0,0 +1,168 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519003052.00a89c40@pop.example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_field": 64,
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_field": 113,
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 2 (High)\r\n"
},
"offset_field": 170,
"offset_start": 181,
"offset_end": 192
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 31,
"second": 0,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 192,
"offset_start": 197,
"offset_end": 231
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_field": 231,
"offset_start": 234,
"offset_end": 290
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 290,
"offset_start": 295,
"offset_end": 332
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_field": 332,
"offset_start": 340,
"offset_end": 387
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 387,
"offset_start": 400,
"offset_end": 406
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 406,
"offset_start": 419,
"offset_end": 453
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 453,
"offset_start": 479,
"offset_end": 498
}
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font></html>\n\n"
},
"offset_header": 0,
"offset_body": 500,
"offset_end": 1499
}
]
}
+244
View File
@@ -0,0 +1,244 @@
{
"html_body": [
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519002557.00a88870@pop.example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_field": 64,
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_field": 113,
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 2 (High)\r\n"
},
"offset_field": 170,
"offset_start": 181,
"offset_end": 192
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 29,
"second": 55,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 192,
"offset_start": 197,
"offset_end": 231
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_field": 231,
"offset_start": 234,
"offset_end": 290
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 290,
"offset_start": 295,
"offset_end": 332
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_field": 332,
"offset_start": 340,
"offset_end": 387
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 387,
"offset_start": 400,
"offset_end": 406
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"=====================_714967308==_.ALT"
]
]
}
},
"offset_field": 406,
"offset_start": 419,
"offset_end": 496
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 498,
"offset_end": 2627
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 540,
"offset_start": 553,
"offset_end": 588
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 588,
"offset_start": 614,
"offset_end": 633
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 540,
"offset_body": 635,
"offset_end": 1444
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 1488,
"offset_start": 1501,
"offset_end": 1535
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 1535,
"offset_start": 1561,
"offset_end": 1580
}
],
"is_encoding_problem": false,
"body": {
"Html": "<html>\n<font face=\"Arial, Helvetica\" size=5 color=\"#0000FF\"><b>Die Hasen und die\nFrösche<br>\n<br>\n</font></b><font face=\"Arial, Helvetica\">Die Hasen klagten einst über\nihre mißliche Lage; &quot;wir leben&quot;, sprach ein Redner, &quot;in\nsteter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler,\nja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst.\nAuf, laßt uns ein für allemal sterben.&quot; <br>\n<br>\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten. <br>\n<br>\n&quot;Halt&quot;, rief nun eben dieser Sprecher, &quot;wir wollen das\nErsäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr\nseht, einige Tiere, welche also wohl noch unglücklicher sein müssen als\nwir.&quot; <br>\n<br>\n</font></html>\n"
},
"offset_header": 1488,
"offset_body": 1582,
"offset_end": 2579
}
]
}
+157
View File
@@ -0,0 +1,157 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519011207.00a8cd70@pop.example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_field": 64,
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_field": 113,
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 5 (Lowest)\r\n"
},
"offset_field": 170,
"offset_start": 181,
"offset_end": 194
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 13,
"second": 19,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 194,
"offset_start": 199,
"offset_end": 233
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"offset_field": 233,
"offset_start": 236,
"offset_end": 266
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 266,
"offset_start": 271,
"offset_end": 308
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "The Hare and the Tortoise"
},
"offset_field": 308,
"offset_start": 316,
"offset_end": 344
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 344,
"offset_start": 357,
"offset_end": 363
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 363,
"offset_start": 376,
"offset_end": 409
}
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race. \r\n\r\n"
},
"offset_header": 0,
"offset_body": 411,
"offset_end": 1177
}
]
}
+190
View File
@@ -0,0 +1,190 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 96
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_field": 96,
"offset_start": 104,
"offset_end": 175
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 20,
"second": 24,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 175,
"offset_start": 180,
"offset_end": 214
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKDCHAA.doug@example.com"
},
"offset_field": 214,
"offset_start": 225,
"offset_end": 275
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 275,
"offset_start": 288,
"offset_end": 294
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"utf-7"
]
]
}
},
"offset_field": 294,
"offset_start": 307,
"offset_end": 339
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 339,
"offset_start": 365,
"offset_end": 384
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 384,
"offset_start": 395,
"offset_end": 408
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 408,
"offset_start": 426,
"offset_end": 435
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 435,
"offset_start": 444,
"offset_end": 497
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 497,
"offset_start": 508,
"offset_end": 517
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 517,
"offset_start": 527,
"offset_end": 575
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
},
"offset_header": 0,
"offset_body": 577,
"offset_end": 1470
}
]
}
File diff suppressed because it is too large Load Diff
+190
View File
@@ -0,0 +1,190 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 112
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_field": 112,
"offset_start": 120,
"offset_end": 194
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 15,
"second": 35,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 194,
"offset_start": 199,
"offset_end": 233
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGIEKCCHAA.doug@example.com"
},
"offset_field": 233,
"offset_start": 244,
"offset_end": 294
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 294,
"offset_start": 307,
"offset_end": 313
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 313,
"offset_start": 326,
"offset_end": 363
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 363,
"offset_start": 389,
"offset_end": 408
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 408,
"offset_start": 419,
"offset_end": 432
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 432,
"offset_start": 450,
"offset_end": 459
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 459,
"offset_start": 468,
"offset_end": 521
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 521,
"offset_start": 532,
"offset_end": 541
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 541,
"offset_start": 551,
"offset_end": 599
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 0,
"offset_body": 601,
"offset_end": 1410
}
]
}
File diff suppressed because it is too large Load Diff
+183
View File
@@ -0,0 +1,183 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519010441.00a8d140@pop.example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_field": 64,
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "Disposition-Notification-To"
},
"value": {
"Text": " <dwsauder@example.com>\r\n"
},
"offset_field": 113,
"offset_start": 141,
"offset_end": 166
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_field": 166,
"offset_start": 175,
"offset_end": 223
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 1 (Highest)\r\n"
},
"offset_field": 223,
"offset_start": 234,
"offset_end": 248
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 6,
"second": 18,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 248,
"offset_start": 253,
"offset_end": 287
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"offset_field": 287,
"offset_start": 290,
"offset_end": 373
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 373,
"offset_start": 378,
"offset_end": 415
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_field": 415,
"offset_start": 423,
"offset_end": 468
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 468,
"offset_start": 481,
"offset_end": 487
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
],
[
"format",
"flowed"
]
]
}
},
"offset_field": 487,
"offset_start": 500,
"offset_end": 550
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 550,
"offset_start": 576,
"offset_end": 595
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein \nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, \nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der \nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; \nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte \neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste \nuntertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein \nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, \nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
"offset_header": 0,
"offset_body": 597,
"offset_end": 1422
}
]
}
+168
View File
@@ -0,0 +1,168 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519010842.00a8c7f0@pop.example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_field": 64,
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_field": 113,
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 1 (Highest)\r\n"
},
"offset_field": 170,
"offset_start": 181,
"offset_end": 195
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 1,
"minute": 10,
"second": 27,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 195,
"offset_start": 200,
"offset_end": 234
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz M�ller",
"address": "mueller@example.com"
}
},
"offset_field": 234,
"offset_start": 237,
"offset_end": 274
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 274,
"offset_start": 279,
"offset_end": 316
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Fr�sche"
},
"offset_field": 316,
"offset_start": 324,
"offset_end": 352
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 352,
"offset_start": 365,
"offset_end": 371
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 371,
"offset_start": 384,
"offset_end": 419
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "8bit"
},
"offset_field": 419,
"offset_start": 445,
"offset_end": 452
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\n\r\n\r\n"
},
"offset_header": 0,
"offset_body": 454,
"offset_end": 1203
}
]
}
+157
View File
@@ -0,0 +1,157 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519001217.00a85b60@pop.example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_field": 64,
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_field": 113,
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 17,
"second": 39,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 170,
"offset_start": 175,
"offset_end": 209
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "jschmuergen@example.com"
}
},
"offset_field": 209,
"offset_start": 212,
"offset_end": 299
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 299,
"offset_start": 304,
"offset_end": 341
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_field": 341,
"offset_start": 349,
"offset_end": 396
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 396,
"offset_start": 409,
"offset_end": 415
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 415,
"offset_start": 428,
"offset_end": 463
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 463,
"offset_start": 489,
"offset_end": 508
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n\n"
},
"offset_header": 0,
"offset_body": 510,
"offset_end": 1321
}
]
}
+190
View File
@@ -0,0 +1,190 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 101
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_field": 101,
"offset_start": 109,
"offset_end": 185
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 30,
"second": 20,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 185,
"offset_start": 190,
"offset_end": 224
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKECHAA.doug@example.com"
},
"offset_field": 224,
"offset_start": 235,
"offset_end": 285
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 285,
"offset_start": 298,
"offset_end": 304
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"Windows-1252"
]
]
}
},
"offset_field": 304,
"offset_start": 317,
"offset_end": 356
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 356,
"offset_start": 382,
"offset_end": 401
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 401,
"offset_start": 412,
"offset_end": 425
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 425,
"offset_start": 443,
"offset_end": 452
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 452,
"offset_start": 461,
"offset_end": 514
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 514,
"offset_start": 525,
"offset_end": 534
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 534,
"offset_start": 544,
"offset_end": 592
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
},
"offset_header": 0,
"offset_body": 594,
"offset_end": 1401
}
]
}
+190
View File
@@ -0,0 +1,190 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 112
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_field": 112,
"offset_start": 120,
"offset_end": 194
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 13,
"second": 51,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 194,
"offset_start": 199,
"offset_end": 233
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGEEKCCHAA.doug@example.com"
},
"offset_field": 233,
"offset_start": 244,
"offset_end": 294
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 294,
"offset_start": 307,
"offset_end": 313
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 313,
"offset_start": 326,
"offset_end": 363
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "8bit"
},
"offset_field": 363,
"offset_start": 389,
"offset_end": 396
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 396,
"offset_start": 407,
"offset_end": 420
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 420,
"offset_start": 438,
"offset_end": 447
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 447,
"offset_start": 456,
"offset_end": 509
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 509,
"offset_start": 520,
"offset_end": 529
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 529,
"offset_start": 539,
"offset_end": 587
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod\r\nselbst. Auf, laßt uns ein für allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\r\nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte\r\neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\r\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch unglücklicher sein müssen als wir.\"\r\n\r\n"
},
"offset_header": 0,
"offset_body": 589,
"offset_end": 1341
}
]
}
+266
View File
@@ -0,0 +1,266 @@
{
"html_body": [
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "jblow@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 76
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Microsoft Outlook 00"
},
"offset_field": 76,
"offset_start": 84,
"offset_end": 125
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 38,
"second": 28,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 125,
"offset_start": 130,
"offset_end": 164
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGCEKFCHAA.doug@example.com"
},
"offset_field": 164,
"offset_start": 175,
"offset_end": 225
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 225,
"offset_start": 238,
"offset_end": 244
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"----=_NextPart_000_0005_01BFC037.799BEF60"
]
]
}
},
"offset_field": 244,
"offset_start": 257,
"offset_end": 337
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 337,
"offset_start": 348,
"offset_end": 361
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 361,
"offset_start": 379,
"offset_end": 388
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 388,
"offset_start": 397,
"offset_end": 450
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 450,
"offset_start": 461,
"offset_end": 470
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 470,
"offset_start": 480,
"offset_end": 528
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 530,
"offset_end": 2903
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 623,
"offset_start": 636,
"offset_end": 673
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 673,
"offset_start": 699,
"offset_end": 718
}
],
"is_encoding_problem": false,
"body": {
"Text": "\nThe Hare and the Tortoise \n \nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \n \nSlow but steady wins the race. \n\n"
},
"offset_header": 623,
"offset_body": 720,
"offset_end": 1521
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 1568,
"offset_start": 1581,
"offset_end": 1617
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 1617,
"offset_start": 1643,
"offset_end": 1662
}
],
"is_encoding_problem": false,
"body": {
"Html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>\n<META content=\"text/html; charset=iso-8859-1\" http-equiv=Content-Type>\n<META content=\"MSHTML 5.00.2314.1000\" name=GENERATOR></HEAD>\n<BODY>\n<DIV><FONT face=Arial size=2><BR>The Hare and the Tortoise <BR>&nbsp;<BR>A HARE \none day ridiculed the short feet and slow pace of the Tortoise, who replied, \nlaughing:&nbsp; \"Though you be swift as the wind, I will beat you in a \nrace.\"&nbsp; The Hare, believing her assertion to be simply impossible, assented \nto the proposal; and they agreed that the Fox should choose the course and fix \nthe goal.&nbsp; On the day appointed for the race the two started \ntogether.&nbsp; The Tortoise never for a moment stopped, but went on with a slow \nbut steady pace straight to the end of the course.&nbsp; The Hare, lying down by \nthe wayside, fell fast asleep.&nbsp; At last waking up, and moving as fast as he \ncould, he saw the Tortoise had reached the goal, and was comfortably dozing \nafter her fatigue.&nbsp; <BR>&nbsp;<BR>Slow but steady wins the race.&nbsp; \n<BR></FONT></DIV></BODY></HTML>\n"
},
"offset_header": 1568,
"offset_body": 1664,
"offset_end": 2854
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+190
View File
@@ -0,0 +1,190 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 89
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)"
},
"offset_field": 89,
"offset_start": 97,
"offset_end": 148
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 8,
"second": 29,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 148,
"offset_start": 153,
"offset_end": 187
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGIEKBCHAA.doug@example.com"
},
"offset_field": 187,
"offset_start": 198,
"offset_end": 248
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 248,
"offset_start": 261,
"offset_end": 267
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 267,
"offset_start": 280,
"offset_end": 317
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "8bit"
},
"offset_field": 317,
"offset_start": 343,
"offset_end": 350
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 350,
"offset_start": 361,
"offset_end": 374
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 374,
"offset_start": 392,
"offset_end": 401
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 401,
"offset_start": 410,
"offset_end": 463
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 463,
"offset_start": 474,
"offset_end": 483
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 483,
"offset_start": 493,
"offset_end": 541
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod\r\nselbst. Auf, laßt uns ein für allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\r\nallein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte\r\neine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\r\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch unglücklicher sein müssen als wir.\"\r\n\r\n"
},
"offset_header": 0,
"offset_body": 543,
"offset_end": 1295
}
]
}
File diff suppressed because it is too large Load Diff
+190
View File
@@ -0,0 +1,190 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 89
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)"
},
"offset_field": 89,
"offset_start": 97,
"offset_end": 148
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 11,
"second": 50,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 148,
"offset_start": 153,
"offset_end": 187
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGAEKCCHAA.doug@example.com"
},
"offset_field": 187,
"offset_start": 198,
"offset_end": 248
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 248,
"offset_start": 261,
"offset_end": 267
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 267,
"offset_start": 280,
"offset_end": 317
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_field": 317,
"offset_start": 343,
"offset_end": 352
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 352,
"offset_start": 363,
"offset_end": 376
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 376,
"offset_start": 394,
"offset_end": 403
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 403,
"offset_start": 412,
"offset_end": 465
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 465,
"offset_start": 476,
"offset_end": 485
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 485,
"offset_start": 495,
"offset_end": 543
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\n\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\n"
},
"offset_header": 0,
"offset_body": 545,
"offset_end": 1571
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+316
View File
@@ -0,0 +1,316 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2,
3
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "4.2.0.58.20000519005818.00a86aa0@pop.example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 64
},
{
"name": {
"Other": "X-Sender"
},
"value": {
"Text": " dwsauder@pop.example.com (Unverified)\r\n"
},
"offset_field": 64,
"offset_start": 73,
"offset_end": 113
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " QUALCOMM Windows Eudora Pro Version 4.2.0.58 \r\n"
},
"offset_field": 113,
"offset_start": 122,
"offset_end": 170
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 0,
"minute": 59,
"second": 31,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 170,
"offset_start": 175,
"offset_end": 209
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_field": 209,
"offset_start": 212,
"offset_end": 266
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 266,
"offset_start": 271,
"offset_end": 308
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_field": 308,
"offset_start": 316,
"offset_end": 361
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 361,
"offset_start": 374,
"offset_end": 380
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"=====================_716740438==_"
]
]
}
},
"offset_field": 380,
"offset_start": 393,
"offset_end": 460
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 462,
"offset_end": 3743
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 500,
"offset_start": 513,
"offset_end": 548
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 548,
"offset_start": 574,
"offset_end": 593
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 500,
"offset_body": 595,
"offset_end": 1404
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"name",
"HasenundFr�sche.txt"
],
[
"x-mac-type",
"54455854"
],
[
"x-mac-creator",
"74747874"
]
]
}
},
"offset_field": 1444,
"offset_start": 1457,
"offset_end": 1549
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "x-uuencode"
},
"offset_field": 1549,
"offset_start": 1575,
"offset_end": 1588
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"HasenundFr�sche.txt"
]
]
}
},
"offset_field": 1588,
"offset_start": 1608,
"offset_end": 1653
}
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nbegin 600 HasenundFr�sche.txt\r\nM1&EE($AA<V5N('5N9\"!D:64@1G+V<V-H90T*#0I$:64@2&%S96X@:VQA9W1E\r\nM;B!E:6YS=\"#\\8F5R(&EH<F4@;6G?;&EC:&4@3&%G93L@(G=I<B!L96)E;B(L\r\nM('-P<F%C:\"!E:6X@4F5D;F5R+\"`B:6X@<W1E=&5R($9U<F-H=\"!V;W(@365N\r\nM<V-H96X@=6YD(%1I97)E;BP@96EN92!\"975T92!D97(@2'5N9&4L(&1E<B!!\r\nM9&QE<BP@:F$@9F%S=\"!A;&QE<B!2875B=&EE<F4A(%5N<V5R92!S=&5T92!!\r\nM;F=S=\"!I<W0@Y')G97(@86QS(&1E<B!4;V0@<V5L8G-T+B!!=68L(&QAWW0@\r\nM=6YS(&5I;B!F_'(@86QL96UA;\"!S=&5R8F5N+B(@#0H-\"DEN(&5I;F5M(&YA\r\nM:&5N(%1E:6-H('=O;&QT96X@<VEE('-I8V@@;G5N(&5R<^1U9F5N.R!S:64@\r\nM96EL=&5N(&EH;2!Z=3L@86QL96EN(&1A<R!A==]E<F]R9&5N=&QI8VAE($=E\r\nM=/9S92!U;F0@:6AR92!W=6YD97)B87)E($=E<W1A;'0@97)S8VAR96-K=&4@\r\nM96EN92!-96YG92!&<O9S8VAE+\"!D:64@86T@569E<B!S8=]E;BP@<V\\@<V5H\r\nM<BP@9&'?('-I92!A=69S('-C:&YE;&QS=&4@=6YT97)T875C:'1E;BX@#0H-\r\nM\"B)(86QT(BP@<FEE9B!N=6X@96)E;B!D:65S97(@4W!R96-H97(L(\")W:7(@\r\nM=V]L;&5N(&1A<R!%<G/D=69E;B!N;V-H(&5I;B!W96YI9R!A=69S8VAI96)E\r\nM;BP@9&5N;B!A=6-H('5N<R!F_')C:'1E;BP@=VEE(&EH<B!S96AT+\"!E:6YI\r\nM9V4@5&EE<F4L('=E;&-H92!A;'-O('=O:&P@;F]C:\"!U;F=L_&-K;&EC:&5R\r\n;('-E:6X@;?QS<V5N(&%L<R!W:7(N(B`-\"@T*\r\n`\r\nend\r\n"
},
"offset_header": 1444,
"offset_body": 1655,
"offset_end": 2743
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 2783,
"offset_start": 2796,
"offset_end": 2829
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"farmerandstork.txt"
]
]
}
},
"offset_field": 2829,
"offset_start": 2849,
"offset_end": 2893
}
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n"
},
"offset_header": 2783,
"offset_body": 2895,
"offset_end": 3699
}
]
}
+190
View File
@@ -0,0 +1,190 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "J�rgen Schm�rgen",
"address": "schmuergen@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 89
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)"
},
"offset_field": 89,
"offset_start": 97,
"offset_end": 148
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 10,
"second": 31,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 148,
"offset_start": 153,
"offset_end": 187
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGMEKBCHAA.doug@example.com"
},
"offset_field": 187,
"offset_start": 198,
"offset_end": 248
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 248,
"offset_start": 261,
"offset_end": 267
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 267,
"offset_start": 280,
"offset_end": 317
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 317,
"offset_start": 343,
"offset_end": 362
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 362,
"offset_start": 373,
"offset_end": 386
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 386,
"offset_start": 404,
"offset_end": 413
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 413,
"offset_start": 422,
"offset_end": 475
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 475,
"offset_start": 486,
"offset_end": 495
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 495,
"offset_start": 505,
"offset_end": 553
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 0,
"offset_body": 555,
"offset_end": 1364
}
]
}
File diff suppressed because it is too large Load Diff
+168
View File
@@ -0,0 +1,168 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "392362D8.B650789F@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 26,
"second": 16,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 84,
"offset_start": 89,
"offset_end": 126
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 126,
"offset_start": 135,
"offset_end": 165
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 165,
"offset_start": 183,
"offset_end": 188
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 188,
"offset_start": 201,
"offset_end": 207
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"offset_field": 207,
"offset_start": 210,
"offset_end": 240
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Netscape Communicator 4.7"
},
"offset_field": 240,
"offset_start": 248,
"offset_end": 294
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 1 (Highest)\r\n"
},
"offset_field": 294,
"offset_start": 305,
"offset_end": 319
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 319,
"offset_start": 332,
"offset_end": 363
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 363,
"offset_start": 389,
"offset_end": 396
}
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r\n"
},
"offset_header": 0,
"offset_body": 398,
"offset_end": 1167
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+168
View File
@@ -0,0 +1,168 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "392363E1.2AC47AB3@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 30,
"second": 41,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 84,
"offset_start": 89,
"offset_end": 126
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 126,
"offset_start": 135,
"offset_end": 165
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 165,
"offset_start": 183,
"offset_end": 188
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 188,
"offset_start": 201,
"offset_end": 207
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"offset_field": 207,
"offset_start": 210,
"offset_end": 240
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Netscape Communicator 4.7"
},
"offset_field": 240,
"offset_start": 248,
"offset_end": 294
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 5 (Lowest)\r\n"
},
"offset_field": 294,
"offset_start": 305,
"offset_end": 318
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"UTF-8"
]
]
}
},
"offset_field": 318,
"offset_start": 331,
"offset_end": 359
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 359,
"offset_start": 385,
"offset_end": 404
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Fr�sche\n\nDie Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der\nTod selbst. Auf, la�t uns ein f�r allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;\nallein das au�erordentliche Get�se und ihre wunderbare Gestalt\nerschreckte eine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs\nschnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein\nwenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,\nwelche also wohl noch ungl�cklicher sein m�ssen als wir.\"\n"
},
"offset_header": 0,
"offset_body": 406,
"offset_end": 1208
}
]
}
+157
View File
@@ -0,0 +1,157 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "39236497.12FA2A89@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 33,
"second": 43,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 84,
"offset_start": 89,
"offset_end": 126
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 126,
"offset_start": 135,
"offset_end": 165
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 165,
"offset_start": 183,
"offset_end": 188
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 188,
"offset_start": 201,
"offset_end": 207
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz M+APw-ller",
"address": "mueller@example.com"
}
},
"offset_field": 207,
"offset_start": 210,
"offset_end": 253
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Fr+APY-sche"
},
"offset_field": 253,
"offset_start": 261,
"offset_end": 293
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"UTF-7"
]
]
}
},
"offset_field": 293,
"offset_start": 306,
"offset_end": 334
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 334,
"offset_start": 360,
"offset_end": 367
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Fr岣he\r\n\r\nDie Hasen klagten einst 롥r ihre miެiche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\r\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist 㱧er als der\r\nTod selbst. Auf, la޴ uns ein f밠allemal sterben.\" \r\n\r\nIn einem nahen Teich wollten sie sich nun ers㴦en; sie eilten ihm zu;\r\nallein das auޥrordentliche Get岥 und ihre wunderbare Gestalt\r\nerschreckte eine Menge Fr岣he, die am Ufer saޥn, so sehr, daݠsie aufs\r\nschnellste untertauchten. \r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers㴦en noch ein\r\nwenig aufschieben, denn auch uns f뱣hten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch ungl뢫licher sein m벳en als wir.\"\r\n"
},
"offset_header": 0,
"offset_body": 369,
"offset_end": 1158
}
]
}
File diff suppressed because it is too large Load Diff
+135
View File
@@ -0,0 +1,135 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 10,
"minute": 18,
"second": 3,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 45
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 91
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"offset_field": 91,
"offset_start": 94,
"offset_end": 159
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_field": 159,
"offset_start": 167,
"offset_end": 214
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "Pine.LNX.4.21.0005191014500.8452-100000@penguin.example.com"
},
"offset_field": 214,
"offset_start": 225,
"offset_end": 289
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 289,
"offset_start": 302,
"offset_end": 308
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 308,
"offset_start": 321,
"offset_end": 354
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "QUOTED-PRINTABLE"
},
"offset_field": 354,
"offset_start": 380,
"offset_end": 399
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n\n"
},
"offset_header": 0,
"offset_body": 401,
"offset_end": 1212
}
]
}
File diff suppressed because it is too large Load Diff
+157
View File
@@ -0,0 +1,157 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "3923625B.59F0C3AC@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 24,
"second": 11,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 84,
"offset_start": 89,
"offset_end": 126
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 126,
"offset_start": 135,
"offset_end": 165
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 165,
"offset_start": 183,
"offset_end": 188
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 188,
"offset_start": 201,
"offset_end": 207
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"offset_field": 207,
"offset_start": 210,
"offset_end": 240
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Netscape Communicator 4.7"
},
"offset_field": 240,
"offset_start": 248,
"offset_end": 294
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 294,
"offset_start": 307,
"offset_end": 338
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 338,
"offset_start": 364,
"offset_end": 371
}
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise, who replied, laughing: \"Though you be swift as the wind, I will beat you in a race.\" The Hare, believing her assertion to be simply impossible, assented to the proposal; and they agreed that the Fox should choose the course and fix the goal. On the day appointed for the race the two started together. The Tortoise never for a moment stopped, but went on with a slow but steady pace straight to the end of the course. The Hare, lying down by the wayside, fell fast asleep. At last waking up, and moving as fast as he could, he saw the Tortoise had reached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race.\r\n"
},
"offset_header": 0,
"offset_body": 373,
"offset_end": 1133
}
]
}
File diff suppressed because it is too large Load Diff
+157
View File
@@ -0,0 +1,157 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "39236653.CAA8A090@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 41,
"second": 7,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 84,
"offset_start": 89,
"offset_end": 126
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 126,
"offset_start": 135,
"offset_end": 165
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 165,
"offset_start": 183,
"offset_end": 188
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 188,
"offset_start": 201,
"offset_end": 207
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"offset_field": 207,
"offset_start": 210,
"offset_end": 277
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_field": 277,
"offset_start": 285,
"offset_end": 332
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 332,
"offset_start": 345,
"offset_end": 378
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 378,
"offset_start": 404,
"offset_end": 423
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\"\n"
},
"offset_header": 0,
"offset_body": 425,
"offset_end": 1231
}
]
}
File diff suppressed because it is too large Load Diff
+259
View File
@@ -0,0 +1,259 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "3923686C.99FB5E36@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 50,
"second": 4,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 84,
"offset_start": 89,
"offset_end": 126
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 126,
"offset_start": 135,
"offset_end": 165
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 165,
"offset_start": 183,
"offset_end": 188
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 188,
"offset_start": 201,
"offset_end": 207
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"offset_field": 207,
"offset_start": 210,
"offset_end": 240
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Netscape Communicator 4.7"
},
"offset_field": 240,
"offset_start": 248,
"offset_end": 294
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"------------77060D866A66DC8D0921E051"
]
]
}
},
"offset_field": 294,
"offset_start": 307,
"offset_end": 376
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 2372
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 464,
"offset_start": 477,
"offset_end": 508
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 508,
"offset_start": 534,
"offset_end": 541
}
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race."
},
"offset_header": 464,
"offset_body": 543,
"offset_end": 1310
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
],
[
"name",
"farmerandstork.txt"
]
]
}
},
"offset_field": 1352,
"offset_start": 1365,
"offset_end": 1425
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 1425,
"offset_start": 1451,
"offset_end": 1458
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": [
[
"filename",
"farmerandstork.txt"
]
]
}
},
"offset_field": 1458,
"offset_start": 1478,
"offset_end": 1520
}
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Farmer and the Stork \r\n \r\nA FARMER placed nets on his newly-sown plowlands and caught a\r\nnumber of Cranes, which came to pick up his seed. With them he\r\ntrapped a Stork that had fractured his leg in the net and was\r\nearnestly beseeching the Farmer to spare his life. \"Pray save\r\nme, Master,\" he said, \"and let me go free this once. My broken\r\nlimb should excite your pity. Besides, I am no Crane, I am a\r\nStork, a bird of excellent character; and see how I love and\r\nslave for my father and mother. Look too, at my feathers--\r\nthey are not the least like those of a Crane.\" The Farmer \r\nlaughed aloud and said, \"It may be all as you say, I only know \r\nthis: I have taken you with these robbers, the Cranes, and you \r\nmust die in their company.\" \r\n \r\nBirds of a feather flock together. \r\n"
},
"offset_header": 1352,
"offset_body": 1522,
"offset_end": 2326
}
]
}
+233
View File
@@ -0,0 +1,233 @@
{
"html_body": [
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "392359CF.DFF4527@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 44
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 22,
"minute": 47,
"second": 43,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 44,
"offset_start": 49,
"offset_end": 83
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 83,
"offset_start": 88,
"offset_end": 125
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 125,
"offset_start": 134,
"offset_end": 164
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 164,
"offset_start": 182,
"offset_end": 187
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 187,
"offset_start": 200,
"offset_end": 206
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_field": 206,
"offset_start": 209,
"offset_end": 265
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Netscape Communicator 4.7)"
},
"offset_field": 265,
"offset_start": 273,
"offset_end": 348
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"------------9D454F23DA86BCD63FA3805F"
]
]
}
},
"offset_field": 348,
"offset_start": 361,
"offset_end": 436
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 438,
"offset_end": 2484
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 480,
"offset_start": 493,
"offset_end": 526
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 526,
"offset_start": 552,
"offset_end": 571
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
"offset_header": 480,
"offset_body": 573,
"offset_end": 1371
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 1413,
"offset_start": 1426,
"offset_end": 1456
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 1456,
"offset_start": 1482,
"offset_end": 1489
}
],
"is_encoding_problem": false,
"body": {
"Html": "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<b>Die Hasen und die Fr&ouml;sche</b>\r\n<p>Die Hasen klagten einst &uuml;ber ihre mi&szlig;liche Lage; \"wir leben\",\r\nsprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute\r\nder Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist &auml;rger\r\nals der Tod selbst. Auf, la&szlig;t uns ein f&uuml;r allemal sterben.\"\r\n<p>In einem nahen Teich wollten sie sich nun ers&auml;ufen; sie eilten\r\nihm zu; allein das au&szlig;erordentliche Get&ouml;se und ihre wunderbare\r\nGestalt erschreckte eine Menge Fr&ouml;sche, die am Ufer sa&szlig;en, so\r\nsehr, da&szlig; sie aufs schnellste untertauchten.\r\n<p>\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers&auml;ufen\r\nnoch ein wenig aufschieben, denn auch uns f&uuml;rchten, wie ihr seht,\r\neinige Tiere, welche also wohl noch ungl&uuml;cklicher sein m&uuml;ssen\r\nals wir.\"\r\n<br>&nbsp;\r\n<br>&nbsp;</html>\r\n"
},
"offset_header": 1413,
"offset_body": 1491,
"offset_end": 2440
}
]
}
File diff suppressed because it is too large Load Diff
+254
View File
@@ -0,0 +1,254 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 19,
"hour": 10,
"minute": 26,
"second": 12,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 45
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@penguin.example.com"
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 91
},
{
"name": {
"Rfc": "to"
},
"value": {
"AddressList": [
{
"name": "Joe Blow",
"address": "blow@example.com"
},
{
"name": "Heinz Müller",
"address": "mueller@example.com"
}
]
},
"offset_field": 91,
"offset_start": 94,
"offset_end": 185
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche"
},
"offset_field": 185,
"offset_start": 193,
"offset_end": 240
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "Pine.LNX.4.21.0005191024380.8452-200000@penguin.example.com"
},
"offset_field": 240,
"offset_start": 251,
"offset_end": 315
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 315,
"offset_start": 328,
"offset_end": 334
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"-1463757054-891160829-958746372=:8452"
]
]
}
},
"offset_field": 334,
"offset_start": 347,
"offset_end": 415
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 417,
"offset_end": 2170
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"US-ASCII"
]
]
}
},
"offset_field": 678,
"offset_start": 691,
"offset_end": 722
}
],
"is_encoding_problem": false,
"body": {
"Text": ""
},
"offset_header": 678,
"offset_body": 724,
"offset_end": 724
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
],
[
"name",
"HasenundFrösche.txt"
]
]
}
},
"offset_field": 767,
"offset_start": 780,
"offset_end": 856
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "BASE64"
},
"offset_field": 856,
"offset_start": 882,
"offset_end": 891
},
{
"name": {
"Rfc": "content_id"
},
"value": {
"Text": "Pine.LNX.4.21.0005191026120.8452@penguin.example.com"
},
"offset_field": 891,
"offset_start": 902,
"offset_end": 959
},
{
"name": {
"Rfc": "content_description"
},
"value": {
"Text": "Short story in German"
},
"offset_field": 959,
"offset_start": 979,
"offset_end": 1003
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "attachment",
"c_subtype": null,
"attributes": [
[
"filename",
"HasenundFrösche.txt"
]
]
}
},
"offset_field": 1003,
"offset_start": 1023,
"offset_end": 1083
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\r\r\n\r\r\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \r\r\n\r\r\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \r\r\n\r\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \r\r\n\r\r\n"
},
"offset_header": 767,
"offset_body": 1085,
"offset_end": 2125
}
]
}
+157
View File
@@ -0,0 +1,157 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "3923561C.B7078DEF@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 22,
"minute": 31,
"second": 57,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 84,
"offset_start": 89,
"offset_end": 126
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 126,
"offset_start": 135,
"offset_end": 165
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 165,
"offset_start": 183,
"offset_end": 188
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 188,
"offset_start": 201,
"offset_end": 207
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Jürgen Schmürgen",
"address": "schmuergen@example.com"
}
},
"offset_field": 207,
"offset_start": 210,
"offset_end": 277
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Netscape Communicator 4.7)"
},
"offset_field": 277,
"offset_start": 285,
"offset_end": 360
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
]
]
}
},
"offset_field": 360,
"offset_start": 373,
"offset_end": 406
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 406,
"offset_start": 432,
"offset_end": 451
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,\nder Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der\nTod selbst. Auf, laßt uns ein für allemal sterben.\"\n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu;\nallein das außerordentliche Getöse und ihre wunderbare Gestalt\nerschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs\nschnellste untertauchten.\n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein\nwenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere,\nwelche also wohl noch unglücklicher sein müssen als wir.\"\n\n\n"
},
"offset_header": 0,
"offset_body": 453,
"offset_end": 1251
}
]
}
+259
View File
@@ -0,0 +1,259 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "392367BC.3D075C95@example.com"
},
"offset_field": 0,
"offset_start": 11,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 23,
"minute": 47,
"second": 8,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "dwsauder@example.com"
}
},
"offset_field": 84,
"offset_start": 89,
"offset_end": 126
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Mozilla 4.7 [en] (WinNT; I)\r\n"
},
"offset_field": 126,
"offset_start": 135,
"offset_end": 165
},
{
"name": {
"Other": "X-Accept-Language"
},
"value": {
"Text": " en\r\n"
},
"offset_field": 165,
"offset_start": 183,
"offset_end": 188
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 188,
"offset_start": 201,
"offset_end": 207
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Joe Blow",
"address": "blow@example.com"
}
},
"offset_field": 207,
"offset_start": 210,
"offset_end": 240
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Test message from Netscape Communicator 4.7"
},
"offset_field": 240,
"offset_start": 248,
"offset_end": 294
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"------------CA611088711119FBDB3473B4"
]
]
}
},
"offset_field": 294,
"offset_start": 307,
"offset_end": 376
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 378,
"offset_end": 2438
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 464,
"offset_start": 477,
"offset_end": 508
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 508,
"offset_start": 534,
"offset_end": 541
}
],
"is_encoding_problem": false,
"body": {
"Text": "\r\nThe Hare and the Tortoise \r\n \r\nA HARE one day ridiculed the short feet and slow pace of the Tortoise,\r\nwho replied, laughing: \"Though you be swift as the wind, I will beat\r\nyou in a race.\" The Hare, believing her assertion to be simply\r\nimpossible, assented to the proposal; and they agreed that the Fox\r\nshould choose the course and fix the goal. On the day appointed for the\r\nrace the two started together. The Tortoise never for a moment stopped,\r\nbut went on with a slow but steady pace straight to the end of the\r\ncourse. The Hare, lying down by the wayside, fell fast asleep. At last\r\nwaking up, and moving as fast as he could, he saw the Tortoise had\r\nreached the goal, and was comfortably dozing after her fatigue. \r\n \r\nSlow but steady wins the race."
},
"offset_header": 464,
"offset_body": 543,
"offset_end": 1310
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"iso-8859-1"
],
[
"name",
"HasenundFrösche.txt"
]
]
}
},
"offset_field": 1352,
"offset_start": 1365,
"offset_end": 1449
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 1449,
"offset_start": 1475,
"offset_end": 1494
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": [
[
"filename",
"HasenundFrösche.txt"
]
]
}
},
"offset_field": 1494,
"offset_start": 1514,
"offset_end": 1578
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n\n"
},
"offset_header": 1352,
"offset_body": 1580,
"offset_end": 2392
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+148
View File
@@ -0,0 +1,148 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz M�ller",
"address": "mueller@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 82
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Fr�sche (Microsoft Outlook 00)"
},
"offset_field": 82,
"offset_start": 90,
"offset_end": 141
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 28,
"second": 40,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 141,
"offset_start": 146,
"offset_end": 180
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGOEKDCHAA.doug@example.com"
},
"offset_field": 180,
"offset_start": 191,
"offset_end": 241
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 241,
"offset_start": 252,
"offset_end": 265
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 265,
"offset_start": 283,
"offset_end": 292
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 292,
"offset_start": 301,
"offset_end": 354
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 354,
"offset_start": 365,
"offset_end": 374
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 374,
"offset_start": 384,
"offset_end": 432
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Fr�sche\r\n\r\nDie Hasen klagten einst �ber ihre mi�liche Lage; \"wir leben\", sprach ein\r\nRedner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der\r\nAdler, ja fast aller Raubtiere! Unsere stete Angst ist �rger als der Tod\r\nselbst. Auf, la�t uns ein f�r allemal sterben.\"\r\n\r\nIn einem nahen Teich wollten sie sich nun ers�ufen; sie eilten ihm zu;\r\nallein das au�erordentliche Get�se und ihre wunderbare Gestalt erschreckte\r\neine Menge Fr�sche, die am Ufer sa�en, so sehr, da� sie aufs schnellste\r\nuntertauchten.\r\n\r\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ers�ufen noch ein\r\nwenig aufschieben, denn auch uns f�rchten, wie ihr seht, einige Tiere,\r\nwelche also wohl noch ungl�cklicher sein m�ssen als wir.\"\r\n\r\n"
},
"offset_header": 0,
"offset_body": 434,
"offset_end": 1186
}
]
}
+190
View File
@@ -0,0 +1,190 @@
{
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Doug Sauder",
"address": "doug@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 40
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Heinz Müller",
"address": "mueller@example.com"
}
},
"offset_field": 40,
"offset_start": 43,
"offset_end": 97
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Die Hasen und die Frösche (Microsoft Outlook 00)"
},
"offset_field": 97,
"offset_start": 105,
"offset_end": 177
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2000,
"month": 5,
"day": 17,
"hour": 19,
"minute": 27,
"second": 4,
"tz_before_gmt": true,
"tz_hour": 4,
"tz_minute": 0
}
},
"offset_field": 177,
"offset_start": 182,
"offset_end": 216
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "NDBBIAKOPKHFGPLCODIGKEKDCHAA.doug@example.com"
},
"offset_field": 216,
"offset_start": 227,
"offset_end": 277
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 277,
"offset_start": 290,
"offset_end": 296
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"utf-8"
]
]
}
},
"offset_field": 296,
"offset_start": 309,
"offset_end": 341
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 341,
"offset_start": 367,
"offset_end": 386
},
{
"name": {
"Other": "X-Priority"
},
"value": {
"Text": " 3 (Normal)\r\n"
},
"offset_field": 386,
"offset_start": 397,
"offset_end": 410
},
{
"name": {
"Other": "X-MSMail-Priority"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 410,
"offset_start": 428,
"offset_end": 437
},
{
"name": {
"Other": "X-Mailer"
},
"value": {
"Text": " Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)\r\n"
},
"offset_field": 437,
"offset_start": 446,
"offset_end": 499
},
{
"name": {
"Other": "Importance"
},
"value": {
"Text": " Normal\r\n"
},
"offset_field": 499,
"offset_start": 510,
"offset_end": 519
},
{
"name": {
"Other": "X-MimeOLE"
},
"value": {
"Text": " Produced By Microsoft MimeOLE V5.00.2314.1300\r\n"
},
"offset_field": 519,
"offset_start": 529,
"offset_end": 577
}
],
"is_encoding_problem": false,
"body": {
"Text": "Die Hasen und die Frösche\n\nDie Hasen klagten einst über ihre mißliche Lage; \"wir leben\", sprach ein Redner, \"in steter Furcht vor Menschen und Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere! Unsere stete Angst ist ärger als der Tod selbst. Auf, laßt uns ein für allemal sterben.\" \n\nIn einem nahen Teich wollten sie sich nun ersäufen; sie eilten ihm zu; allein das außerordentliche Getöse und ihre wunderbare Gestalt erschreckte eine Menge Frösche, die am Ufer saßen, so sehr, daß sie aufs schnellste untertauchten. \n\n\"Halt\", rief nun eben dieser Sprecher, \"wir wollen das Ersäufen noch ein wenig aufschieben, denn auch uns fürchten, wie ihr seht, einige Tiere, welche also wohl noch unglücklicher sein müssen als wir.\" \n"
},
"offset_header": 0,
"offset_body": 579,
"offset_end": 1440
}
]
}
+38
View File
@@ -0,0 +1,38 @@
{
"html_body": [],
"text_body": [],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
":foo"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 48
}
],
"is_encoding_problem": false,
"body": {
"Multipart": []
},
"offset_header": 0,
"offset_body": 50,
"offset_end": 169
}
]
}
+116
View File
@@ -0,0 +1,116 @@
{
"html_body": [
2
],
"text_body": [
2
],
"attachments": [
3
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"ab"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 46
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 48,
"offset_end": 142
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 54,
"offset_start": 67,
"offset_end": 99
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 54,
"offset_body": 101,
"offset_end": 142
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 107,
"offset_start": 120,
"offset_end": 133
}
],
"is_encoding_problem": false,
"body": {
"Text": ""
},
"offset_header": 104,
"offset_body": 135,
"offset_end": 135
},
{
"headers": [],
"is_encoding_problem": true,
"body": {
"Text": ""
},
"offset_header": 140,
"offset_body": 142,
"offset_end": 142
}
]
}
+20 -4
View File
@@ -77,14 +77,30 @@
"offset_end": 132
},
{
"headers": [],
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 101,
"offset_start": 114,
"offset_end": 126
}
],
"is_encoding_problem": false,
"body": {
"Text": "Content-Type: text/plain\n"
"Text": ""
},
"offset_header": 99,
"offset_body": 101,
"offset_end": 126
"offset_body": 127,
"offset_end": 127
},
{
"headers": [],
+40
View File
@@ -0,0 +1,40 @@
{
"html_body": [],
"text_body": [],
"attachments": [
0
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"ab"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 46
}
],
"is_encoding_problem": false,
"body": {
"Text": "body\r\n"
},
"offset_header": 0,
"offset_body": 48,
"offset_end": 54
}
]
}
+101
View File
@@ -0,0 +1,101 @@
{
"html_body": [],
"text_body": [],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 138
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 52,
"offset_start": 65,
"offset_end": 97
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2
]
},
"offset_header": 52,
"offset_body": 99,
"offset_end": 138
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 104,
"offset_start": 117,
"offset_end": 130
}
],
"is_encoding_problem": true,
"body": {
"Text": "body\r\n"
},
"offset_header": 104,
"offset_body": 132,
"offset_end": 138
}
]
}
+101
View File
@@ -0,0 +1,101 @@
{
"html_body": [],
"text_body": [],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 140
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 53,
"offset_start": 66,
"offset_end": 98
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2
]
},
"offset_header": 50,
"offset_body": 100,
"offset_end": 140
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 106,
"offset_start": 119,
"offset_end": 132
}
],
"is_encoding_problem": true,
"body": {
"Text": "body\r\n"
},
"offset_header": 103,
"offset_body": 134,
"offset_end": 140
}
]
}
+54 -5
View File
@@ -2,7 +2,7 @@
"html_body": [],
"text_body": [],
"attachments": [
1
2
],
"parts": [
{
@@ -39,13 +39,62 @@
"offset_end": 131
},
{
"headers": [],
"is_encoding_problem": true,
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 50,
"offset_start": 63,
"offset_end": 94
}
],
"is_encoding_problem": false,
"body": {
"Text": "Content-Type: multipart/mixed; boundary=\"a\"\n\n--ac\nContent-Type: text/plain\n\nbody\n"
"Multipart": [
2
]
},
"offset_header": 48,
"offset_body": 50,
"offset_body": 95,
"offset_end": 131
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 100,
"offset_start": 113,
"offset_end": 125
}
],
"is_encoding_problem": true,
"body": {
"Text": "body\n"
},
"offset_header": 98,
"offset_body": 126,
"offset_end": 131
}
]
+103
View File
@@ -0,0 +1,103 @@
{
"html_body": [
2
],
"text_body": [
2
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a--"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 47
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 49,
"offset_end": 202
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a----"
]
]
}
},
"offset_field": 56,
"offset_start": 69,
"offset_end": 105
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2
]
},
"offset_header": 56,
"offset_body": 107,
"offset_end": 193
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 116,
"offset_start": 129,
"offset_end": 142
}
],
"is_encoding_problem": false,
"body": {
"Text": "body"
},
"offset_header": 116,
"offset_body": 144,
"offset_end": 148
}
]
}
+101
View File
@@ -0,0 +1,101 @@
{
"html_body": [],
"text_body": [],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 140
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"ab"
]
]
}
},
"offset_field": 52,
"offset_start": 65,
"offset_end": 98
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2
]
},
"offset_header": 52,
"offset_body": 100,
"offset_end": 140
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 106,
"offset_start": 119,
"offset_end": 132
}
],
"is_encoding_problem": true,
"body": {
"Text": "body\r\n"
},
"offset_header": 106,
"offset_body": 134,
"offset_end": 140
}
]
}
+114
View File
@@ -0,0 +1,114 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 168
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"ab"
]
]
}
},
"offset_field": 52,
"offset_start": 65,
"offset_end": 98
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 98,
"offset_start": 111,
"offset_end": 117
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 123,
"offset_start": 136,
"offset_end": 149
}
],
"is_encoding_problem": false,
"body": {
"Text": ""
},
"offset_header": 52,
"offset_body": 151,
"offset_end": 151
},
{
"headers": [],
"is_encoding_problem": true,
"body": {
"Text": ""
},
"offset_header": 154,
"offset_body": 168,
"offset_end": 168
}
]
}
+29 -11
View File
@@ -1,6 +1,10 @@
{
"html_body": [],
"text_body": [],
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2
],
@@ -31,7 +35,8 @@
"is_encoding_problem": false,
"body": {
"Multipart": [
1
1,
2
]
},
"offset_header": 0,
@@ -70,26 +75,39 @@
"offset_field": 94,
"offset_start": 107,
"offset_end": 112
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 117,
"offset_start": 130,
"offset_end": 142
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2
]
"Text": ""
},
"offset_header": 49,
"offset_body": 117,
"offset_end": 157
"offset_body": 143,
"offset_end": 143
},
{
"headers": [],
"is_encoding_problem": true,
"body": {
"Text": "--a--\n\n"
"Text": ""
},
"offset_header": 147,
"offset_body": 150,
"offset_header": 146,
"offset_body": 157,
"offset_end": 157
}
]
+132
View File
@@ -0,0 +1,132 @@
{
"html_body": [
2
],
"text_body": [
2
],
"attachments": [
3
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"ab"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 46
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 48,
"offset_end": 180
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"a"
]
]
}
},
"offset_field": 54,
"offset_start": 67,
"offset_end": 99
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 54,
"offset_body": 101,
"offset_end": 180
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 106,
"offset_start": 119,
"offset_end": 132
}
],
"is_encoding_problem": false,
"body": {
"Text": "body"
},
"offset_header": 106,
"offset_body": 134,
"offset_end": 138
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": null
}
},
"offset_field": 146,
"offset_start": 159,
"offset_end": 171
}
],
"is_encoding_problem": true,
"body": {
"Text": "body2\r\n"
},
"offset_header": 143,
"offset_body": 173,
"offset_end": 180
}
]
}
+37 -6
View File
@@ -1,9 +1,13 @@
{
"html_body": [],
"text_body": [],
"attachments": [
"html_body": [
2
],
"text_body": [
2
],
"attachments": [
3
],
"parts": [
{
"headers": [
@@ -64,7 +68,8 @@
"is_encoding_problem": false,
"body": {
"Multipart": [
2
2,
3
]
},
"offset_header": 51,
@@ -89,12 +94,38 @@
"offset_end": 125
}
],
"is_encoding_problem": true,
"is_encoding_problem": false,
"body": {
"Text": "body\n--ab\nContent-Type: text/html\n\nbody2\n"
"Text": "body"
},
"offset_header": 100,
"offset_body": 126,
"offset_end": 130
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": null
}
},
"offset_field": 136,
"offset_start": 149,
"offset_end": 160
}
],
"is_encoding_problem": true,
"body": {
"Text": "body2\n"
},
"offset_header": 134,
"offset_body": 161,
"offset_end": 167
}
]
+132
View File
@@ -0,0 +1,132 @@
{
"html_body": [
2
],
"text_body": [
2
],
"attachments": [
3
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 210
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"2"
]
]
}
},
"offset_field": 52,
"offset_start": 65,
"offset_end": 97
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 52,
"offset_body": 99,
"offset_end": 210
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 104,
"offset_start": 117,
"offset_end": 130
}
],
"is_encoding_problem": false,
"body": {
"Text": "1"
},
"offset_header": 104,
"offset_body": 132,
"offset_end": 133
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 140,
"offset_start": 153,
"offset_end": 166
}
],
"is_encoding_problem": true,
"body": {
"Text": "22\r\n--1\r\nContent-Type: text/plain\r\n\r\n333\r\n"
},
"offset_header": 140,
"offset_body": 168,
"offset_end": 210
}
]
}
+105
View File
@@ -0,0 +1,105 @@
{
"html_body": [],
"text_body": [],
"attachments": [
0
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "message",
"c_subtype": "rfc822",
"attributes": null
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 30
}
],
"is_encoding_problem": false,
"body": {
"Message": {
"html_body": [],
"text_body": [],
"attachments": [
0
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "message",
"c_subtype": "rfc822",
"attributes": null
}
},
"offset_field": 32,
"offset_start": 45,
"offset_end": 62
}
],
"is_encoding_problem": false,
"body": {
"Message": {
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 64,
"offset_start": 77,
"offset_end": 90
}
],
"is_encoding_problem": false,
"body": {
"Text": "1\r\n"
},
"offset_header": 64,
"offset_body": 92,
"offset_end": 95
}
]
}
},
"offset_header": 32,
"offset_body": 64,
"offset_end": 95
}
]
}
},
"offset_header": 0,
"offset_body": 32,
"offset_end": 95
}
]
}
+132
View File
@@ -0,0 +1,132 @@
{
"html_body": [
2
],
"text_body": [
2
],
"attachments": [
3
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 210
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"2"
]
]
}
},
"offset_field": 52,
"offset_start": 65,
"offset_end": 97
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 52,
"offset_body": 99,
"offset_end": 210
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 104,
"offset_start": 117,
"offset_end": 130
}
],
"is_encoding_problem": false,
"body": {
"Text": "1"
},
"offset_header": 104,
"offset_body": 132,
"offset_end": 133
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 140,
"offset_start": 153,
"offset_end": 166
}
],
"is_encoding_problem": true,
"body": {
"Text": "22\r\n--1\r\nContent-Type: text/plain\r\n\r\n333\r\n"
},
"offset_header": 140,
"offset_body": 168,
"offset_end": 210
}
]
}
+199
View File
@@ -0,0 +1,199 @@
{
"html_body": [],
"text_body": [],
"attachments": [
2,
3
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 306
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"2"
]
]
}
},
"offset_field": 52,
"offset_start": 65,
"offset_end": 97
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2,
3
]
},
"offset_header": 52,
"offset_body": 99,
"offset_end": 306
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "message",
"c_subtype": "rfc822",
"attributes": null
}
},
"offset_field": 104,
"offset_start": 117,
"offset_end": 134
}
],
"is_encoding_problem": false,
"body": {
"Message": {
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 136,
"offset_start": 149,
"offset_end": 162
}
],
"is_encoding_problem": false,
"body": {
"Text": "1"
},
"offset_header": 136,
"offset_body": 164,
"offset_end": 165
}
]
}
},
"offset_header": 104,
"offset_body": 136,
"offset_end": 165
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "message",
"c_subtype": "rfc822",
"attributes": null
}
},
"offset_field": 172,
"offset_start": 185,
"offset_end": 202
}
],
"is_encoding_problem": false,
"body": {
"Message": {
"html_body": [],
"text_body": [],
"attachments": [
0
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 204,
"offset_start": 217,
"offset_end": 230
}
],
"is_encoding_problem": true,
"body": {
"Text": "22\r\n--1\r\nContent-Type: message/rfc822\r\n\r\nContent-Type: text/plain\r\n\r\n333\r\n"
},
"offset_header": 204,
"offset_body": 232,
"offset_end": 306
}
]
}
},
"offset_header": 172,
"offset_body": 204,
"offset_end": 306
}
]
}
+298
View File
@@ -0,0 +1,298 @@
{
"html_body": [
1,
3,
5,
7
],
"text_body": [
1,
3,
5,
7
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 45,
"offset_start": 58,
"offset_end": 64
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 66,
"offset_end": 468
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 71,
"offset_start": 84,
"offset_end": 97
}
],
"is_encoding_problem": false,
"body": {
"Text": "hello, world"
},
"offset_header": 71,
"offset_body": 99,
"offset_end": 111
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1"
]
]
}
},
"offset_field": 118,
"offset_start": 131,
"offset_end": 163
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "2.0"
},
"offset_field": 163,
"offset_start": 176,
"offset_end": 182
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
3,
4
]
},
"offset_header": 118,
"offset_body": 184,
"offset_end": 468
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 189,
"offset_start": 202,
"offset_end": 215
}
],
"is_encoding_problem": false,
"body": {
"Text": "hello, world"
},
"offset_header": 189,
"offset_body": 217,
"offset_end": 229
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1"
]
]
}
},
"offset_field": 236,
"offset_start": 249,
"offset_end": 281
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "abc"
},
"offset_field": 281,
"offset_start": 294,
"offset_end": 300
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
5,
6
]
},
"offset_header": 236,
"offset_body": 302,
"offset_end": 468
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 307,
"offset_start": 320,
"offset_end": 333
}
],
"is_encoding_problem": false,
"body": {
"Text": "hello, world"
},
"offset_header": 307,
"offset_body": 335,
"offset_end": 347
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1"
]
]
}
},
"offset_field": 354,
"offset_start": 367,
"offset_end": 399
},
{
"name": {
"Rfc": "mime_version"
},
"value": "Empty",
"offset_field": 399,
"offset_start": 412,
"offset_end": 414
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
7
]
},
"offset_header": 354,
"offset_body": 416,
"offset_end": 468
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 421,
"offset_start": 434,
"offset_end": 447
}
],
"is_encoding_problem": false,
"body": {
"Text": "hello, world"
},
"offset_header": 421,
"offset_body": 449,
"offset_end": 461
}
]
}
+70
View File
@@ -0,0 +1,70 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 45
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 47,
"offset_end": 99
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 52,
"offset_start": 65,
"offset_end": 78
}
],
"is_encoding_problem": false,
"body": {
"Text": "hello, world"
},
"offset_header": 52,
"offset_body": 80,
"offset_end": 92
}
]
}
+226
View File
@@ -0,0 +1,226 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "return_path"
},
"value": {
"Text": "test@example.org"
},
"offset_field": 0,
"offset_start": 12,
"offset_end": 33
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Hello world"
},
"offset_field": 33,
"offset_start": 41,
"offset_end": 55
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Test User",
"address": "test@example.org"
}
},
"offset_field": 55,
"offset_start": 60,
"offset_end": 91
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Another User",
"address": "test2@example.org"
}
},
"offset_field": 91,
"offset_start": 94,
"offset_end": 129
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "1.2.3.4@example"
},
"offset_field": 129,
"offset_start": 140,
"offset_end": 160
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 160,
"offset_start": 173,
"offset_end": 179
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 2007,
"month": 5,
"day": 23,
"hour": 4,
"minute": 58,
"second": 8,
"tz_before_gmt": false,
"tz_hour": 3,
"tz_minute": 0
}
},
"offset_field": 179,
"offset_start": 184,
"offset_end": 218
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "signed",
"attributes": [
[
"micalg",
"pgp-sha1"
],
[
"protocol",
"application/pgp-signature"
],
[
"boundary",
"=-GNQXLhuj24Pl1aCkk4/d"
]
]
}
},
"offset_field": 218,
"offset_start": 231,
"offset_end": 344
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 346,
"offset_end": 612
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 372,
"offset_start": 385,
"offset_end": 398
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 398,
"offset_start": 424,
"offset_end": 443
}
],
"is_encoding_problem": false,
"body": {
"Text": "There was a day \na happy day\n"
},
"offset_header": 372,
"offset_body": 445,
"offset_end": 480
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "application",
"c_subtype": "pgp-signature",
"attributes": [
[
"name",
"signature.asc"
]
]
}
},
"offset_field": 508,
"offset_start": 521,
"offset_end": 569
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
105,
110,
118,
97,
108,
105,
100,
13,
10
]
},
"offset_header": 508,
"offset_body": 571,
"offset_end": 580
}
]
}
+223
View File
@@ -0,0 +1,223 @@
{
"html_body": [
3,
4,
5
],
"text_body": [
3,
4,
5
],
"attachments": [
6
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012"
]
]
}
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 126
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1
]
},
"offset_header": 0,
"offset_body": 128,
"offset_end": 1021
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"123456789012345678901234567890123456789012345678901234567890123456789012345678901"
]
]
}
},
"offset_field": 214,
"offset_start": 227,
"offset_end": 339
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
2
]
},
"offset_header": 214,
"offset_body": 341,
"offset_end": 1021
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"12345678901234567890123456789012345678901234567890123456789012345678901234567890"
]
]
}
},
"offset_field": 426,
"offset_start": 439,
"offset_end": 550
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
3,
4,
5,
6
]
},
"offset_header": 426,
"offset_body": 552,
"offset_end": 1021
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 636,
"offset_start": 649,
"offset_end": 662
}
],
"is_encoding_problem": false,
"body": {
"Text": "1"
},
"offset_header": 636,
"offset_body": 664,
"offset_end": 665
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 753,
"offset_start": 766,
"offset_end": 779
}
],
"is_encoding_problem": false,
"body": {
"Text": "22"
},
"offset_header": 749,
"offset_body": 781,
"offset_end": 783
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 870,
"offset_start": 883,
"offset_end": 896
}
],
"is_encoding_problem": false,
"body": {
"Text": "333"
},
"offset_header": 867,
"offset_body": 898,
"offset_end": 901
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 987,
"offset_start": 1000,
"offset_end": 1013
}
],
"is_encoding_problem": true,
"body": {
"Text": "4444\r\n"
},
"offset_header": 987,
"offset_body": 1015,
"offset_end": 1021
}
]
}
+63 -5
View File
@@ -1,12 +1,16 @@
{
"html_body": [
3
3,
4,
5
],
"text_body": [
3
3,
4,
5
],
"attachments": [
4
6
],
"parts": [
{
@@ -102,7 +106,9 @@
"body": {
"Multipart": [
3,
4
4,
5,
6
]
},
"offset_header": 420,
@@ -129,10 +135,62 @@
],
"is_encoding_problem": false,
"body": {
"Text": "1\n--1234567890123456789012345678901234567890123456789012345678901234567890123456789012\nContent-Type: text/plain\n\n22\n--123456789012345678901234567890123456789012345678901234567890123456789012345678901\nContent-Type: text/plain\n\n333"
"Text": "1"
},
"offset_header": 627,
"offset_body": 653,
"offset_end": 654
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 740,
"offset_start": 753,
"offset_end": 765
}
],
"is_encoding_problem": false,
"body": {
"Text": "22"
},
"offset_header": 737,
"offset_body": 766,
"offset_end": 768
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": null
}
},
"offset_field": 853,
"offset_start": 866,
"offset_end": 878
}
],
"is_encoding_problem": false,
"body": {
"Text": "333"
},
"offset_header": 851,
"offset_body": 879,
"offset_end": 882
},
{
+418
View File
@@ -0,0 +1,418 @@
{
"html_body": [
1,
2
],
"text_body": [
1,
2
],
"attachments": [
4,
5,
6,
7
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 0,
"offset_start": 13,
"offset_end": 19
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Nathaniel Borenstein",
"address": "nsb@nsb.fv.com"
}
},
"offset_field": 19,
"offset_start": 24,
"offset_end": 64
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Ned Freed",
"address": "ned@innosoft.com"
}
},
"offset_field": 64,
"offset_start": 67,
"offset_end": 98
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 1994,
"month": 10,
"day": 7,
"hour": 16,
"minute": 15,
"second": 5,
"tz_before_gmt": true,
"tz_hour": 7,
"tz_minute": 0
}
},
"offset_field": 98,
"offset_start": 103,
"offset_end": 143
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "A multipart example"
},
"offset_field": 143,
"offset_start": 151,
"offset_end": 173
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"unique-boundary-1"
]
]
}
},
"offset_field": 173,
"offset_start": 186,
"offset_end": 245
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3,
6,
7
]
},
"offset_header": 0,
"offset_body": 247,
"offset_end": 1925
},
{
"headers": [],
"is_encoding_problem": false,
"body": {
"Text": "... Some text appears here ...\r\n\r\n[Note that the blank between the boundary and the start\r\nof the text in this part means no header fields were\r\ngiven and this is text in the US-ASCII character set.\r\nIt could have been done with explicit typing as in the\r\nnext part.]\r\n"
},
"offset_header": 547,
"offset_body": 549,
"offset_end": 818
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"US-ASCII"
]
]
}
},
"offset_field": 841,
"offset_start": 854,
"offset_end": 885
}
],
"is_encoding_problem": false,
"body": {
"Text": "This could have been part of the previous part, but\r\nillustrates explicit versus implicit typing of body\r\nparts.\r\n"
},
"offset_header": 841,
"offset_body": 887,
"offset_end": 1001
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "parallel",
"attributes": [
[
"boundary",
"unique-boundary-2"
]
]
}
},
"offset_field": 1024,
"offset_start": 1037,
"offset_end": 1086
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
4,
5
]
},
"offset_header": 1024,
"offset_body": 1088,
"offset_end": 1416
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "audio",
"c_subtype": "basic",
"attributes": null
}
},
"offset_field": 1109,
"offset_start": 1122,
"offset_end": 1136
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_field": 1136,
"offset_start": 1162,
"offset_end": 1171
}
],
"is_encoding_problem": true,
"body": {
"Text": "... base64-encoded 8000 Hz single-channel\r\n mu-law-format audio data goes here ...\r\n"
},
"offset_header": 1109,
"offset_body": 1173,
"offset_end": 1260
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "jpeg",
"attributes": null
}
},
"offset_field": 1283,
"offset_start": 1296,
"offset_end": 1309
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_field": 1309,
"offset_start": 1335,
"offset_end": 1344
}
],
"is_encoding_problem": true,
"body": {
"Text": "... base64-encoded image data goes here ...\r\n"
},
"offset_header": 1283,
"offset_body": 1346,
"offset_end": 1391
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "enriched",
"attributes": null
}
},
"offset_field": 1439,
"offset_start": 1452,
"offset_end": 1468
}
],
"is_encoding_problem": false,
"body": {
"Text": "This is <bold><italic>enriched.</italic></bold>\r\n<smaller>as defined in RFC 1896</smaller>\r\n\r\nIsn't it\r\n<bigger><bigger>cool?</bigger></bigger>\r\n"
},
"offset_header": 1439,
"offset_body": 1470,
"offset_end": 1615
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "message",
"c_subtype": "rfc822",
"attributes": null
}
},
"offset_field": 1638,
"offset_start": 1651,
"offset_end": 1668
}
],
"is_encoding_problem": false,
"body": {
"Message": {
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "mailbox in US-ASCII",
"address": null
}
},
"offset_field": 1670,
"offset_start": 1675,
"offset_end": 1699
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "address in US-ASCII",
"address": null
}
},
"offset_field": 1699,
"offset_start": 1702,
"offset_end": 1726
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "(subject in US-ASCII)"
},
"offset_field": 1726,
"offset_start": 1734,
"offset_end": 1758
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"ISO-8859-1"
]
]
}
},
"offset_field": 1758,
"offset_start": 1771,
"offset_end": 1804
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "Quoted-printable"
},
"offset_field": 1804,
"offset_start": 1830,
"offset_end": 1849
}
],
"is_encoding_problem": false,
"body": {
"Text": "... Additional text in ISO-8859-1 goes here ...\n"
},
"offset_header": 1670,
"offset_body": 1851,
"offset_end": 1900
}
]
}
},
"offset_header": 1638,
"offset_body": 1670,
"offset_end": 1900
}
]
}
+526
View File
@@ -0,0 +1,526 @@
{
"html_body": [],
"text_body": [],
"attachments": [
1,
2,
3
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Whomever",
"address": null
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 16
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Someone",
"address": null
}
},
"offset_field": 16,
"offset_start": 19,
"offset_end": 29
},
{
"name": {
"Rfc": "date"
},
"value": "Empty",
"offset_field": 29,
"offset_start": 34,
"offset_end": 45
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "whatever"
},
"offset_field": 45,
"offset_start": 53,
"offset_end": 64
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 64,
"offset_start": 77,
"offset_end": 83
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "id1@host.com"
},
"offset_field": 83,
"offset_start": 94,
"offset_end": 111
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"42"
]
]
}
},
"offset_field": 111,
"offset_start": 124,
"offset_end": 161
},
{
"name": {
"Rfc": "content_id"
},
"value": {
"Text": "id001@guppylake.bellcore.com"
},
"offset_field": 161,
"offset_start": 172,
"offset_end": 205
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 207,
"offset_end": 1148
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "message",
"c_subtype": "external-body",
"attributes": [
[
"name",
"BodyFormats.ps"
],
[
"site",
"thumper.bellcore.com"
],
[
"mode",
"image"
],
[
"access-type",
"ANON-FTP"
],
[
"directory",
"pub"
],
[
"expiration",
"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
]
]
}
},
"offset_field": 213,
"offset_start": 226,
"offset_end": 446
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
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,
13,
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,
13,
10
]
},
"offset_header": 213,
"offset_body": 448,
"offset_end": 529
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "message",
"c_subtype": "external-body",
"attributes": [
[
"access-type",
"local-file"
],
[
"name",
"/u/nsb/writing/rfcs/RFC-MIME.ps"
],
[
"site",
"thumper.bellcore.com"
],
[
"expiration",
"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
]
]
}
},
"offset_field": 537,
"offset_start": 550,
"offset_end": 758
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
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,
13,
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,
13,
10
]
},
"offset_header": 537,
"offset_body": 760,
"offset_end": 841
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"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)"
]
]
}
},
"offset_field": 849,
"offset_start": 862,
"offset_end": 1033
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
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,
13,
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,
13,
10,
13,
10,
103,
101,
116,
32,
82,
70,
67,
45,
77,
73,
77,
69,
46,
68,
79,
67,
13,
10
]
},
"offset_header": 849,
"offset_body": 1035,
"offset_end": 1136
}
]
}
+736
View File
@@ -0,0 +1,736 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Al Gore",
"address": "vice-president@whitehouse.gov"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 48
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "White House Transportation Coordinator",
"address": "transport@whitehouse.gov"
}
},
"offset_field": 48,
"offset_start": 51,
"offset_end": 126
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "[Fwd: Map of Argentina with Description]"
},
"offset_field": 126,
"offset_start": 134,
"offset_end": 177
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"D7F------------D7FD5A0B8AB9C65CCDBFA872"
]
]
}
},
"offset_field": 177,
"offset_start": 190,
"offset_end": 275
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 277,
"offset_end": 2723
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 366,
"offset_start": 379,
"offset_end": 410
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 410,
"offset_start": 436,
"offset_end": 443
}
],
"is_encoding_problem": false,
"body": {
"Text": "Fred,\r\n\r\nFire up Air Force One! We're going South!\r\n\r\nThanks,\r\nAl"
},
"offset_header": 366,
"offset_body": 445,
"offset_end": 511
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "message",
"c_subtype": "rfc822",
"attributes": null
}
},
"offset_field": 556,
"offset_start": 569,
"offset_end": 586
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 586,
"offset_start": 612,
"offset_end": 619
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": null
}
},
"offset_field": 619,
"offset_start": 639,
"offset_end": 648
}
],
"is_encoding_problem": false,
"body": {
"Message": {
"html_body": [
1,
2
],
"text_body": [
1,
2
],
"attachments": [
2
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "return_path"
},
"value": {
"Text": "president@whitehouse.gov"
},
"offset_field": 650,
"offset_start": 662,
"offset_end": 691
},
{
"name": {
"Rfc": "received"
},
"value": {
"Text": "from mailhost.whitehouse.gov ([192.168.51.200])\r\n by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453\r\n for <vice-president@heartbeat.whitehouse.gov>;\r\n Mon, 13 Aug 1998 l8:14:23 +1000"
},
"offset_field": 691,
"offset_start": 700,
"offset_end": 921
},
{
"name": {
"Rfc": "received"
},
"value": {
"Text": "from the_big_box.whitehouse.gov ([192.168.51.50])\r\n by mailhost.whitehouse.gov (8.8.8/8.8.7) with ESMTP id RAA20366\r\n for vice-president@whitehouse.gov; Mon, 13 Aug 1998 17:42:41 +1000"
},
"offset_field": 921,
"offset_start": 930,
"offset_end": 1131
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 1998,
"month": 8,
"day": 13,
"hour": 17,
"minute": 42,
"second": 41,
"tz_before_gmt": false,
"tz_hour": 10,
"tz_minute": 0
}
},
"offset_field": 1131,
"offset_start": 1136,
"offset_end": 1170
},
{
"name": {
"Rfc": "message_id"
},
"value": {
"Text": "199804130742.RAA20366@mai1host.whitehouse.gov"
},
"offset_field": 1170,
"offset_start": 1181,
"offset_end": 1231
},
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Bill Clinton",
"address": "president@whitehouse.gov"
}
},
"offset_field": 1231,
"offset_start": 1236,
"offset_end": 1278
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "A1 Gore (The Enforcer)",
"address": "vice-president@whitehouse.gov"
}
},
"offset_field": 1278,
"offset_start": 1281,
"offset_end": 1338
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Map of Argentina with Description"
},
"offset_field": 1338,
"offset_start": 1346,
"offset_end": 1383
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 1383,
"offset_start": 1396,
"offset_end": 1402
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"DC8------------DC8638F443D87A7F0726DEF7"
]
]
}
},
"offset_field": 1402,
"offset_start": 1415,
"offset_end": 1500
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 650,
"offset_body": 1502,
"offset_end": 2676
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 1591,
"offset_start": 1604,
"offset_end": 1635
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "7bit"
},
"offset_field": 1635,
"offset_start": 1661,
"offset_end": 1668
}
],
"is_encoding_problem": false,
"body": {
"Text": "Hi A1,\r\n\r\nI finally figured out this MIME thing. Pretty cool. I'll send you\r\nsome sax music in .au files next week!\r\n\r\nAnyway, the attached image is really too small to get a good look at\r\nArgentina. Try this for a much better map:\r\n\r\n http://www.1one1yp1anet.com/dest/sam/graphics/map-arg.htm\r\n\r\nThen again, shouldn't the CIA have something like that?\r\n\r\nBill"
},
"offset_header": 1591,
"offset_body": 1670,
"offset_end": 2037
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "image",
"c_subtype": "gif",
"attributes": [
[
"name",
"map_of_Argentina.gif"
]
]
}
},
"offset_field": 2082,
"offset_start": 2095,
"offset_end": 2136
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "base64"
},
"offset_field": 2136,
"offset_start": 2162,
"offset_end": 2171
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": [
[
"fi1ename",
"map_of_Argentina.gif"
]
]
}
},
"offset_field": 2171,
"offset_start": 2191,
"offset_end": 2233
}
],
"is_encoding_problem": false,
"body": {
"InlineBinary": [
71,
77,
70,
56,
61,
97,
37,
0,
53,
0,
162,
0,
0,
255,
255,
255,
255,
251,
240,
255,
232,
154,
125,
125,
125,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
44,
0,
0,
0,
0,
37,
0,
53,
0,
0,
3,
237,
8,
186,
220,
254,
112,
192,
73,
163,
4,
34,
235,
157,
9,
225,
96,
40,
12,
215,
8,
126,
166,
72,
42,
169,
224,
189,
94,
187,
173,
152,
25,
187,
132,
2,
183,
180,
253,
245,
128,
87,
0,
136,
82,
149,
66,
177,
133,
71,
169,
44,
114,
122,
39,
77,
238,
197,
0,
6,
157,
26,
232,
38,
70,
237,
194,
154,
32,
109,
231,
183,
236,
86,
173,
216,
209,
81,
74,
158,
150,
29,
196,
240,
186,
51,
182,
94,
225,
202,
231,
156,
123,
166,
226,
131,
122,
44,
82,
117,
110,
126,
77,
93,
51,
123,
56,
94,
95,
66,
67,
121,
89,
138,
48,
4,
67,
118,
118,
65,
144,
25,
98,
109,
75,
58,
134,
76,
128,
137,
130,
116,
46,
76,
147,
127,
88,
155,
40,
141,
167,
125,
169,
115,
46,
132,
133,
157,
141,
114,
163,
99,
139,
94,
158,
58,
58,
182,
53,
108,
178,
77,
160,
105,
106,
183,
184,
99,
87,
83,
166,
70,
198,
199,
178,
147,
196,
154,
176,
108,
55,
39,
209,
145,
205,
212,
208,
147,
45,
98,
28,
219,
220,
60,
211,
72,
225,
50,
222,
41,
215,
204,
191,
45,
47,
50,
162,
235,
34,
219,
238,
197,
240,
214,
242,
230,
227,
185,
224,
237,
38,
231,
243,
238,
43,
72,
8,
28,
72,
72,
160,
193,
131,
8,
19,
42,
60,
152,
0,
0,
59
]
},
"offset_header": 2082,
"offset_body": 2235,
"offset_end": 2629
}
]
}
},
"offset_header": 556,
"offset_body": 650,
"offset_end": 2676
}
]
}
+256
View File
@@ -0,0 +1,256 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
2,
3
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Nathaniel Borenstein",
"address": "nsb@bellcore.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 47
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Ned Freed",
"address": "ned@innosoft.com"
}
},
"offset_field": 47,
"offset_start": 50,
"offset_end": 81
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 1993,
"month": 3,
"day": 22,
"hour": 9,
"minute": 41,
"second": 9,
"tz_before_gmt": true,
"tz_hour": 8,
"tz_minute": 0
}
},
"offset_field": 81,
"offset_start": 86,
"offset_end": 126
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Formatted text mail"
},
"offset_field": 126,
"offset_start": 134,
"offset_end": 156
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 156,
"offset_start": 169,
"offset_end": 175
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"boundary42"
]
]
}
},
"offset_field": 175,
"offset_start": 188,
"offset_end": 233
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2,
3
]
},
"offset_header": 0,
"offset_body": 235,
"offset_end": 588
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 249,
"offset_start": 262,
"offset_end": 293
}
],
"is_encoding_problem": false,
"body": {
"Text": "... plain text version of message goes here ...\r\n"
},
"offset_header": 249,
"offset_body": 295,
"offset_end": 344
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "enriched",
"attributes": null
}
},
"offset_field": 360,
"offset_start": 373,
"offset_end": 389
}
],
"is_encoding_problem": false,
"body": {
"Text": "... RFC 1896 text/enriched version of same message\r\n goes here ...\r\n"
},
"offset_header": 360,
"offset_body": 391,
"offset_end": 462
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "application",
"c_subtype": "x-whatever",
"attributes": null
}
},
"offset_field": 478,
"offset_start": 491,
"offset_end": 516
}
],
"is_encoding_problem": false,
"body": {
"Binary": [
46,
46,
46,
32,
102,
97,
110,
99,
105,
101,
115,
116,
32,
118,
101,
114,
115,
105,
111,
110,
32,
111,
102,
32,
115,
97,
109,
101,
32,
109,
101,
115,
115,
97,
103,
101,
32,
103,
111,
101,
115,
32,
104,
101,
114,
101,
32,
46,
46,
46,
13,
10
]
},
"offset_header": 478,
"offset_body": 518,
"offset_end": 570
}
]
}
+317
View File
@@ -0,0 +1,317 @@
{
"html_body": [
1
],
"text_body": [
1
],
"attachments": [
3,
4
],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Moderator-Address",
"address": null
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 25
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Recipient-List",
"address": null
}
},
"offset_field": 25,
"offset_start": 28,
"offset_end": 45
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 1994,
"month": 3,
"day": 22,
"hour": 13,
"minute": 34,
"second": 51,
"tz_before_gmt": false,
"tz_hour": 0,
"tz_minute": 0
}
},
"offset_field": 45,
"offset_start": 50,
"offset_end": 84
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Internet Digest, volume 42"
},
"offset_field": 84,
"offset_start": 92,
"offset_end": 121
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 121,
"offset_start": 134,
"offset_end": 140
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"---- main boundary ----"
]
]
}
},
"offset_field": 140,
"offset_start": 153,
"offset_end": 220
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 222,
"offset_end": 762
},
{
"headers": [],
"is_encoding_problem": false,
"body": {
"Text": "...Introductory text or table of contents...\r\n"
},
"offset_header": 249,
"offset_body": 251,
"offset_end": 297
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "digest",
"attributes": [
[
"boundary",
"---- next message ----"
]
]
}
},
"offset_field": 326,
"offset_start": 339,
"offset_end": 406
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
3,
4
]
},
"offset_header": 326,
"offset_body": 408,
"offset_end": 731
},
{
"headers": [],
"is_encoding_problem": false,
"body": {
"Message": {
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "someone-else",
"address": null
}
},
"offset_field": 436,
"offset_start": 441,
"offset_end": 456
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 1993,
"month": 3,
"day": 26,
"hour": 11,
"minute": 13,
"second": 32,
"tz_before_gmt": false,
"tz_hour": 2,
"tz_minute": 0
}
},
"offset_field": 456,
"offset_start": 461,
"offset_end": 495
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "my opinion"
},
"offset_field": 495,
"offset_start": 503,
"offset_end": 516
}
],
"is_encoding_problem": false,
"body": {
"Text": "...body goes here ...\r\n"
},
"offset_header": 436,
"offset_body": 518,
"offset_end": 541
}
]
}
},
"offset_header": 434,
"offset_body": 436,
"offset_end": 541
},
{
"headers": [],
"is_encoding_problem": false,
"body": {
"Message": {
"html_body": [
0
],
"text_body": [
0
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "someone-else-again",
"address": null
}
},
"offset_field": 571,
"offset_start": 576,
"offset_end": 597
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 1993,
"month": 3,
"day": 26,
"hour": 10,
"minute": 7,
"second": 13,
"tz_before_gmt": true,
"tz_hour": 5,
"tz_minute": 0
}
},
"offset_field": 597,
"offset_start": 602,
"offset_end": 636
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "my different opinion"
},
"offset_field": 636,
"offset_start": 644,
"offset_end": 667
}
],
"is_encoding_problem": false,
"body": {
"Text": "... another body goes here ...\r\n"
},
"offset_header": 571,
"offset_body": 669,
"offset_end": 701
}
]
}
},
"offset_header": 569,
"offset_body": 571,
"offset_end": 701
}
]
}
+159
View File
@@ -0,0 +1,159 @@
{
"html_body": [
1,
2
],
"text_body": [
1,
2
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": "Nathaniel Borenstein",
"address": "nsb@bellcore.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 47
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": "Ned Freed",
"address": "ned@innosoft.com"
}
},
"offset_field": 47,
"offset_start": 50,
"offset_end": 81
},
{
"name": {
"Rfc": "date"
},
"value": {
"DateTime": {
"year": 1993,
"month": 3,
"day": 21,
"hour": 23,
"minute": 56,
"second": 48,
"tz_before_gmt": true,
"tz_hour": 8,
"tz_minute": 0
}
},
"offset_field": 81,
"offset_start": 86,
"offset_end": 126
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Sample message"
},
"offset_field": 126,
"offset_start": 134,
"offset_end": 151
},
{
"name": {
"Rfc": "mime_version"
},
"value": {
"Text": "1.0"
},
"offset_field": 151,
"offset_start": 164,
"offset_end": 170
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "mixed",
"attributes": [
[
"boundary",
"simple boundary"
]
]
}
},
"offset_field": 170,
"offset_start": 183,
"offset_end": 229
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 231,
"offset_end": 714
},
{
"headers": [],
"is_encoding_problem": false,
"body": {
"Text": "This is implicitly typed plain US-ASCII text.\r\nIt does NOT end with a linebreak."
},
"offset_header": 412,
"offset_body": 414,
"offset_end": 494
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"us-ascii"
]
]
}
},
"offset_field": 515,
"offset_start": 528,
"offset_end": 559
}
],
"is_encoding_problem": false,
"body": {
"Text": "This is explicitly typed plain US-ASCII text.\r\nIt DOES end with a linebreak.\r\n"
},
"offset_header": 515,
"offset_body": 561,
"offset_end": 639
}
]
}
+198
View File
@@ -0,0 +1,198 @@
{
"html_body": [
2
],
"text_body": [
1
],
"attachments": [],
"parts": [
{
"headers": [
{
"name": {
"Rfc": "from"
},
"value": {
"Address": {
"name": null,
"address": "sender@example.com"
}
},
"offset_field": 0,
"offset_start": 5,
"offset_end": 26
},
{
"name": {
"Rfc": "to"
},
"value": {
"Address": {
"name": null,
"address": "recipient@example.com"
}
},
"offset_field": 26,
"offset_start": 29,
"offset_end": 53
},
{
"name": {
"Rfc": "subject"
},
"value": {
"Text": "Multipart Email Example"
},
"offset_field": 53,
"offset_start": 61,
"offset_end": 87
},
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "multipart",
"c_subtype": "alternative",
"attributes": [
[
"boundary",
"boundary-string"
]
]
}
},
"offset_field": 87,
"offset_start": 100,
"offset_end": 152
}
],
"is_encoding_problem": false,
"body": {
"Multipart": [
1,
2
]
},
"offset_header": 0,
"offset_body": 154,
"offset_end": 638
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "plain",
"attributes": [
[
"charset",
"utf-8"
]
]
}
},
"offset_field": 173,
"offset_start": 186,
"offset_end": 216
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 216,
"offset_start": 242,
"offset_end": 261
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": null
}
},
"offset_field": 261,
"offset_start": 281,
"offset_end": 290
}
],
"is_encoding_problem": false,
"body": {
"Text": "Plain text email goes here!\nThis is the fallback if email client does not support HTML\n"
},
"offset_header": 173,
"offset_body": 292,
"offset_end": 381
},
{
"headers": [
{
"name": {
"Rfc": "content_type"
},
"value": {
"ContentType": {
"c_type": "text",
"c_subtype": "html",
"attributes": [
[
"charset",
"utf-8"
]
]
}
},
"offset_field": 402,
"offset_start": 415,
"offset_end": 444
},
{
"name": {
"Rfc": "content_transfer_encoding"
},
"value": {
"Text": "quoted-printable"
},
"offset_field": 444,
"offset_start": 470,
"offset_end": 489
},
{
"name": {
"Rfc": "content_disposition"
},
"value": {
"ContentType": {
"c_type": "inline",
"c_subtype": null,
"attributes": null
}
},
"offset_field": 489,
"offset_start": 509,
"offset_end": 518
}
],
"is_encoding_problem": false,
"body": {
"Html": "<h1>This is the HTML Section!</h1>\n<p>This is what displays in most modern email clients</p>\n"
},
"offset_header": 402,
"offset_body": 520,
"offset_end": 615
}
]
}

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