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: fails to parse address list with phrase set to addr-spec #3462
Labels
Comments
I'll look into this. Owner changed to @dsymonds. |
Strictly speaking, "joe@example.com <joe@example.com>" is not an RFC 5322-compliant email address. It does not match name-addr because the initial "joe@example.com" would need to match display-name => phrase => word => atom, but the @ character is not a valid atom character. The formal rendering of the address would need to be: "joe@example.com" <joe@example.com> Having said all that, standards compliance is a noble goal, but strict compliance is not a hard requirement. We could easily make the net/mail parser more liberal in this regard. Have you encountered email addresses of that form in the wild? Are they common? Labels changed: added priority-later, packagechange, removed priority-triage. Status changed to WaitingForReply. |
I came across this comparing the output of a python script I wrote and the go version I'm writing that extracts contacts from my sent folder. I used to use this webmail client (http://blog.ilohamail.org/), that apparently let those types of addresses slip by. I'm also seeing some old Mail.app from my Mac and iPhone OS v3 generated mails with them too. I can take a look at email I've received from popular mailing lists to see if mailman, google groups, etc. let that sort of thing through if you feel it needs to be justified by "more than one guy on the internet". Your call, I like following standards too; but I also like parsing my own files :) |
It doesn't look like it is that common on the big lists I compared (python-dev [mailman], django-developers [Google groups], and zfs-discuss [mailman & jive forum frontend]) this was a couple of years worth of messages per list. In part that might be a bad test though, most people reply to email lists, so you'd have less people typing in the email address and their mail client munging it, which I suspect would be the common case for this issue to show up. If a client did sprintf("%s %s", email, email) instead of sprintf("\"%s\" %s", email, email), which some clients do according to my research. I'm okay with you closing this bug and me being the oddball case. The only reason I noticed this is because python's built in email package was parsing them. For posterity's sake, I wrote a small python and go program to extract To and CC fields from a glob of files. I put them up here: https://github.com/wathiede/GoMailBug It is interesting to throw those at a big directory of mail files and try to understand the differences. Currently, other than the little problem with my sent folder, the only issue I spotted was related to headers with unusual whitespacing; as that's already listed as a TODO, it is to be expected. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: