Custom return path
The return path (also called MAIL FROM or envelope sender) is where bounces are sent. By default SpacePost uses the send subdomain: send.acme.com. It gets an MX record, so bounce notifications reach Amazon SES, and an SPF TXT record.
Using your own subdomain instead of Amazon’s default means SPF is evaluated against your domain, so it aligns with your From address for DMARC.
Change the subdomain
Section titled “Change the subdomain”Set custom_return_path when you add the domain. It must be 1 to 63 characters of lowercase letters, digits and hyphens.
await spacepost.domains.create({ name: "acme.com", customReturnPath: "bounces" });curl -X POST https://api.spacepost.dev/domains \ -H "Authorization: Bearer $SPACEPOST_API_KEY" -H "Content-Type: application/json" \ -d '{ "name": "acme.com", "custom_return_path": "bounces" }'The returned MX and TXT records then use the name bounces instead of send.
Pick a name that is not in use
Section titled “Pick a name that is not in use”The return-path subdomain must not already have other MX or TXT records you rely on (for example, a support tool using send.acme.com). Choose something unique such as bounces or pk-send.