Skip to content

Email sending failed (drop) if there is a "," in the mail to name #191

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

Closed
sanaulla123 opened this issue Apr 13, 2017 · 9 comments
Closed
Labels
difficulty: unknown or n/a fix is unknown in difficulty type: non-library issue API issue not solvable via the SDK

Comments

@sanaulla123
Copy link

Issue Summary

If the mail to name contains ",", The mail gets dropped and the email becomes the text before ",".

Sample code:

Email from = new Email("[email protected]", "From");
Content content = new Content("text/html", "Body");

Email to = new Email("[email protected]", "First Name, Last Name");
Mail mail = new Mail(from, "Subject", to, content);

TrackingSettings trackingSetting = new TrackingSettings();

ClickTrackingSetting clickTrackingSetting = new ClickTrackingSetting();
clickTrackingSetting.setEnable(true);
trackingSetting.setClickTrackingSetting(clickTrackingSetting);

OpenTrackingSetting openTrackingSetting = new OpenTrackingSetting();
openTrackingSetting.setEnable(true);
trackingSetting.setOpenTrackingSetting(openTrackingSetting);

mail.setTrackingSettings(trackingSetting);
mail.categories = Arrays.asList("category");

Request request = new Request();
request.method = Method.POST;
request.endpoint = "mail/send";
request.body = mail.build();
System.out.println(request.body);

Steps to Reproduce

  1. Create a Request Object using sample code
  2. Invoke the API using: Response response = sendGrid.api(request);
  3. The response is successful. But the mail eventually goes into drop status.

Below is the status of the email sent with the Mail to name given above.
sendgrid-issue

Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?

Technical details:

  • sendgrid-java Version: master (latest commit: [commit number])
  • Java Version: 7
@thinkingserious
Copy link
Contributor

Hello @sanaulla123,

This is a known issue and is in our backlog for a fix. Unfortunately, I don't have a timeline for the fix. However, here is a workaround: sendgrid/sendgrid-python#291 (comment)

With Best Regards,

Elmer

@thinkingserious thinkingserious added status: help wanted requesting help from the community type: bug bug in the library labels Apr 13, 2017
@thinkingserious thinkingserious added type: non-library issue API issue not solvable via the SDK and removed status: help wanted requesting help from the community type: bug bug in the library labels Apr 29, 2017
@idntfy
Copy link

idntfy commented Aug 18, 2017

Any update on this? This is very surprising to see this kind of issues remaining not fixed for such long time. Thanks.

@thinkingserious
Copy link
Contributor

Good news @sanaulla123 and @idntfy! This is issue is now resolved. Thank you for your patience :)

@idntfy
Copy link

idntfy commented Aug 18, 2017

Still experiencing, I can provide SMTP-ID and MSGID if it's fine from privacy perspective (it doesn't look they can expose something, but I don't want to do this without your confirmation).

Please reopen.

@thinkingserious
Copy link
Contributor

My apologies, I was thinking of this issue: sendgrid/sendgrid-python#302

@thinkingserious
Copy link
Contributor

I have added your vote to this issue. Getting this fixed is a matter of priority. More +1s on this issue will help it rise in the backlog. Thanks!

@idntfy
Copy link

idntfy commented Aug 18, 2017

For Java, for ourselves, applied the following workaround, which escapes it when needed:

import javax.mail.internet.HeaderTokenizer;
import javax.mail.internet.MimeUtility;

final String to = MimeUtility.quote("First Name, Last Name", HeaderTokenizer.RFC822);

(using javax.mail:mail:1.4.7)

@thinkingserious
Copy link
Contributor

That's cool @idntfy! May we please offer you some swag for providing that workaround?

@mbernier mbernier removed difficulty: very hard fix is very hard in difficulty difficulty: medium fix is medium in difficulty labels Oct 27, 2017
@thinkingserious thinkingserious added the difficulty: unknown or n/a fix is unknown in difficulty label Sep 29, 2018
@eshanholtz
Copy link
Contributor

Closing this as it has been marked a non-library issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: unknown or n/a fix is unknown in difficulty type: non-library issue API issue not solvable via the SDK
Projects
None yet
Development

No branches or pull requests

5 participants