-
Notifications
You must be signed in to change notification settings - Fork 38
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
"Duplicate field in section" MultipartParseException in Email Parse #346
Comments
I just realized that you are using SendGrid's sample payload. That's the cause of the problem you are experiencing. In fact, it was mentioned in the issue you referenced, in addition to at least one other issue (see discussion in #176). The inbound email parser in StrongGrid does not work when data posted from SendGrid is in "raw" format and the sample payload provided by SendGrid is in the format we do not support. |
Are both samples provided by SendGrid 'raw'? There are two examples in their documentation and I could be wrong, but I thought the first one is not 'raw'. |
I have only witnessed the “Duplicate field in section” exception when attempting to parse a webhook payload in raw format, and I know SendGrid’s sample payload is in raw format. That’s why I concluded that you must be using a sample in raw format. Why not use the sample I provided back in 2017 (#202 (comment)) or, better yet, get an actual payload posted by SendGrid to you. |
Good point, I was focused on the implementation of processing the inbound emails, let me try an actual payload on Monday and I will close the issue if that works. |
Sounds good. |
@pllamena I'm assuming you were able to get this to work therefore I will go ahead and close this issue. Let me klow if that's not the case and I'll be glad to reopen. |
Hi @Jericho , I actually still haven't had a chance to test with a real payload. We run into issues with the dns config where the inbound is not coming through and have been working with SendGrid's support to figure that out, but the actual parser exception is still not resolved on my end. |
While you sort out your DNS issue, have you tried the sample I provided? |
Yes, that sample worked! |
Hi @Jericho ,
Thank you for the quick response! I am opening a new issue similar to #202
I am trying to parse the example default payload for inbound email (https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/#example-default-payload). I have it saved as a txt file (attached below), opening it with:
using (var stream = System.IO.File.OpenRead(path)) { var parser = new StrongGrid.WebhookParser(); var inboundEmail = parser.ParseInboundEmailWebhook(stream); ...
The ParseInboundEmailWebhook method throws a "Duplicate field in section" MultipartParseException:
Please let me know if I can provide any more details! I triple checked that SendGrid is NOT configured to send the raw format, although I am not sure that matters when working with the default example.
InboundEmail.txt
Thank you!
The text was updated successfully, but these errors were encountered: