I looked at the source and found where the problem lies. time.Parse() does not accept UT as a valide timezone even though rfc5322 allows it (section 4.3) because time.parseTimeZone() does not see a timezone with less than 3 characters as valid.
This could be fixed by adding a special case in email.ParseDate() if the timezone is "UT" and change it to something time.Parse() accepts, or adding yet another special case to time.Parse().
The text was updated successfully, but these errors were encountered:
Do you mean it should not be fixed ?
I get that obsolete timezones should not be generated, but there are many mail servers still sending email with them in their date fields.
Regardless, all the obsolete timezones should be treated the same way, don't you think ?
As a follow-up explanation, the tests of UT were used for testing if any timezone with T shouldn't work and they're now valid.
Since UT is just a standard, I replaced it with UTC to be used as the timezone.