← Knowledge base

Set up inbound email: DNS and your domain

DeskCrew turns incoming email into tickets through a Mailgun-signed webhook. Set this up by adding an inbound subdomain in Mailgun, creating the DNS records, and pointing a Mailgun route at DeskCrew.

Inbound flow: customer email → Mailgun → a DeskCrew ticket.
Inbound flow: customer email → Mailgun → a DeskCrew ticket.

1. Add your inbound subdomain

  1. Pick an inbound subdomain, for example mg.deskcrew.io or mg.yourbrand.com.
  2. Add it as a Mailgun domain.
  3. Create the DNS records Mailgun gives you:
    • The MX records that point mail at Mailgun.
    • The SPF and DKIM (TXT) records that authenticate your sending, so customer notifications land in the inbox and come from your brand.

2. Add a Mailgun route

In Mailgun, add a Route that forwards inbound messages to:

https://deskcrew.io/api/inbound/email

3. Set your environment variables

DeskCrew verifies the Mailgun HMAC signature on every POST and rejects anything unsigned, so set:

  • MAILGUN_SIGNING_KEY
  • INBOUND_EMAIL_DOMAIN — the subdomain you configured.

How threading works

  • New mail to <your-slug>@<your-domain> opens a fresh ticket and creates the customer from the sender.
  • Replies thread back automatically: DeskCrew sets a Reply-To of support+<token>@<your-domain>, and that signed token routes the reply onto the exact ticket and reopens it if it was closed.
Set up inbound email: DNS and your domain · DeskCrew