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: ParseAddress does not conform to rfc5322 #39591

Open
graywolf opened this issue Jun 15, 2020 · 6 comments
Open

net/mail: ParseAddress does not conform to rfc5322 #39591

graywolf opened this issue Jun 15, 2020 · 6 comments
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@graywolf
Copy link

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

I'm not sure how to get this information from play.golang.org.

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

I'm not sure how to get this information from play.golang.org.

What did you do?

https://play.golang.org/p/OjrtE1S12lP

What did you expect to see?

<foo.x.bar@bar.com> <nil>

What did you see instead?

<nil> mail: no angle-addr
@davecheney
Copy link
Contributor

Section 3.2.3 suggests that the local part of an address may be a dot-atom or a quoted string, but not a combination of both as your example shows. Do mail clients accept this address?

@davecheney davecheney added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 15, 2020
@graywolf
Copy link
Author

There is also section 4.4 describing obs-local-part = word *("." word) so that email address should be valid. Also mail send like

$ sendmail -t
From: me@some.domain
To: foo."x".bar@some.domain
Subject: Test

Test.

does arrive.

Note: While section 4 is obsolete, it must be accepted.

Though these syntactic forms MUST NOT be generated according to the grammar
in section 3, they MUST be accepted and parsed by a conformant receiver.

@davecheney
Copy link
Contributor

I read “.” as one literal period character

@graywolf
Copy link
Author

Well yeah, so the obs-local-part in foo."x".bar should be evaluated like atom "." quoted-string "." atom, which looks valid based on:

obs-local-part  =   word *("." word)
word            =   atom / quoted-string

Am I reading the RFC wrong?

@davecheney
Copy link
Contributor

Tbh I’m not sure. What’s your use case? Do you have a need to accept this form of address?

@graywolf
Copy link
Author

graywolf commented Jun 15, 2020

I've tried to put list of valid email addresses [0] through our email validation and some did not pass. So it seemed reasonable to open a bug report about this. If full RFC 5322 compatibility is not a desired goal, then this can be closed.

[0] https://github.com/StoneCypher/testdata-valid-email/blob/master/testdata-valid-email.js

@seankhliao seankhliao changed the title mail.ParseAddress does not conform to rfc5322 net/mail: ParseAddress does not conform to rfc5322 Jun 18, 2021
@seankhliao seankhliao added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Aug 27, 2022
@seankhliao seankhliao added this to the Unplanned milestone Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

3 participants