We're experiencing difficulty. Our engineers are on it. Please check status.mailgun.com for real-time updates.

Routes

Article Preview

    Overview

    You can think of our Routes feature as a sophisticated filtering and forwarding mechanism. With Routes, you have a good deal of capabilities at your disposal, such as:

    1. Forward incoming emails to another environment for storage (such as another email address or maybe an endpoint on your server)
    2. Store a message temporarily (for up to 3 days) and retrieve it using our Messages API
    3. Stop a message from being processed (this drops certain messages instead of forwarding or storing them)

     

    What are the features and settings of a route?

    The first thing you will see is the Expression Type dropdown menu.  This consists of the following expressions:

    • Catch All - Gives you a way to catch the incoming messages for which you've not made a specific Route
    • Match Recipient - This will filter any incoming messages that match a specific email address, such as info@mail.example.com (where mail.example.com is the domain verified on your account)
    • Match Headers - Similar to Match Recipient, this will filter incoming messages based on a header in the message, such as any message with the word "support" in the subject line
    • Custom - Custom routes are a little more advanced; this is where you can combine a multitude of filters to really get specific. If you want to learn more, check out the docs we have on our Routes here

    Next, you will need to choose among a set of Actions.  We mentioned these at the beginning of the article, but we'll repeat them here for convenience:

    1. Forward forwards incoming emails to another environment for storage (such as another email address or maybe an endpoint on your server).
    2. Store and notify stores a message temporarily (for up to 3 days) where you can retrieve it using our Messages API. It also allows you to pass an endpoint or leave it empty, in which case we provide the storage URL for you to retrieve the message later via the Messages API.
    3. Stop stops a message from being processed (again, this drops certain messages instead of forwarding or storing them).

    And finally, the last two fields are Priority and Description. In the Priority field, you can specify a priority level to determine the sequence in which the Route gets handled. Here, the lower the number, the higher the priority. The lowest number would then be handled first; like a ranking of importance. In the Description field, you can specify a description to either name or identify the Route. For instance, "Forward from subdomain1 to Alice at Example.com." This is just for your reference, to help you quickly identify just which route you're looking for.

     

    Adding a route

    You can set up a Route in one of two ways:

    1. Via the Mailgun control panel
    2. Via the API

    For brevity's sake, we'll just cover how to set up a Route via the Control Panel in this article.

    We'll show you how to do this below:

    1. First, log in to the Mailgun Control Panel (if you have not already done so).
    2. Then, within the left-hand navigation pane, click the Receiving option.
    3. Next, toggle the Region switch to the desired region for which you wish to create a route. It is found towards the upper-right portion of the page.
      Screen Shot 2022-09-11 at 7.20.12 PM.png
    4. Click the Create route button (also found towards the upper-right portion of the page).
    5. Enter the information for the Expression Type, Actions, Priority, and Description field.
    6. Click on the Create Route button to save the route.

     

    Need Support?

    Our Support Team here at Sinch Mailgun is happy to help! Reach out to us in the Support section of your Mailgun Control Panel, and we'll be with you shortly!