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

Troubleshooting messages marked as "Accepted" but not as "Delivered"

Article Preview

    Overview

    Most of the reasons your Mailgun logs may show a message with an Accepted event but no related Delivered event is due to an underlying DNS issue, particularly with the MX record(s) of the "To:" recipient. 

    Also, if the message is scheduled for delivery at a future date, only an Accepted event will appear in the Mailgun logs until the time of delivery is reached.

     

    Understanding the context

     

    Setting the scene

    Mailgun documents the lifecycle of messages by using Events.  A message with an Accepted event indicates Mailgun has successfully received your message and has enqueued it for processing.  Meanwhile, a Delivered event indicates Mailgun has successfully delivered your message to the recipient's email server. For a reference to all event types, please see our Events API documentation.

    Therefore, if you see within the Mailgun logs that a message has an Accepted event but not a Delivered event, this indicates the message is in some sense "in process" and has yet to attempt delivery.  

     

    Discerning the nuance

    Other than having submitted the message to Mailgun within the past few seconds, the reasons a message can have an Accepted event with no associated Delivered event include the following:

    • The "To:" recipient (at least temporarily) has no published MX records at the time of the delivery attempt.
    • The "To:" recipient has more than one MX host/provider specified in their DNS records.
    • The message is scheduled for a future delivery date either through the use of the delivery-time parameter/header or STO/TZO
    • Very rarely, there could be a slight delay in email delivery. If this is the case with our system, we will update the Mailgun Status Page with the pertinent information.

     

    Implementing the solution

     

    Concerning "To:" recipients with no MX records

    To check a recipient's domain to see whether any MX records 
    currently exist, you can use a third-party DNS tool
    such as MX Toolbox

    For this scenario, after performing an MX lookup on the "To:" recipient's domain, you will notice that there are no MX records present.  Without MX records, email servers will not know where to send emails for a given domain. 

    With regards to Mailgun, a lack of MX records for a recipient domain will result in an Accepted event with no paired Delivered event because we cannot determine where to send the message.  

    Once the recipient adds MX records to their domain, or any temporary issues resolve with reference to their domain's DNS propagation or DNS host, you may resend the message to the recipient.

     

    Concerning "To:" recipients with more than one MX host/provider

    To check a recipient's domain to see what MX records 
    currently exist, you can use a third-party DNS tool
    such as MX Toolbox

    For this scenario, after performing an MX lookup on the "To:" recipient's domain, you will notice that there are two or more "sets" of MX records present.  Each "set" (even if composed of only one MX record) represents a different email host/mailbox provider.  Mailgun recommends only having one email provider and its associated MX records(s) configured on a domain as more than one can lead to split delivery (i.e. unpredictable delivery to a random "set" of MX records) or no delivery attempted at all.

    With regards to Mailgun, the presence of more than one MX host/provider typically results in no delivery being attempted.  The presence of more than one "set" of MX records will result in an Accepted event with no paired Delivered event because we cannot determine where to send the message.  

    Once the recipient chooses one email host/mailbox provider to keep for their domain, the other set(s) of records should be removed.  You will need to resend the message to the recipient.

    As a further note, we sometimes see customers add Mailgun's MX records to their root domain, which already has at least one MX record present pointing to their mailbox provider.  

    dig -t MX recipientdomain.com +short
    10 mxa.mailgun.org.
    10 mxb.mailgun.org.
    0 recipientdomain.com.

    The solution is often to remove the two Mailgun MX records.  If you need to receive emails at Mailgun, we recommend using a subdomain that only has Mailgun's two MX records configured.  In the above example, removing the two Mailgun MX records informs all email servers to send 100% of email intended for recipientdomain.com to the email host/mailbox provider for recipientdomain.com.

     

    Concerning messages scheduled for a future delivery date

    For this scenario, a message is scheduled for a future delivery date (up to 7 days into the future, depending on the account's plan). 

    With regards to Mailgun, a message scheduled for a future date will result in an Accepted event with no paired Delivered event. The Delivered event will only be generated when the scheduled date/time comes to pass and the message is delivered.

    There are two methods of checking the Accepted event to determine if the message is scheduled for a future date. We'll show you how to do this below:

    Method 1: Check the event metadata for the scheduled-for field.

      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 Send product and then click the Sending option to expand its list of suboptions.
      3. Next, click the Logs suboption.
      4. On the resulting page, there will be a list of events. Each will have a down-arrow icon towards the right-hand side. Click the down-arrow icon Screen_Shot_2019-12-27_at_2.54.25_PM.pngfor the event in question.
      5. The metadata will have various groupings of data in JSON format. The "message" group of data will have a scheduled-for field if the message was scheduled.
      6. If present, the field will be formatted in Unix time, which you can translate with a Unix time/Epoch time conversion tool such as this.  E.g. "scheduled-for": 1318633810.

    Method 2: Check the MIME for the X-Mailgun-Deliver-By header. 

      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 Send product and then click the Sending option to expand its list of suboptions.
      3. Next, click the Logs suboption.
      4. On the resulting page, there will be a list of events. Each will have a gear icon towards the right-hand side. Click the gear icon for the event in question.
      5. Click the MIME option.
      6. The MIME will contain an X-Mailgun-Deliver-By header if the message was submitted for a future date. E.g. X-Mailgun-Deliver-By: Wed, 30 Jun 2099 18:30:00 -0000.

    Once the recipient adds MX records to their domain, or any temporary issues resolve with reference to their domain's DNS propagation or DNS host, you may resend the message to the recipient.

     

    Concerning a possible, though rare, delay in email delivery

    For this scenario, should your sending be affected by a delay within Mailgun's system, an incident along with the most current details will be posted to our status page

    In such cases, our teams will be working towards delivering the messages as soon as possible. Once the incident is cleared from the status page, you can expect normal delivery times to have resumed.

     

    Need Support?

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