# Use your own domain with an AI agent

> How to connect hello@yourcompany.com to Command Mail: forwarding at your mail provider, optional domain proof with a TXT record and a separate sending route.

Updated: 2026-10-28 · Fact-checked: 2026-10-28 · Canonical: https://commandmail.app/en/guides/connect-your-own-domain · Deutsch: https://commandmail.app/de/anleitungen/eigene-domain-verbinden.md

You connect an address on your own domain, say hello@yourcompany.com, to Command Mail by forwarding it at your mail provider. Your MX records stay as they are. You can also prove that you own the domain with a DNS TXT record, and you set up a separate sending route for each address you want to send from.

Command Mail is our product. This guide keeps three things apart because they are often mixed up: receiving, domain proof and sending. If you only connect Gmail or Outlook, the shorter guide is [Collect all your email addresses in one inbox](https://commandmail.app/en/guides/all-addresses-one-inbox).

## Setup in four steps

1. Add the address under Settings → Connect mailbox and note its private intake address.
2. Set up forwarding to that intake address at your mail provider.
3. Optionally prove domain ownership: `commandmail domains claim yourcompany.com`, add the TXT record, `commandmail domains verify yourcompany.com`.
4. From Pro, set up a sending route per address where needed under Settings → Connections, SMTP or relay.

## What you need

You need access to your mail provider's forwarding settings and, for the domain proof, to your domain's DNS. Forwarding and DNS can sit with different providers, for example forwarding at Google Workspace or Microsoft 365 and DNS where the domain is registered.

- A Command Mail account. Free is enough to receive, read, sort and draft in one mailbox. Sending and up to ten mailboxes come with Pro, which the plan overview lists at €19 a month for the first 100 paying Pro accounts for as long as their subscription runs, and €29 for all others.[^2]
- An address on your domain that already receives email, either an existing mailbox or a forwarding alias at your provider.
- Optionally, an agent that reaches Command Mail over MCP and holds the `mailboxes` permission. It can then do the steps inside Command Mail for you.[^1]

## How email from your domain arrives

Command Mail receives your domain's email only by forwarding. Each connected address gets its own private intake address. Your provider sends the forwarded messages there, and Command Mail uses that intake address to put the message in the right mailbox.[^1]

In practice this means you change no MX records and keep your provider. If your provider keeps a copy in your existing mailbox, that copy stays available there regardless of Command Mail. It also means that archiving, deleting or replying in Command Mail is not written back to the original mailbox.[^1]

We traced in the app code (commit `9cab1eb`) that routing depends on that private intake address alone. An address someone types into a form does not decide whose inbox a message reaches.

## Step 1: Connect the address in Command Mail

Add the address in Command Mail: under Settings with Connect mailbox, with the CLI, or through your agent. Command Mail then shows the private intake address your provider should forward to.[^1]

With an agent, one sentence is enough: "Set up hello@yourcompany.com in Command Mail." According to the documentation, it connects the address, claims the domain if needed, gives you the TXT record, verifies it and tells you where to forward.[^1] Connecting the same address twice leaves everything as it was, so an agent can safely repeat the step.

## Step 2: Turn on forwarding at your provider

You set up forwarding wherever your domain's email arrives today. The menus differ, the idea is the same everywhere: the target is the private intake address from step 1, and you decide whether a copy stays in the old mailbox.

**Google Workspace, or Gmail on your own domain.** In Gmail settings under Forwarding, add the intake address. Google sends a confirmation link to it, which you open in Command Mail. Then you go back to the forwarding settings in Gmail, choose "Forward a copy of incoming mail to", decide what happens to Gmail's copy and save. From then on Gmail forwards all new messages except spam; to forward only some messages, turn off forwarding of all mail and set up a filter that forwards instead.[^3]

**Microsoft 365.** A policy often blocks forwarding to outside addresses. The outbound spam filter policy controls automatic external forwarding, and its default now behaves like Off in newer tenants. When it is off, the sender gets a bounce with the code 5.7.520.[^4] An admin has to allow forwarding for that mailbox, for example with a dedicated policy.

**Other mail providers and web hosts.** Look in your provider's help for forwarding a single address. Keep a copy in the old mailbox while you test.

**A domain without a mailbox.** If you only have a domain and no mailbox yet, a forwarding-only service such as Cloudflare Email Routing can accept the email. The domain has to use Cloudflare DNS, and Cloudflare sets its own MX records. You confirm the private intake address as a destination through a link Cloudflare sends there, then create a routing rule from your domain address to that destination.[^6][^7]

## Step 3: Prove domain ownership with a TXT record

Domain proof is optional and shows that the domain belongs to your account. After that, no other Command Mail account can connect addresses on that domain.

It has two parts. First you claim the domain, and Command Mail gives you a TXT record. You add it at your DNS provider. Then you verify, and Command Mail checks the record:[^1]

```
commandmail domains claim yourcompany.com
# add the TXT record at your DNS provider
commandmail domains verify yourcompany.com
```

In the app code the record is named `_commandmail.yourcompany.com`, and its value starts with `commandmail-verify=` followed by a random value for your account. The same account gets the same value when it claims again. The check queries DNS through Cloudflare's public resolver; if the record is not visible yet, you get `not_verified`. Each account can run 30 checks in ten minutes; further attempts get `rate_limited`.

You start the proof with the CLI, with the MCP tools `claim_domain` and `verify_domain`, or through the API; we found no button for it in Settings. If another account has already verified the domain, Command Mail refuses with `domain_owned`.

## Step 4: Set up sending as your address

Domain proof does not turn on sending for your domain. According to the code, Command Mail sends directly for a verified domain only if the operator has also listed exactly that domain in its sending configuration. Otherwise you need SMTP or the relay. So from Pro you set up sending per address in Settings under Connections, and only a person in the app can do it: the route for sending setups refuses agent tokens with `session_only`.

**SMTP through your mail provider.** You enter your provider's outgoing server, port 465 or 587, user name and an app password. Command Mail stores the password encrypted. Recipients see your real address, and the message leaves through the server that already sends for your domain.

**Relay through Command Mail.** No credentials needed: Command Mail sends a code to your address, and once you confirm it you send from a Command Mail address with your address label or account name. Replies go to your address through Reply-To. Recipients therefore do not see your domain as the sender.

With Microsoft 365, SMTP depends on the SMTP AUTH setting. If security defaults are on in the tenant, SMTP AUTH is off, and allowing it on a single mailbox is not enough. Without security defaults, an admin can allow SMTP AUTH per mailbox, as long as no authentication policy blocks basic authentication for SMTP.[^5] If the configuration does not allow SMTP, use the relay.

## Check that it works

Send a test message from an outside address to hello@yourcompany.com. It should show up in your Command Mail inbox shortly after. If it does not, check the forwarding at your provider and its spam folder first.

For sending, reply to the test address and look at the sender there. With SMTP the sender is your address. With the relay it is the Command Mail address with your address label or account name, and your address is in Reply-To.

## Common errors

**`not_verified` during domain proof.** The TXT record is not visible yet. Check that the name is exactly `_commandmail` in front of your domain. Some DNS panels append the domain on their own, so the name field only takes `_commandmail`. DNS often needs a few minutes.

**`domain_owned`.** Another Command Mail account has verified the domain. Find out who owns it; you cannot connect an address on that domain in a second account.

**A bounce with 5.7.520.** Microsoft 365 is blocking external forwarding. The admin checks the outbound spam filter policy and any extra blocks through remote domain settings or mail flow rules.[^4]

**Messages arrive twice.** One possible cause is two active forwards at once, for example a mailbox rule and a forward at the host. Keep one.

## When an agent inbox fits better

If an agent should have its own addresses on your domain, with no person keeping a mailbox there, inboxes built for agents are the better fit. AgentMail includes custom domains from its Developer plan at $20 a month with ten domains, and Startup at $200 with 150; each extra domain is $2 a month.[^8] You add the provider's DNS records, and both sending and receiving run through it.

Command Mail takes the other route: your existing addresses stay with your provider, and your agent works in a copy, with permissions per connection and an autonomy level per mailbox. The two models are compared in [Email for AI agents](https://commandmail.app/en/compare/email-for-ai-agents).

## Next steps

Start with one address, keep a copy in the old mailbox, and set up sending only after receiving has run cleanly for a week. What an agent may do after that is in [Permissions and autonomy](https://commandmail.app/en/docs/permissions-and-autonomy).

[Start Command Mail for free](https://commandmail.app/login?signup=1), set up the first address on your own domain and connect your agent.

## Sources and date

As of 2026-10-28. Vendor pages and Command Mail's public pages were retrieved that day. Statements about the intake address, domain proof, the check limit and the sending routes also rest on the app code in commit `9cab1eb` (`intake.ts`, `domains.ts`, `send-routes.ts`, `outbox.ts` and the sending-route endpoint). This guide does not claim a test run with a real domain of our own.

## Frequently asked questions

### Do I have to change my MX records?

No. Your email keeps arriving at your current provider, which forwards it to Command Mail's private intake address. You only change MX records if you put a forwarding-only service such as Cloudflare Email Routing in front.

### Do I need the TXT record to receive email?

No. Receiving works as soon as the address is connected and your provider forwards. The TXT record proves that the domain is yours. After that, no other account can connect addresses on that domain.

### Can I send as hello@yourcompany.com once the domain is verified?

Verification alone does not turn on sending. From Pro you usually set up sending per address: through SMTP at your mail provider, so recipients see your address, or through the Command Mail relay, where a Command Mail address is the sender and your address is in Reply-To.

### Can my agent do the setup?

Yes, with the mailboxes permission. It connects the address, claims the domain, gives you the TXT record and checks it. You set the DNS record and the forwarding at your provider yourself, and only a person in the app can set up a sending route.

### What happens to my existing mailbox?

Nothing changes there. Forwarding is not sync: what you archive or delete in Command Mail stays unchanged in the original mailbox. Whether a copy stays there is a setting at your provider.

## Sources

1. [Command Mail: documentation, sections Your own domain and Let your agent set it up](https://commandmail.app/en/docs), accessed 2026-10-28
2. [Command Mail: plans and agent permissions](https://commandmail.app/llms.txt), accessed 2026-10-28
3. [Gmail Help: Automatically forward Gmail messages to another account](https://support.google.com/mail/answer/10957?hl=en), accessed 2026-10-28
4. [Microsoft Learn: Control automatic external email forwarding in Microsoft 365](https://learn.microsoft.com/en-us/defender-office-365/outbound-spam-policies-external-email-forwarding), accessed 2026-10-28
5. [Microsoft Learn: Enable or disable SMTP AUTH in Exchange Online](https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission), accessed 2026-10-28
6. [Cloudflare: Enable Email Routing](https://developers.cloudflare.com/email-routing/get-started/enable-email-routing/), accessed 2026-10-28
7. [Cloudflare: Email routing rules and destination addresses](https://developers.cloudflare.com/email-routing/setup/email-routing-addresses/), accessed 2026-10-28
8. [AgentMail: pricing and custom domains](https://www.agentmail.to/pricing), accessed 2026-10-28

[^1]: [Command Mail: documentation, sections Your own domain and Let your agent set it up](https://commandmail.app/en/docs), accessed 2026-10-28
[^2]: [Command Mail: plans and agent permissions](https://commandmail.app/llms.txt), accessed 2026-10-28
[^3]: [Gmail Help: Automatically forward Gmail messages to another account](https://support.google.com/mail/answer/10957?hl=en), accessed 2026-10-28
[^4]: [Microsoft Learn: Control automatic external email forwarding in Microsoft 365](https://learn.microsoft.com/en-us/defender-office-365/outbound-spam-policies-external-email-forwarding), accessed 2026-10-28
[^5]: [Microsoft Learn: Enable or disable SMTP AUTH in Exchange Online](https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission), accessed 2026-10-28
[^6]: [Cloudflare: Enable Email Routing](https://developers.cloudflare.com/email-routing/get-started/enable-email-routing/), accessed 2026-10-28
[^7]: [Cloudflare: Email routing rules and destination addresses](https://developers.cloudflare.com/email-routing/setup/email-routing-addresses/), accessed 2026-10-28
[^8]: [AgentMail: pricing and custom domains](https://www.agentmail.to/pricing), accessed 2026-10-28

---

Command Mail: one inbox for you and your AI agent. Start free: https://commandmail.app/login?signup=1 · Connect your agent: https://commandmail.app/en/agents · MCP: https://commandmail.app/mcp
