diff --git a/crates/kumo-log-types/data/rfc5965/3.eml b/crates/kumo-log-types/data/rfc5965/3.eml index 50a242f5..e503f23f 100644 --- a/crates/kumo-log-types/data/rfc5965/3.eml +++ b/crates/kumo-log-types/data/rfc5965/3.eml @@ -23,6 +23,7 @@ Original-Mail-From: Original-Rcpt-To: user@example.com Received-Date: Thu, 14 Dec 2023 17:16:15 +0100 Reported-Domain: bounce.kumo.example.com +Authentication-Results: authentication result string is not available ------=_Part_5903806_123377560.1477885569558 Content-Type: message/rfc822 diff --git a/crates/kumo-log-types/data/rfc5965/4.eml b/crates/kumo-log-types/data/rfc5965/4.eml new file mode 100644 index 00000000..d0469703 --- /dev/null +++ b/crates/kumo-log-types/data/rfc5965/4.eml @@ -0,0 +1,42 @@ +Date: Thu, 14 Dec 2023 17:16:15 +0100 +Subject: FW:test Thu, 14 Dec 2023 16:16:14 +0000 +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=feedback-report; + boundary="----=_Part_5903806_123377560.1477885569558" + +------=_Part_5903806_123377560.1477885569558 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +This is an email abuse report for an email message from bounce.kumo.example.com on Thu, 14 Dec 2023 17:16:15 +0100 + +------=_Part_5903806_123377560.1477885569558 +Content-Type: message/feedback-report +Content-Transfer-Encoding: 8bit +Content-Disposition: inline + +User-Agent: ReturnPathFBL/2.0 +Version: 1 +Arrival-Date: Wed, 13 Dec 2023 19:03:30 +0000 +Original-Rcpt-To: cb4a01a48251d4765f489076aa81e2a4@comcast.net +Source: Comcast +Abuse-Type: complaint +Feedback-Type: abuse +Original-Mail-From: foo@bounce.example.com +Reported-Domain: bounce.example.com +Source-Ip: x.x.x.x +Subscription-Link: https://fbl.returnpath.net/manage/subscriptions/xxxx + +------=_Part_5903806_123377560.1477885569558 +Content-Type: message/rfc822 +Content-Disposition: inline + +Date: Thu, 14 Dec 2023 16:16:14 +0000 +To: user@example.com +Subject: test Thu, 14 Dec 2023 16:16:14 +0000 + +This is a test mailing + +------=_Part_5903806_123377560.1477885569558-- + diff --git a/crates/kumo-log-types/src/rfc5965.rs b/crates/kumo-log-types/src/rfc5965.rs index 9dfe2579..4cf6bbb5 100644 --- a/crates/kumo-log-types/src/rfc5965.rs +++ b/crates/kumo-log-types/src/rfc5965.rs @@ -426,7 +426,9 @@ Some( ), reporting_mta: None, source_ip: None, - authentication_results: [], + authentication_results: [ + "authentication result string is not available", + ], original_rcpto_to: [ "user@example.com", ], @@ -442,6 +444,64 @@ Subject: test Thu, 14 Dec 2023 16:16:14 +0000 This is a test mailing +", + ), + supplemental_trace: None, + }, +) +"# + ); + } + + #[test] + fn rfc5965_4() { + let result = ARFReport::parse(include_bytes!("../data/rfc5965/4.eml")).unwrap(); + k9::snapshot!( + result, + r#" +Some( + ARFReport { + feedback_type: "abuse", + user_agent: "ReturnPathFBL/2.0", + version: "1", + arrival_date: Some( + 2023-12-13T19:03:30Z, + ), + incidents: None, + original_envelope_id: None, + original_mail_from: Some( + "foo@bounce.example.com", + ), + reporting_mta: None, + source_ip: Some( + "x.x.x.x", + ), + authentication_results: [], + original_rcpto_to: [ + "cb4a01a48251d4765f489076aa81e2a4@comcast.net", + ], + reported_domain: [ + "bounce.example.com", + ], + reported_uri: [], + extensions: { + "abuse-type": [ + "complaint", + ], + "subscription-link": [ + "https://fbl.returnpath.net/manage/subscriptions/xxxx", + ], + "source": [ + "Comcast", + ], + }, + original_message: Some( + "Date: Thu, 14 Dec 2023 16:16:14 +0000 +To: user@example.com +Subject: test Thu, 14 Dec 2023 16:16:14 +0000 + +This is a test mailing + ", ), supplemental_trace: None,