Skip to content

Mailgun

Mailgun’s API transport carries the raw message, so mail relayed through Mailway reaches Mailgun byte-for-byte on either transport. Its webhooks report what happened after the handoff — confirmed deliveries, permanent and temporary failures, and spam complaints — which powers the delivered state, webhooks like mail.delivered and mail.bounced, and automatic suppressions.

  • A Mailgun account with your sender domain added and verified — see Deliverability for what each record proves.
  • For the API transport: an API key, the Mailgun domain you send from, and the region your account lives in (US or EU).
  • For the SMTP transport: the domain’s SMTP credentials (a login and password from the domain’s SMTP settings).
  1. Add the provider.

    In the console, open Providers → New provider and pick Mailgun:

    • API: paste the API key, the Mailgun domain, and the region. Mailway posts the message as raw MIME, so Mailgun receives relayed mail byte-for-byte, with the same automatic exceptions as over SMTP.
    • SMTP: pick the region (smtp.mailgun.org or smtp.eu.mailgun.org) and paste the SMTP login and password.

    Secrets are encrypted at rest.

  2. Attach it to a project.

    Open the project, attach the provider, and position it in the failover order. Send something — the provider health panel starts filling in.

Without delivery events, Mailgun only reports that it accepted the mail. With them, Mailgun tells Mailway what happened afterwards.

  1. Open delivery tracking. In the console, open the provider → Delivery tracking (beside Configure). Mailway creates the provider’s webhook URL and shows it ready to copy. The URL contains a per-provider secret — treat it like a password (regenerating it at the bottom of the dialog revokes the old one instantly).

  2. Add the webhooks in Mailgun. In Mailgun’s webhook settings for the domain, add the URL you copied for Delivered, Permanent failure, Temporary failure, and Spam complaint. Opens, clicks, and unsubscribes can stay off — Mailway never tracks engagement (your mail stays byte-identical), so those events are ignored.

  3. Store the signing key (required). Copy Mailgun’s HTTP webhook signing key (in its API security settings) and paste it into the dialog’s Paste the signing secret step (Mailgun webhook signing key). Mailway accepts only events that carry Mailgun’s valid signature with a timestamp within five minutes: until the key is stored, every event sent to the URL is refused.

Mailgun event Mailway outcome
Delivered The mail turns delivered (confirmed by the provider’s event).
Permanent failure The mail turns bounced; the address is auto-suppressed for the project.
Temporary failure Recorded as soft_bounced (temporary; a later delivery outranks it). Mailgun is still retrying.
Failure from Mailgun’s own suppression list Recorded as dropped: Mailgun refused to send to an address it already suppresses. The mail keeps its state.
Rejected Recorded as dropped: Mailgun refused the message before sending. The mail keeps its state.
Spam complaint The mail turns complained; the address is auto-suppressed.
  • Connection check. For each transport the account has, the provider page’s connection check logs in over SMTP or reads your Mailgun domain over the API, without sending anything.
  • Delivery events. Use the test button next to the webhook in Mailgun: the sample event is acknowledged, and the Delivery tracking dialog’s last step ticks when it arrives. After a real send, the mail’s timeline shows the delivered or bounced step with Mailgun’s own response details attached.

Not tested yet. What Mailgun changes before delivery will appear in What providers change once it is.

Your Mailgun plan’s own sending limits apply. Mailway adds none for Mailgun beyond your Mailway plan’s quotas.