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

Why did I receive the error "Relaying Denied" (or some variation thereof)?

Article Preview


    All is going well with your normal sending when an odd message appears: 

    "Relaying Denied."

    What exactly does this mean?

    Essentially, it's just what the message indicates; the relaying of this email was not allowed. You could call this the "Do not pass Go, do not collect $200" of email errors.

    While this is usually an authentication issue, there are 3 different common scenarios that provide some context for the bounce. The bounce message can be:

    • Coming from Mailgun for outbound emails
    • Coming from Mailgun for inbound emails
    • Coming from the recipient's email host for outbound emails.

    So, the key to resolving this error is discerning which scenario you're experiencing.


    Response is from Mailgun for outbound emails

    In this scenario, you've attempted to send an email with Mailgun via SMTP, but received the Relaying Denied response during the SMTP session with Mailgun. This indicates the SMTP session was not authenticated

    Specifically, this happens when the RCPT TO command is used for an external email address before the SMTP session was authenticated. 

    The solution to this is to ensure your SMTP application is properly configured to authenticate, using your Mailgun SMTP credentials. We might not be able to provide exact instructions for your SMTP application, but you can find the required SMTP credentials in the domain settings page in your Mailgun control panel. 

    We'll guide you using the steps 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 Sending option to expand its list of suboptions.
    3. Next, click the Domains suboption and select the impacted domain.
    4. Once you have selected the impacted domain, click the Domain settings suboption.
    5. Click the SMTP credentials tab.

    Note: All outgoing emails are required to be authenticated via SMTP or the API.


    Response is from Mailgun for inbound emails

    In this scenario, you or a colleague has tried to send an email to an email address for which you use Mailgun Routes (how we process incoming mail). In other words - the recipient domain's MX records point to Mailgun

    In this context, the sending application will establish an SMTP session to Mailgun's MX server and issue a RCPT TO command for the recipient.  If your Mailgun account does not have a route or is not properly configured to catch this recipient address, Mailgun will return a Relaying  Denied error. 

    You'll need to check the details of your Routes and ensure your domain is properly configured to route the recipient address. We have a help article that will help you set up your Routes and ensure they are configured properly. You can check it out by clicking here.


    Response is from the recipient's email host

    In this scenario, you've successfully submitted an outgoing email to Mailgun. Mailgun then attempts to deliver the email to the recipient host, but it generates a failed event with the Relay Denied message. 

    This bounce message is being returned by the external recipient host and not Mailgun in this scenario. It typically means the email address is invalid. The recommended action is to double-check that the recipient's email address is correct.


    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!