twilio-sendgrid-inbound-parse

Receive inbound email via SendGrid Inbound Parse webhooks with MX record setup and attachment handling.

5.3k|765|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/openai/plugins --skill twilio-sendgrid-inbound-parse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: twilio-sendgrid-inbound-parse
Source: https://github.com/openai/plugins/tree/main/plugins/twilio-developer-kit/skills/twilio-sendgrid-inbound-parse
Command: npx skills add https://github.com/openai/plugins --skill twilio-sendgrid-inbound-parse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires flask.

What problem does it solve?

Building email-to-app workflows requires receiving and parsing inbound email programmatically, which involves DNS configuration, webhook endpoints, and MIME parsing that are easy to get wrong.

Core Features & Use Cases

  • Inbound Parse Setup: Guides MX record configuration pointing to mx.sendgrid.net and webhook registration in the SendGrid Console, recommending subdomains to avoid disrupting existing email.
  • Parsed and Raw Modes: Explains the form-data fields SendGrid POSTs (from, subject, text, html, envelope, attachments) and when to use raw MIME mode for full headers and DKIM signatures.
  • Attachment Handling and Security: Demonstrates processing attachment files in a Flask handler, plus ECDSA signed webhook verification and sanitization of untrusted email content.
  • Use Case: Build a support ticket pipeline where emails sent to inbound.yourdomain.com are parsed by your webhook and converted into tickets with attachments preserved.

Quick Start

Set up a SendGrid Inbound Parse webhook endpoint in Flask that receives parsed email fields and attachments for the subdomain inbound.yourdomain.com.

Frequently Asked Questions about twilio-sendgrid-inbound-parse

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I receive inbound email with SendGrid Inbound Parse?

Point your domain or subdomain MX records to mx.sendgrid.net, then add a host and webhook URL under SendGrid Console Settings > Inbound Parse. SendGrid POSTs parsed fields like from, subject, text, html, and attachments to your endpoint as form data.

How to handle email attachments in a SendGrid inbound webhook?

Read the attachments field for the count, then retrieve each file from request.files using keys attachment1, attachment2, and so on. The attachment-info field contains JSON metadata for each file.

What is the difference between parsed and raw mode in SendGrid Inbound Parse?

Parsed mode extracts fields like from, subject, text, and html into form data automatically. Raw mode posts the entire MIME message as rawEmail, which you parse yourself when you need full headers, DKIM signatures, or non-standard MIME parts.

Can I use SendGrid Inbound Parse on a domain that already receives email?

No, MX records must point to mx.sendgrid.net, which would disrupt existing email on that domain. Use a subdomain such as inbound.yourdomain.com so services like Google Workspace or Microsoft 365 keep working on the primary domain.

What are the limitations of SendGrid Inbound Parse?

Messages over 30MB are rejected, all mail for the configured domain goes to a single webhook URL with no pre-filtering, and delivery order is not guaranteed. Implement filtering, rate limiting, and payload validation in your own handler.

How do I verify SendGrid inbound webhook requests are authentic?

Enable signed Inbound Parse webhooks, which use ECDSA signature verification like SendGrid Event Webhooks. This is recommended over IP allowlisting because SendGrid webhook traffic comes from dynamic cloud infrastructure with frequently changing IPs.