We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have an email with this From: header:
From:
From: [List] My List <[email protected]>
Since [ and ] are especials (RFC 5322, section 3.2.3), the value doesn't need to be base64 encoded.
[
]
When getting value with GetHeader("from"), it returns wrong value:
GetHeader("from")
[List] My List <[email protected]>
Correct value should be (display name is surrounded by quote characters):
"[List] My List" <[email protected]>
This causes mail.ParseAddress() (std) cannot parse the value of GetHeader("from") (error: mail: missing word in phrase: mail: invalid string).
mail.ParseAddress()
mail: missing word in phrase: mail: invalid string
net/mail package handles this correctly:
net/mail
package main import ( "fmt" "net/mail" ) func main() { addr := mail.Address{Name: "[List] My List", Address: "[email protected]"} hdr := mail.Header{} hdr["From"] = []string{addr.String()} fmt.Printf("%s", hdr.Get("from")) }
It prints:
The text was updated successfully, but these errors were encountered:
When branches are created from issues, their pull requests are automatically linked.
I have an email with this
From:
header:Since
[
and]
are especials (RFC 5322, section 3.2.3), the value doesn't need to be base64 encoded.When getting value with
GetHeader("from")
, it returns wrong value:Correct value should be (display name is surrounded by quote characters):
This causes
mail.ParseAddress()
(std) cannot parse the value ofGetHeader("from")
(error:mail: missing word in phrase: mail: invalid string
).net/mail
package handles this correctly:It prints:
The text was updated successfully, but these errors were encountered: