-
Notifications
You must be signed in to change notification settings - Fork 18k
net/mail: ParseDate Does not correctly parse RFC5322 timezone #39906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Change https://golang.org/cl/240357 mentions this issue: |
Somehow duplicates #39260 as obsolete time zones are not supported. |
Do you mean it should not be fixed ? |
I think the point is that any fix in this area may as well fix both issues at the same time. |
@ianlancetaylor I'm going for this if it's not a work in progress. |
@jimist Go for it. Thanks. The place to change is probably |
Change https://golang.org/cl/281052 mentions this issue: |
@ianlancetaylor |
Change https://golang.org/cl/281072 mentions this issue: |
Change https://go.dev/cl/396214 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/BFTQrcW9JzP
What did you expect to see?
What did you see instead?
Research
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) becausetime.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 somethingtime.Parse()
accepts, or adding yet another special case totime.Parse()
.The text was updated successfully, but these errors were encountered: