-
Notifications
You must be signed in to change notification settings - Fork 366
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
Email address parser #207
Comments
Thanks for reporting this! It's a bug that needs to be addressed. Would you
be interested in submitting a PR?
…On Sun, 26 Apr 2020, 10:45 int01, ***@***.***> wrote:
Hi,
If the email address with quotes in the name is parsed (for example, "Gogh
Fir" ***@***.***>), then the flag Quoted will be set, indicates then
the local-part needs quotes too. As a result, String () will return "tesst"
@ test.com.
This is due to the fact that the QcontentSMTP () function is called when
parsing the name in quotation marks and mistakenly sets the flag for local
part.
Thanks.
package main
import (
"log"
"github.com/flashmob/go-guerrilla/mail"
)
func main() {
addr, err := mail.NewAddress(`"Gogh Fir" ***@***.***>`)
if err == nil {
log.Println(addr.DisplayName)
log.Println(addr.String())
}
}
Gogh Fir
***@***.***
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#207>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE6MP5ZLNSTY4L57W6VDLTROOG3DANCNFSM4MRAEH4Q>
.
|
It seems enough in the file "address.go" in the displayName() function add s.LocalPartQuotes = false.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
If the email address with quotes in the name is parsed (for example, "Gogh Fir" <[email protected]>), then the flag Quoted will be set, indicates then the local-part needs quotes too. As a result, String () will return "tesst" @ test.com.
This is due to the fact that the QcontentSMTP () function is called when parsing the name in quotation marks and mistakenly sets the flag for local part.
Thanks.
The text was updated successfully, but these errors were encountered: