-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: Provide Address.String() alternative which only converts to RFC 5322 and does not encode as RFC 2047 #27908
Comments
For reference here are the sparkpost docs requiring no RFC 2047 encoding of header fields. I believe they do this because they are allows template/substitution variables within their headers.
|
/cc @bradfitz |
Could you provide some examples? Any suggested method name? |
I just looked through the rfc(5322) a bit and it refers to this syntax as
Maybe |
Name sounds fine. Feel free to send a change. |
Change https://golang.org/cl/139077 mentions this issue: |
RFC 6532 section 3.2 specifically allows this, so I believe it should be documented as such; RFC 5322 on itself doesn't specify raw UTF-8 in addresses. |
@epelc Any update on this? Is there still a desire for this to get in 1.14? I see some unaddressed comments on the CL. |
The
Address.String()
method sometimes encodes as RFC 2047 after the 5322 formatting depending on the characters in the address. However some services (Ala sparkpost transmission api header fields) want RFC 5322 formatted addresses in UTF8 and not encoded as RFC 2047.I'm not sure if the [quoting](
I don't think you can easily or safely reverse the 2047 encoding via the mime package because the code has two paths for quoting.
I think you'd want a
String()
method which basically returned before this.) is a part of rfc 2047 or not.I know this isn't required to the use the api but I'm wondering if there are any other use case which wouldn't require RFC 2047 encoding as well. If so it might be worthwhile to add an additional string/format function.
The text was updated successfully, but these errors were encountered: