Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/content/docs/email-routing/setup/mta-sts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ Next you need an HTTPS endpoint at `mta-sts.example.com` to serve your policy fi

To do this you need to deploy a Worker that allows email clients to pull Cloudflare’s Email Routing policy file using the “well-known” URI convention.

4. Go to your **Account** > **Workers & Pages** and press **Create Application**. Pick the "MTA-STS" template from the list.

![MTA-STS Worker](~/assets/images/email-routing/mta-sts-worker.png)
4. Go to your **Account** > **Workers & Pages** and press **Create Application**. Pick the default "Hello World" option button, and replace the sample worker code with the following:

```index.js
export default {
async fetch(request, env, ctx) {
return await fetch("https://mta-sts.mx.cloudflare.net/.well-known/mta-sts.txt")
},
};
```

5. This Worker proxies `https://mta-sts.mx.cloudflare.net/.well-known/mta-sts.txt` to your own domain. After deploying it, go to the Worker configuration, then **Triggers** > **Custom Domains** and **Add Custom Domain**. Type the subdomain `mta-sts.example.com`.

Expand Down