[{"data":1,"prerenderedAt":789},["ShallowReactive",2],{"content-query-UHmq5dVHy3":3,"content-query-W4RtfFQaoh":590,"content-query-yP1cWMns5L":615,"content-query-M5aWdXgQKx":619,"content-query-eJ9XWy0CGH":626,"content-query-UP87PRcOMw":639,"content-query-7VgBfxLOWV":643,"content-query-9giMhwHrGj":665,"content-query-Z6fTkbgt1D":672,"content-query-j8GGVgf9na":676,"content-query-G03kJtQzJS":689,"content-query-1mvwAKmUBq":708,"content-query-No6iPTj4EO":733,"content-query-zRSmsuVl55":743,"content-query-MsdmgXewTK":747,"content-query-BMhIInEJl2":754},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"intro":10,"type":11,"layout":12,"level":13,"section":5,"body":14,"_type":584,"_id":585,"_source":182,"_file":586,"_stem":587,"_extension":588,"sitemap":589},"/docs/email/filtering-and-policy","email",false,"","Sender filtering & policy","Harden an email input: restrict inbound mail to an allowlist of From addresses, enable or disable the address, drop or cap attachments, and rely on SPF/DKIM/DMARC results and per-input rate limiting.","Inbound addresses are public, so Webhook Relay gives you controls to keep them clean: a sender allowlist, an on/off switch, attachment dropping and caps, SPF/DKIM/DMARC results to check, and per-input rate limiting.","tutorial","doc","Intermediate",{"type":15,"children":16,"toc":576},"root",[17,25,32,52,61,112,118,130,136,149,247,261,267,347,490,496,529,535,570],{"type":18,"tag":19,"props":20,"children":21},"element","p",{},[22],{"type":23,"value":24},"text","An inbound email address can receive mail from anyone, so each email input has policy controls to keep it safe and quiet.",{"type":18,"tag":26,"props":27,"children":29},"h2",{"id":28},"restrict-senders-from-allowlist",[30],{"type":23,"value":31},"Restrict senders (From allowlist)",{"type":18,"tag":19,"props":33,"children":34},{},[35,37,43,45,50],{"type":23,"value":36},"By default an email input accepts mail from any sender. Add one or more ",{"type":18,"tag":38,"props":39,"children":40},"strong",{},[41],{"type":23,"value":42},"allowed From addresses",{"type":23,"value":44}," to restrict it: when the allowlist is non-empty, only those senders are accepted and everything else is ",{"type":18,"tag":38,"props":46,"children":47},{},[48],{"type":23,"value":49},"silently dropped",{"type":23,"value":51}," (the sender does not get a bounce, and nothing is relayed to your endpoint).",{"type":18,"tag":19,"props":53,"children":54},{},[55],{"type":18,"tag":56,"props":57,"children":60},"img",{"alt":58,"src":59},"Setting an allowed From-addresses filter on an email input","/images/docs/email/email_filter.png",[],{"type":18,"tag":62,"props":63,"children":64},"ul",{},[65,102,107],{"type":18,"tag":66,"props":67,"children":68},"li",{},[69,71,76,78,83,85,92,94,100],{"type":23,"value":70},"Matching is ",{"type":18,"tag":38,"props":72,"children":73},{},[74],{"type":23,"value":75},"exact",{"type":23,"value":77}," and ",{"type":18,"tag":38,"props":79,"children":80},{},[81],{"type":23,"value":82},"case-insensitive",{"type":23,"value":84}," on the message's ",{"type":18,"tag":86,"props":87,"children":89},"code",{"className":88},[],[90],{"type":23,"value":91},"From",{"type":23,"value":93}," address (e.g. ",{"type":18,"tag":86,"props":95,"children":97},{"className":96},[],[98],{"type":23,"value":99},"alerts@stripe.com",{"type":23,"value":101},").",{"type":18,"tag":66,"props":103,"children":104},{},[105],{"type":23,"value":106},"Leave the allowlist empty to accept any sender.",{"type":18,"tag":66,"props":108,"children":109},{},[110],{"type":23,"value":111},"This is a hardening control, not authentication — combine it with the SPF/DKIM/DMARC results below if you need to trust the sender's domain.",{"type":18,"tag":26,"props":113,"children":115},{"id":114},"enable-disable-the-address",[116],{"type":23,"value":117},"Enable / disable the address",{"type":18,"tag":19,"props":119,"children":120},{},[121,123,128],{"type":23,"value":122},"Each email input has an ",{"type":18,"tag":38,"props":124,"children":125},{},[126],{"type":23,"value":127},"enabled",{"type":23,"value":129}," switch. Disable it to stop accepting mail without deleting the input or losing the address; mail sent while disabled is rejected. Delete the input to free the address entirely.",{"type":18,"tag":26,"props":131,"children":133},{"id":132},"attachments",[134],{"type":23,"value":135},"Attachments",{"type":18,"tag":19,"props":137,"children":138},{},[139,141,147],{"type":23,"value":140},"Attachments are inlined into the JSON as base64 (",{"type":18,"tag":86,"props":142,"children":144},{"className":143},[],[145],{"type":23,"value":146},"attachments[].content",{"type":23,"value":148},"). Two controls keep payloads manageable:",{"type":18,"tag":62,"props":150,"children":151},{},[152,185],{"type":18,"tag":66,"props":153,"children":154},{},[155,160,162,167,169,175,177,183],{"type":18,"tag":38,"props":156,"children":157},{},[158],{"type":23,"value":159},"Drop attachments",{"type":23,"value":161}," — skip attachment parsing and storage entirely. The ",{"type":18,"tag":86,"props":163,"children":165},{"className":164},[],[166],{"type":23,"value":132},{"type":23,"value":168}," metadata may still be present with ",{"type":18,"tag":86,"props":170,"children":172},{"className":171},[],[173],{"type":23,"value":174},"truncated: true",{"type":23,"value":176},", but no ",{"type":18,"tag":86,"props":178,"children":180},{"className":179},[],[181],{"type":23,"value":182},"content",{"type":23,"value":184}," is delivered. Use this when you only care about the email body.",{"type":18,"tag":66,"props":186,"children":187},{},[188,193,195,200,202,208,210,216,217,223,225,230,232,237,239,245],{"type":18,"tag":38,"props":189,"children":190},{},[191],{"type":23,"value":192},"Attachment size cap",{"type":23,"value":194}," — a per-message total cap on attachment bytes. When exceeded, attachments are ",{"type":18,"tag":38,"props":196,"children":197},{},[198],{"type":23,"value":199},"truncated",{"type":23,"value":201},": ",{"type":18,"tag":86,"props":203,"children":205},{"className":204},[],[206],{"type":23,"value":207},"name",{"type":23,"value":209},", ",{"type":18,"tag":86,"props":211,"children":213},{"className":212},[],[214],{"type":23,"value":215},"content_type",{"type":23,"value":77},{"type":18,"tag":86,"props":218,"children":220},{"className":219},[],[221],{"type":23,"value":222},"size",{"type":23,"value":224}," are kept, ",{"type":18,"tag":86,"props":226,"children":228},{"className":227},[],[229],{"type":23,"value":182},{"type":23,"value":231}," is omitted, and ",{"type":18,"tag":86,"props":233,"children":235},{"className":234},[],[236],{"type":23,"value":199},{"type":23,"value":238}," is set to ",{"type":18,"tag":86,"props":240,"children":242},{"className":241},[],[243],{"type":23,"value":244},"true",{"type":23,"value":246},". A server-wide default applies unless you set a lower per-input cap.",{"type":18,"tag":19,"props":248,"children":249},{},[250,252,259],{"type":23,"value":251},"See the ",{"type":18,"tag":253,"props":254,"children":256},"a",{"href":255},"/docs/email/payload#attachment-object",[257],{"type":23,"value":258},"payload reference",{"type":23,"value":260}," for the attachment fields.",{"type":18,"tag":26,"props":262,"children":264},{"id":263},"authentication-results",[265],{"type":23,"value":266},"Authentication results",{"type":18,"tag":19,"props":268,"children":269},{},[270,272,281,282,291,292,301,303,309,310,316,317,323,325,331,333,338,340,345],{"type":23,"value":271},"Every parsed message includes the receiving mail server's ",{"type":18,"tag":38,"props":273,"children":274},{},[275],{"type":18,"tag":86,"props":276,"children":278},{"className":277},[],[279],{"type":23,"value":280},"spf",{"type":23,"value":209},{"type":18,"tag":38,"props":283,"children":284},{},[285],{"type":18,"tag":86,"props":286,"children":288},{"className":287},[],[289],{"type":23,"value":290},"dkim",{"type":23,"value":77},{"type":18,"tag":38,"props":293,"children":294},{},[295],{"type":18,"tag":86,"props":296,"children":298},{"className":297},[],[299],{"type":23,"value":300},"dmarc",{"type":23,"value":302}," results (e.g. ",{"type":18,"tag":86,"props":304,"children":306},{"className":305},[],[307],{"type":23,"value":308},"pass",{"type":23,"value":209},{"type":18,"tag":86,"props":311,"children":313},{"className":312},[],[314],{"type":23,"value":315},"fail",{"type":23,"value":209},{"type":18,"tag":86,"props":318,"children":320},{"className":319},[],[321],{"type":23,"value":322},"none",{"type":23,"value":324},"). Check these in a ",{"type":18,"tag":253,"props":326,"children":328},{"href":327},"/docs/webhooks/functions",[329],{"type":23,"value":330},"transform function",{"type":23,"value":332}," or at your endpoint before trusting a message — for example, drop anything where ",{"type":18,"tag":86,"props":334,"children":336},{"className":335},[],[337],{"type":23,"value":300},{"type":23,"value":339}," isn't ",{"type":18,"tag":86,"props":341,"children":343},{"className":342},[],[344],{"type":23,"value":308},{"type":23,"value":346}," for a domain you expect.",{"type":18,"tag":348,"props":349,"children":353},"pre",{"className":350,"code":351,"language":352,"meta":7,"style":7},"language-js shiki shiki-themes github-dark","const email = JSON.parse(r.body);\nif (email.dmarc !== \"pass\") {\n  r.setResponseStatus(202); // accept but ignore\n  return;\n}\n","js",[354],{"type":18,"tag":86,"props":355,"children":356},{"__ignoreMap":7},[357,402,432,467,481],{"type":18,"tag":358,"props":359,"children":362},"span",{"class":360,"line":361},"line",1,[363,369,375,380,385,391,397],{"type":18,"tag":358,"props":364,"children":366},{"style":365},"--shiki-default:#F97583",[367],{"type":23,"value":368},"const",{"type":18,"tag":358,"props":370,"children":372},{"style":371},"--shiki-default:#79B8FF",[373],{"type":23,"value":374}," email",{"type":18,"tag":358,"props":376,"children":377},{"style":365},[378],{"type":23,"value":379}," =",{"type":18,"tag":358,"props":381,"children":382},{"style":371},[383],{"type":23,"value":384}," JSON",{"type":18,"tag":358,"props":386,"children":388},{"style":387},"--shiki-default:#E1E4E8",[389],{"type":23,"value":390},".",{"type":18,"tag":358,"props":392,"children":394},{"style":393},"--shiki-default:#B392F0",[395],{"type":23,"value":396},"parse",{"type":18,"tag":358,"props":398,"children":399},{"style":387},[400],{"type":23,"value":401},"(r.body);\n",{"type":18,"tag":358,"props":403,"children":405},{"class":360,"line":404},2,[406,411,416,421,427],{"type":18,"tag":358,"props":407,"children":408},{"style":365},[409],{"type":23,"value":410},"if",{"type":18,"tag":358,"props":412,"children":413},{"style":387},[414],{"type":23,"value":415}," (email.dmarc ",{"type":18,"tag":358,"props":417,"children":418},{"style":365},[419],{"type":23,"value":420},"!==",{"type":18,"tag":358,"props":422,"children":424},{"style":423},"--shiki-default:#9ECBFF",[425],{"type":23,"value":426}," \"pass\"",{"type":18,"tag":358,"props":428,"children":429},{"style":387},[430],{"type":23,"value":431},") {\n",{"type":18,"tag":358,"props":433,"children":435},{"class":360,"line":434},3,[436,441,446,451,456,461],{"type":18,"tag":358,"props":437,"children":438},{"style":387},[439],{"type":23,"value":440},"  r.",{"type":18,"tag":358,"props":442,"children":443},{"style":393},[444],{"type":23,"value":445},"setResponseStatus",{"type":18,"tag":358,"props":447,"children":448},{"style":387},[449],{"type":23,"value":450},"(",{"type":18,"tag":358,"props":452,"children":453},{"style":371},[454],{"type":23,"value":455},"202",{"type":18,"tag":358,"props":457,"children":458},{"style":387},[459],{"type":23,"value":460},"); ",{"type":18,"tag":358,"props":462,"children":464},{"style":463},"--shiki-default:#6A737D",[465],{"type":23,"value":466},"// accept but ignore\n",{"type":18,"tag":358,"props":468,"children":470},{"class":360,"line":469},4,[471,476],{"type":18,"tag":358,"props":472,"children":473},{"style":365},[474],{"type":23,"value":475},"  return",{"type":18,"tag":358,"props":477,"children":478},{"style":387},[479],{"type":23,"value":480},";\n",{"type":18,"tag":358,"props":482,"children":484},{"class":360,"line":483},5,[485],{"type":18,"tag":358,"props":486,"children":487},{"style":387},[488],{"type":23,"value":489},"}\n",{"type":18,"tag":26,"props":491,"children":493},{"id":492},"rate-limiting-abuse-controls",[494],{"type":23,"value":495},"Rate limiting & abuse controls",{"type":18,"tag":62,"props":497,"children":498},{},[499,509,519],{"type":18,"tag":66,"props":500,"children":501},{},[502,507],{"type":18,"tag":38,"props":503,"children":504},{},[505],{"type":23,"value":506},"Per-input rate limit",{"type":23,"value":508}," — each address is rate limited to absorb bursts and abuse; excess mail is rejected (the sending server may retry).",{"type":18,"tag":66,"props":510,"children":511},{},[512,517],{"type":18,"tag":38,"props":513,"children":514},{},[515],{"type":23,"value":516},"Message size cap",{"type":23,"value":518}," — oversized messages are rejected.",{"type":18,"tag":66,"props":520,"children":521},{},[522,527],{"type":18,"tag":38,"props":523,"children":524},{},[525],{"type":23,"value":526},"Unknown / disabled addresses",{"type":23,"value":528}," — mail to an address that doesn't resolve is bounced; mail to a disabled input is rejected.",{"type":18,"tag":26,"props":530,"children":532},{"id":531},"related",[533],{"type":23,"value":534},"Related",{"type":18,"tag":62,"props":536,"children":537},{},[538,549,560],{"type":18,"tag":66,"props":539,"children":540},{},[541,547],{"type":18,"tag":253,"props":542,"children":544},{"href":543},"/docs/email",[545],{"type":23,"value":546},"Receive emails as webhooks",{"type":23,"value":548}," — set up an email input.",{"type":18,"tag":66,"props":550,"children":551},{},[552,558],{"type":18,"tag":253,"props":553,"children":555},{"href":554},"/docs/email/payload",[556],{"type":23,"value":557},"Email webhook payload",{"type":23,"value":559}," — every field.",{"type":18,"tag":66,"props":561,"children":562},{},[563,568],{"type":18,"tag":253,"props":564,"children":565},{"href":327},[566],{"type":23,"value":567},"Transform functions",{"type":23,"value":569}," — filter or reshape messages in flight.",{"type":18,"tag":571,"props":572,"children":573},"style",{},[574],{"type":23,"value":575},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":434,"depth":434,"links":577},[578,579,580,581,582,583],{"id":28,"depth":404,"text":31},{"id":114,"depth":404,"text":117},{"id":132,"depth":404,"text":135},{"id":263,"depth":404,"text":266},{"id":492,"depth":404,"text":495},{"id":531,"depth":404,"text":534},"markdown","content:docs:email:3.filtering-and-policy.md","docs/email/3.filtering-and-policy.md","docs/email/3.filtering-and-policy","md",{"loc":4},[591,594,597,600,603,606,609,612],{"_path":592,"title":593},"/docs/installation/cli","CLI",{"_path":595,"title":596},"/docs/installation/docker","Docker container",{"_path":598,"title":599},"/docs/installation/docker-compose","Docker Compose",{"_path":601,"title":602},"/docs/installation/kubernetes","Kubernetes",{"_path":604,"title":605},"/docs/installation/autostart-windows","Autostart (Windows)",{"_path":607,"title":608},"/docs/installation/autostart-linux","Autostart (Linux)",{"_path":610,"title":611},"/docs/installation/autostart-macos","Autostart (MacOS)",{"_path":613,"title":614},"/docs/installation/behind-proxy","HTTP proxy configuration",[616],{"_path":617,"title":618},"/docs/webhooks/internal/localhost","Receiving webhooks on localhost",[620,623],{"_path":621,"title":622},"/docs/webhooks/public/public-destination","Forward to public URL",{"_path":624,"title":625},"/docs/webhooks/public/multiple-destination-urls","Multiple destinations",[627,630,633,636],{"_path":628,"title":629},"/docs/webhooks/auth/username-password","Username and password",{"_path":631,"title":632},"/docs/webhooks/auth/hmac","HMAC",{"_path":634,"title":635},"/docs/webhooks/auth/jwt","JWT authentication",{"_path":637,"title":638},"/docs/webhooks/auth/http-method","Auth using request method",[640],{"_path":641,"title":642},"/docs/webhooks/cron/using-cron-webhooks","Schedule recurring webhooks",[644,647,650,653,656,659,662],{"_path":645,"title":646},"/docs/service-connections","Service Connections",{"_path":648,"title":649},"/docs/service-connections/aws_s3","AWS S3",{"_path":651,"title":652},"/docs/service-connections/aws_sns","AWS SNS",{"_path":654,"title":655},"/docs/service-connections/aws_sqs","AWS SQS",{"_path":657,"title":658},"/docs/service-connections/azure","Azure",{"_path":660,"title":661},"/docs/service-connections/gcp_gcs","GCP Cloud Storage",{"_path":663,"title":664},"/docs/service-connections/gcp_pubsub","GCP Pub/Sub",[666,669],{"_path":667,"title":668},"/docs/tunnels/demoing-your-website","Demoing your website",{"_path":670,"title":671},"/docs/tunnels/regions","Regions",[673,674,675],{"_path":543,"title":546},{"_path":554,"title":557},{"_path":4,"title":8},[677,680,683,686],{"_path":678,"title":679},"/docs/account/account-management","Account management",{"_path":681,"title":682},"/docs/account/mfa","Multi-factor authentication (MFA)",{"_path":684,"title":685},"/docs/account/team","Teams and sub-accounts",{"_path":687,"title":688},"/docs/account/billing-and-subscriptions","Billing & subscriptions",[690,693,696,699,702,705],{"_path":691,"title":692},"/docs/tutorials/cicd/jenkins-bitbucket","Jenkins and Bitbucket",{"_path":694,"title":695},"/docs/tutorials/cicd/jenkins-github","Jenkins and GitHub",{"_path":697,"title":698},"/docs/tutorials/cicd/jenkins-plugin","Jenkins Plugin",{"_path":700,"title":701},"/docs/tutorials/cicd/kubernetes-operator","Kubernetes Operator",{"_path":703,"title":704},"/docs/tutorials/cicd/terraform-atlantis","Terraform Atlantis",{"_path":706,"title":707},"/docs/tutorials/cicd/webhook-exec","Execute scripts on webhook",[709,712,715,718,721,724,727,730],{"_path":710,"title":711},"/docs/tutorials/email/airtable","Email to Airtable",{"_path":713,"title":714},"/docs/tutorials/email/api","Email to API",{"_path":716,"title":717},"/docs/tutorials/email/database","Email to Database",{"_path":719,"title":720},"/docs/tutorials/email/discord","Email to Discord",{"_path":722,"title":723},"/docs/tutorials/email/google-sheets","Email to Google Sheets",{"_path":725,"title":726},"/docs/tutorials/email/microsoft-teams","Email to Microsoft Teams",{"_path":728,"title":729},"/docs/tutorials/email/notion","Email to Notion",{"_path":731,"title":732},"/docs/tutorials/email/slack","Email to Slack",[734,737,740],{"_path":735,"title":736},"/docs/tutorials/edge/home-assistant","Home Assistant",{"_path":738,"title":739},"/docs/tutorials/edge/javascript-app","JavaScript app",{"_path":741,"title":742},"/docs/tutorials/edge/node-red","Node-RED",[744],{"_path":745,"title":746},"/docs/tutorials/warehouse/bigquery","GCP BigQuery",[748,751],{"_path":749,"title":750},"/docs/tutorials/transform/docker-to-slack","DockerHub webhook to Slack notification",{"_path":752,"title":753},"/docs/tutorials/transform/enrich-webhooks","Enrich webhooks from APIs",[755,758,761,764,767,770,773,776,779,782,784,787],{"_path":756,"title":757},"/docs/webhooks/functions/manipulating-json","JSON encoding",{"_path":759,"title":760},"/docs/webhooks/functions/make-http-request","Make HTTP request",{"_path":762,"title":763},"/docs/webhooks/functions/modify-request","Read, write request data",{"_path":765,"title":766},"/docs/webhooks/functions/multipart-form-data","Multipart form to JSON",{"_path":768,"title":769},"/docs/webhooks/functions/url-encoded-data","URL Encoded Form",{"_path":771,"title":772},"/docs/webhooks/functions/working-with-time","Working with time",{"_path":774,"title":775},"/docs/webhooks/functions/send-emails","Sending emails",{"_path":777,"title":778},"/docs/webhooks/functions/crypto-functions","Base64, encryption",{"_path":780,"title":781},"/docs/webhooks/functions/integrate-into-cicd","Integrating into CI/CD",{"_path":783,"title":746},"/docs/webhooks/functions/big-query",{"_path":785,"title":786},"/docs/webhooks/functions/accessing-metadata","Accessing metadata",{"_path":327,"title":788},"Functions",1782718159702]