Skip to content

Migrate from MailGrid

This guide compares the two integrations and proposes a migration path with no interruption. The information about MailGrid comes from that service's own public documentation. Check their current documentation before migrating.

Which path to take

How you send today Path Effort
SMTP Change host, port, username and password Configuration only
HTTP API /sendmail/ Adapt the call to the FrontEngine API A small code change, in one place

FrontEngine does not accept the request format of the MailGrid API. If you use their API and do not want to change code now, you can migrate over SMTP first and adopt the API later.

Mapping of concepts

Sending with SMTP

MailGrid FrontEngine
Ports 587, 465 and 25 587 (STARTTLS) and 465 (implicit TLS)
Authentication AUTH LOGIN or AUTH PLAIN AUTH PLAIN or AUTH LOGIN
TLS 1.2 and 1.3 Required, 1.2 or later
Host the SMTP host of your MailGrid account smtp-out.frontengine.net
Credential SMTP username and password a username of your choice and the server key as the password

If your application uses port 25 to send, change it to 587.

Sending with the API

MailGrid FrontEngine
Endpoint POST /sendmail/ POST https://api.frontengine.net/api/v1/send/message
Credential SMTP username and password inside the JSON body server key in the X-Server-API-Key header
Transport HTTPS. Their documentation also accepts HTTP always use https://
Attachments Base64 Base64, in attachments[] with name, content_type and data
Per-recipient variables available none. Build each recipient's message in your application and make one request per recipient
Unsubscribe header listUnsubscribe field no dedicated field. A header can be sent in headers
Result HTTP 200 with an internal code in the body, including on errors HTTP 200 with the status field (success, error, parameter-error) and, on errors, data.code
Identifier according to their answer data.messages[<recipient>].id and token, one pair per recipient

A point to watch when adapting the code: in both APIs, an HTTP 200 does not mean success. Keep checking the answer body, now in the status field.

Request in FrontEngine:

curl -sS https://api.frontengine.net/api/v1/send/message \
  -H "X-Server-API-Key: $FRONTENGINE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "My Store <[email protected]>",
    "to": ["[email protected]"],
    "subject": "Your order is confirmed",
    "plain_body": "We received your order 1234.",
    "html_body": "<p>We received your order <strong>1234</strong>.</p>"
  }'

When migrating, take the SMTP username and password out of the request body and send the key in the header only. Examples in eight languages are in Examples by language.

Webhooks

MailGrid publishes three events. FrontEngine publishes ten.

Event in MailGrid Event in FrontEngine Note
Delivered MessageSent The destination server accepted the message
Soft bounce MessageDelayed Temporary failure. There will be a retry
Hard bounce MessageDeliveryFailed Permanent delivery failure
MessageBounced The destination accepted and returned a failure notice later
MessageHeld The copy was held, for example by suppression
MessageLoaded, MessageLinkClicked Open and click, with tracking enabled
SendLimitApproaching, SendLimitExceeded The server's send limit
DomainDNSError A DNS record of the domain stopped being correct

Differences in how you receive them:

MailGrid FrontEngine
Request authentication Bearer token per webhook RSA signature in the X-Postal-Signature-256 and X-Postal-Signature headers, with the public key at https://api.frontengine.net/.well-known/jwks.json
Origin published list of source IP addresses verify the signature. Do not depend on an IP list
Retries according to their documentation 6 attempts in total
Format theirs {event, timestamp, uuid, payload}

Your receiver needs new handling: the event names and the body format differ, and verification moves from a token to a signature. See Webhooks and Security.

Features with no direct equivalent

In MailGrid In FrontEngine
Reports and CSV export in the panel There is no customer panel. Events arrive by webhook, and you keep the history in your system
Email validator and message analyzer None
API endpoints for domains and SMTP users None. Domains and credentials are configured by our team

FrontEngine features that MailGrid's documentation does not list: open and click tracking, automatic suppression list and inbound email to HTTP endpoints.

DNS changes

The two services can coexist on the same domain during the migration, because each uses records of its own.

Record What to do
Verification TXT Add the FrontEngine record
DKIM Add the FrontEngine key. Keys from different services coexist on the same domain when the selectors differ
SPF Keep a single SPF record and add the FrontEngine include next to the mechanism that authorizes MailGrid
Return path Add the CNAME frp.yourdomain.com pointing at rp.frontengine.net
DMARC No change. If it does not exist yet, publish it

The exact values are given by our team at activation and are described in Set up a sending domain.

One SPF record per name

Two v=spf1 records on the same name invalidate SPF. Edit the existing record instead of creating another. Also mind SPF's limit of ten DNS lookups when adding up the two services.

After the cutover, remove MailGrid's authorization from SPF and take its DKIM key out.

Running both in parallel

  1. Activate FrontEngine and publish the DNS records. Wait for the domain to be verified.
  2. Send test messages to mailboxes of your own at Gmail, Outlook.com and Yahoo. Check, in the received headers, that SPF, DKIM and DMARC passed.
  3. Set up the webhook in FrontEngine pointing at the new receiver and validate the signature.
  4. Move a low-risk flow first, such as an internal notification. Leave critical flows on MailGrid.
  5. Raise the share gradually, by message type or by percentage, over days. The domain has a reputation, but the sending IP addresses change.
  6. Follow the failure and deferral events at each stage.

To split traffic, make the provider a setting of your application (an environment variable or an option per message type). Going back to the previous provider is then a configuration change.

Suppressions do not migrate by themselves

The FrontEngine suppression list starts empty. Before migrating, remove from your records the addresses you know are invalid, so you do not repeat failures on the new service.

Cutover checklist

Before:

  • Server created and key stored in a secret manager.
  • Domain verified, DKIM published, SPF authorizing both services, return path published.
  • DMARC published.
  • New webhook receiver in production, with signature verification.
  • Handling of MessageDeliveryFailed, MessageBounced and MessageHeld in the application.
  • Check of the status field in the code that calls the API.
  • Tests delivered at the main providers.

During:

  • Every flow pointing at FrontEngine.
  • MailGrid credentials kept active for a few days, in case you need to go back.
  • Failure events watched closely.

After:

  • MailGrid's authorization removed from SPF.
  • MailGrid's DKIM key removed from DNS.
  • Old webhook disabled and old receiver shut down.
  • MailGrid credentials removed from the application and from the secret manager.

Next steps