All is going well with your regular sending when an odd message appears:
What does this mean, exactly?
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 outgoing emails
- Coming from Mailgun for incoming emails
- Coming from the external recipient host for outgoing emails.
So - a key element of resolving this error is finding just which instance you're experiencing.
Response from Mailgun (Outgoing)
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:
- First, log in to the Mailgun Control Panel (if you have not already done so)
- Then, within the left-hand navigation pane, click the Sending option to expand its list of suboptions.
- Next, click the Domains suboption and select the impacted domain.
- Once you have selected the impacted domain, click the Domain settings suboption.
- Click the SMTP credentials tab.
Note: All outgoing emails are required to be authenticated via SMTP or the API.
Response from Mailgun (Incoming)
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 from Recipient 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 the recipient's email address is correct.
Sinch Mailgun has answers! If you have any concerns or questions, please send us a Support ticket using the Support page within your Mailgun Control Panel. Our Support Team will be happy to assist!