-
Notifications
You must be signed in to change notification settings - Fork 17
Description
First, thank you very much for letters. I've been enjoying working with it.
If an email's headers has a date in the format "Thu, 14 Aug 2025 14:15:52 GMT", letters will not parse it. (That is, the return value of email.Headers.Date
is a zero value time.Time.)
This may be working as intended since ParseDateHeader
tries time.RFC1123Z
but not time.RFC1123
.
On the other hand, I wonder whether this is the right choice. If I am reading RFC 5322's section on dates correctly, "Thu, 14 Aug 2025 14:15:52 GMT" is a valid date format. It uses an "obsolete time zone" instead of the (preferred) numeric offset, but that doesn't make it an invalid format. The RFC specifies that such obsolete "forms MUST NOT be generated...,they MUST be accepted and parsed by a conformant receiver."
I know that it's possible to swap in a different parser (great design choice, by the way!), and I've done that to handle some of the emails in my situation. But I still wanted to confirm that you intentionally omit time.RFC1123
from ParseDateHeader
. (If not, I'm happy to submit a PR and test.)