Skip to content
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

net/mail: missing date layout #22661

Closed
wxdao opened this issue Nov 10, 2017 · 11 comments
Closed

net/mail: missing date layout #22661

wxdao opened this issue Nov 10, 2017 · 11 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@wxdao
Copy link

wxdao commented Nov 10, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

Playground:
https://play.golang.org/p/HRd4hDqXU2

Explanation:
In net/mail/message.go there is

zones := [...]string{"-0700", "MST", "-0700 (MST)"}

However, it leaves out the situation -0700 (GMT:-07:00).

So, rewriting that line to

zones := [...]string{"-0700", "MST", "-0700 (MST)", "-0700 (GMT:-07:00)"}

would fix this issue.

What did you expect to see?

It gets parsed successfully.

What did you see instead?

0001-01-01 00:00:00 +0000 UTC mail: header could not be parsed

@ianlancetaylor ianlancetaylor changed the title missing date layout in net/mail net/mail: missing date layout Nov 10, 2017
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Nov 10, 2017
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 10, 2017
@ianlancetaylor
Copy link
Contributor

Where did you see this date header?

From looking at RFC 5322 I suspect that the right fix is to remove "-0700 (MST)" from dateLayouts and to change ParseDate to skip CFWS at the end.

@wxdao
Copy link
Author

wxdao commented Nov 11, 2017 via email

@bradfitz bradfitz added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels May 29, 2018
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 29, 2018
@gopherbot
Copy link

Change https://golang.org/cl/117596 mentions this issue: net/mail: added support to trailing CFWS in date

@iwdgo
Copy link
Contributor

iwdgo commented Jun 9, 2018

RFC 5322 date format always finishes with a time zone. Checking the ending allows to discard the trailing CFWS as per standard.

@odeke-em
Copy link
Member

As per @ianlancetaylor's comments in the review of CL 117596, that this change is more complicated than permissible this late in the cycle, we are moving this to Go1.12.

@odeke-em odeke-em modified the milestones: Go1.11, Go1.12 Jun 22, 2018
@bcmills bcmills modified the milestones: Go1.12, Go1.13 Jan 30, 2019
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@benburwell
Copy link

Is there any progress on getting this CL applied? I suppose at this point it will be going into 1.14, but it looks like it missed both 1.12 and 1.13, so I'm not sure if anything needs to happen to make sure it goes into 1.14.

@ianlancetaylor
Copy link
Contributor

Bother, we've clearly dropped the ball on this one. The best way would to ping the CL when we open the tree for 1.14. I'll try to do that myself but clearly I've failed to do so in the past.

@benburwell
Copy link

Thanks, I'll keep an eye out for that!

@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@benburwell
Copy link

@ianlancetaylor I see Constantin has uploaded a new patchset on the CL a few days ago; not familiar enough with the Go dev process to know if that is sufficient as a ping?

@ianlancetaylor
Copy link
Contributor

Yes, thanks, it's still on my list, I've just been swamped. Thanks for checking.

@gopherbot
Copy link

Change https://golang.org/cl/240817 mentions this issue: net/mail: add comment on CFWS support

@golang golang locked and limited conversation to collaborators Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests