Open
Description
I got sent a mail which makes the parser output None
for the received
date. Here is a test case to reproduce the problem:
diff --git a/resources/received.json b/resources/received.json
index 4c9161a..652ab61 100644
--- a/resources/received.json
+++ b/resources/received.json
@@ -4200,5 +4200,31 @@
"tz_minute": 0
}
}
+ },
+ {
+ "header": " from [127.0.0.1] (host.example.com [35.173.1.1])\r\n by bf7aa1d4e8a6 with SMTP id 660a079b99f27ed5a03038a8; Mon, 01 Apr 2024\r\n 01:02:19 GMT\r\n",
+ "expected": {
+ "from": {
+ "IpAddr": "127.0.0.1"
+ },
+ "from_ip": "35.173.1.1",
+ "from_iprev": "host.example.com",
+ "by": {
+ "Name": "bf7aa1d4e8a6"
+ },
+ "with": "SMTP",
+ "id": "660a079b99f27ed5a03038a8",
+ "date": {
+ "year": 2024,
+ "month": 4,
+ "day": 1,
+ "hour": 1,
+ "minute": 2,
+ "second": 19,
+ "tz_before_gmt": true,
+ "tz_hour": 0,
+ "tz_minute": 0
+ }
+ }
}
The problem is the line break (\r\n
) inside the date part.
I am not an expert, but looking at RFC 5322, this case looks to me like the obsolete date and time syntax. Is this crate meant to support that? Or are we supposed to work around this? (E.g. by reading the Date
header field in these cases.)
By the way, thanks for your work on this. Really useful for my upcoming mail client :)
Metadata
Metadata
Assignees
Labels
No labels