-
Notifications
You must be signed in to change notification settings - Fork 18k
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: Issue with escaping backslash in Quoted String (email name field) #44573
Comments
In your test program |
Even if we continue, our email provider api gives error (email not sent) Moreover, is this even expected, shouldn't this not give error |
The error I get from your program is |
so having a backslash as the last character in the address name field is the issue right? If that is the case, are there any good practice suggestions for cases like these (name field is set by the enduser) |
I don't know where the string came from. If the program took a string that ends in a backslash and added quotation marks around that string, then, yes, that is the problem. One possible fix would be to take the string from the user, and then put a backslash before every special character. The list of special characters includes quotation mark |
escaping the user input. Got it. P.S :- I was wondering about handling cases like these far down the pipeline (eg. email service). Thank you for the quick response(s) |
You're welcome. Note that you will normally get faster responses from a forum: see https://golang.org/wiki/Questions. |
What version of Go are you using (
go version
)?What did you do?
Run this (Reference Go playground : https://play.golang.org/p/9SmYZp-xPdc)
What did you expect to see?
What did you see instead?
This needs to be fixed as some servers faced/ might face this error { Ours did :( }
The text was updated successfully, but these errors were encountered: