-
Notifications
You must be signed in to change notification settings - Fork 587
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.To.Name containing comma causes problem #268
Comments
This is an issue server side. This may be a temporary fix for you: http://stackoverflow.com/questions/30267595/smtpclient-send-with-valid-email-address-that-has-a-comma-in-it Thanks! |
This is still an issue as of October 5th 2017. More than a year and this bug is not fixed and marked as closed. |
Hi @jsgoupil, I've passed along your vote to our product team on this one. I'm not sure why I closed this issue, but a similar issue exists in some of our other repos and the product team does have a fix scheduled on the backlog. Your vote helps bump the priority, so thanks for taking the time to provide feedback! With Best Regards, Elmer |
Hey @thinkingserious, any update on this? We just spent a whole day investigating why a recipient name containing a comma was processed successfully but dropped because it parsed it incorrectly and used part of it as the email. Thanks! |
Hello @jgyllen, I know this issue is on the product teams radar and a fix should happen at some point. Would you mind reporting your issue using the feedback blue button at SendGrid.com? Queries from customers directly help increase the priority. Thanks! With Best Regards, Elmer |
This still exists and caused problems to all our customers having comma in company name. Is there any time-frame for resolving this? This is a deal breaker for us since users don't want to change company names. |
Hello @velja, I don't have a firm time frame, but I've added your vote to the issue to help increase priority. In the meantime, someone implemented this patch in PHP, you may be able to create a fix based on the same concept in Node.js. With Best Regards, Elmer |
Sendgrid also doesn't quote @ characters in mailboxes properly. This leads to msg.AddTo(new EmailAddress("[email protected]", "[email protected]")) generating an invalid to header: To: [email protected] [email protected] the name portion ([email protected]) is invalid according to RFC2822 -- it may not contain @. While this may appear to be cosmetic it causes deliverability issues, e.g. in exim (with a largely default configuration), header validation is enabled: 2018-10-31 15:43:09 1g0000-000000-LG H=o1.f.az.sendgrid.net [208.117.55.132] X=TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256 CV=no F=<bounces+7000000-0000-....> rejected after DATA: malformed address: [email protected]\n may not follow [email protected] : failing address in "To:" header is: [email protected] [email protected]" The workaround here is the same -- manual quoting of the name is required. |
Unfortunately I too just wasted a whole afternoon tracking down with this precise issue, and it seems crazy it's not yet been dealt with after 3 years. My suggestion is to simply check for names that have a comma in them, and if they are not quoted, then quote them. Simple fix would have saved me, and others so very many hours of work, and the thousands of people wouldn't have their emails silently dropped for such a silly reason. |
Would adding double quotes around the value of the sendgrid-csharp/src/SendGrid/Helpers/Mail/Model/EmailAddress.cs Lines 28 to 32 in 57acb4d
-this.Name = name;
+this.Name = '"' + name+ '"'; .NET normalizes the string. It would probably be best to accept the |
We also wasted a full evening tracking down this issue. It has been 4 years since this was reported. Sengrid team, could you please either solve this issue or make it more visible so other people won't wast time on this? |
Closing as this was marked as a non-library issue. |
After further investigation, I'm reopening this issue and marking it as a bug. This issue has been added to our internal backlog to be prioritized. +1 on the original issue description and PRs will help move it up the backlog. |
This issue has been resolved in the backend. Closing out. |
Issue Summary
When I create Email with Name that is Last, First, it gets thru the SendGrid ok, but then SendGrid drops it. The Json that is created by Mail.Get() looks correct, so I think the problem is in the webApi handler on the server side.
Steps to Reproduce
Send message that has a recipient with name that has a comma in it.
SendGrid will drop it for having an invalid address
Technical details:
var msg = new Mail(new Email("[email protected]"), "Test", new Email("[email protected]", "Last, First"), new Content("text/plain", "Testing 1-2-3"));
var request = new SendGrid.SendGridAPIClient(ApiKey);
request.client.mail.send.post(requestBody: msg.Get());
It sends ok, but now if you go check in SendGrid then you will see that SendGrid drops the email for having a bad address, and it appears to be using part of the name as the address...instead of the actual address.
The text was updated successfully, but these errors were encountered: