diff --git a/src/header.rs b/src/header.rs index 20a7b4e..960881d 100644 --- a/src/header.rs +++ b/src/header.rs @@ -275,9 +275,10 @@ fn unknown_field(input: &str) -> IResult<&str, HeaderField> { // Extract field name let (input, field_name) = field_name(input)?; let (input, body) = unstructured(input)?; + let (input, _) = perm_crlf(input)?; Ok((input, HeaderField::Optional(field_name, body))) } -pub fn field_name(input: &str) -> IResult<&str, &str> { +fn field_name(input: &str) -> IResult<&str, &str> { terminated( take_while1(|c| c >= '\x21' && c <= '\x7E' && c != '\x3A'), pair(tag(":"), space0) diff --git a/src/trace.rs b/src/trace.rs index c781fe2..2515366 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -55,7 +55,7 @@ mod tests { use chrono::{FixedOffset, TimeZone}; #[test] - fn test_received() { + fn test_received_body() { let hdrs = r#"from smtp.example.com ([10.83.2.2]) by server with LMTP id xxxxxxxxx