Skip to content

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.

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" });

The returned MX and TXT records then use the name bounces instead of send.

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.