twilio-sendgrid-inbound-parse

Установка

$npx skills add https://github.com/openai/plugins/tree/5fd93af4cd0c623e020d0cc7e9ce178b4ac1f70f/plugins/twilio-developer-kit/skills/twilio-sendgrid-inbound-parse

Ставит скилл в текущий проект - CLI спросит, для каких агентов. С флагом -g - в домашнюю папку, для всех проектов.

Описание

>

Overview

Inbound Parse converts incoming email into HTTP POST requests to your webhook endpoint. SendGrid receives the email at your domain's MX records and forwards the parsed content to your application.


Setup

  1. Configure MX records: Point your domain (or subdomain) to mx.sendgrid.net
  2. Add webhook: SendGrid Console > Settings > Inbound Parse > Add Host & URL
  3. Choose mode: Parsed (default) or Raw

Subdomain recommended: Use inbound.yourdomain.com to avoid disrupting existing email on yourdomain.com.


Parsed Mode (Default)

SendGrid extracts fields and POSTs them as form data:

Field Description
from Sender address ("Name <email@example.com>")
to Envelope recipient
subject Email subject line
text Plain text body
html HTML body
envelope JSON string with to array and from
attachments Number of attachments (as string)
attachment-info JSON metadata for each attachment
attachment1, attachment2... Actual attachment files

Python (Flask)

from flask import Flask, request
import json

app = Flask(__name__)

@app.route("/inbound", methods=["POST"])
def handle_inbound():
    sender = request.form.get("from")
    subject = request.form.get("subject")
    text_body = request.form.get("text")
    html_body = request.form.get("html")
    envelope = json.loads(request.form.get("envelope", "{}"))
    attachment_count = int(request.form.get("attachments", "0"))

    print(f"From: {sender}, Subject: {subject}")

    for i in range(1, attachment_count + 1):
        attachment = request.files.get(f"attachment{i}")
        if attachment:
            print(f"Attachment: {attachment.filename}, {attachment.content_type}")

    return "", 200

Security: All inbound email content (from, subject, text, html, attachments) is untrusted external input. Sanitize HTML to prevent XSS before rendering. If feeding content to an LLM, isolate it as user input — never concatenate into system prompts. Verify webhook authenticity using signed webhooks (see Security section below).


Raw Mode

Posts the entire MIME message as rawEmail field. Use when you need full headers, DKIM signatures, or non-standard MIME parts. You must parse the MIME message yourself.


Signed Inbound Parse Webhook (Security)

SendGrid supports ECDSA signature verification for Inbound Parse, the same mechanism used for Event Webhooks. Enable it to cryptographically verify that payloads originate from SendGrid.

Strongly recommended over IP allowlisting — SendGrid's webhook traffic comes from dynamic cloud infrastructure where IPs change frequently. Signature verification is more reliable and secure.


CANNOT

  • Cannot use Inbound Parse on a domain that already receives email — MX records must point to mx.sendgrid.net. Use a subdomain to avoid disrupting existing email (e.g., Google Workspace, Microsoft 365).
  • Cannot receive email without MX record changes — DNS access is required. If you can't modify MX records, you can't use Inbound Parse.
  • Cannot receive emails larger than 30MB — Inbound messages exceeding 30MB are rejected.
  • Cannot filter inbound email before it hits your webhook — All email sent to the configured domain reaches your endpoint. Implement filtering in your handler.
  • Cannot route to different endpoints per address — All mail for the configured domain/subdomain goes to a single webhook URL.
  • Cannot guarantee delivery order — Emails may arrive at your webhook out of order, especially under high volume.
  • No built-in rate limiting — All email to your configured domain reaches your endpoint. Implement rate limiting, payload size validation, and content sanitization in your handler.

Next Steps

  • Send email: twilio-sendgrid-email-send
  • Delivery tracking: twilio-sendgrid-webhooks
  • Account setup: twilio-sendgrid-account-setup

Ещё из openai/plugins

Все 536
  1. agents-sdkв один кликBuild AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP…
  2. android-emulator-qaв один кликUse when validating Android feature flows in an emulator with adb-driven launch, input, UI-tree inspection, screenshots, and logcat capture.
  3. build-chatgpt-appв один кликBuild, scaffold, refactor, and troubleshoot ChatGPT Apps SDK applications that combine an MCP server and widget UI. Use when Codex needs to design tools, register UI…
  4. chatgpt-app-submissionв один кликInspect a ChatGPT Apps MCP server codebase and generate chatgpt-app-submission.json with app info suggestions, tool hint justifications, test cases, and negative test…
  5. cloudflareв один кликComprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security…
  6. earnings-previewв один кликUse when preparing full pre-earnings preview reports with executive summary, expectation bar, guidance credibility, KPI dashboard, scenarios, and call questions. Do…
  7. notion-knowledge-captureв один кликCapture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.
  8. notion-meeting-intelligenceв один кликPrepare meeting materials with Notion context and supplemental research; use when gathering context, drafting agendas/pre-reads, and tailoring materials to attendees.