[smtp] Relay access denied on sending mail, Other domain outside of network

Sending mail results in error "Relay access denied".

It throws "Relay access denied", whenever I tried to send mail to "other_domain" from "outside_network". It works just fine for "myown_domain" from "outside/inside_network" and to "other_domain" from "inside_network".

Here is the list of telnet commands.

mail from:[email protected]
- 250 2.1.0 Ok
rcpt to:[email protected]
- 250 2.1.5 Ok
rcpt to:[email protected]
- 554 5.7.1 <[email protected]>: Relay access denied.
rcpt to:[email protected]
- 554 5.7.1 <[email protected]>: Relay access denied.
rcpt to:[email protected]
- 554 5.7.1 <[email protected]>: Relay access denied.

I followed all the steps described in "Microsoft Support" and make sure that server configured in correct way and it do not reject any mail. I also tried to trace through using couple of blogs like this one.

While using MxToolbox also got the same result "Relay access denied".

As "Relay access denied" is very common issue.. there are lot of blogs/documentation are there.. I tried to read all, but I think I am looking in wrong place.

Does anybody have any suggestion?

This question is related to smtp exchange-server sendmail

The answer is


I'm using THUNDERBIRD as MUA and I have same issues. I solved adding the IP address of my home PC on mynetworks parameter on main.cf

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 MyIpAddress

P.S. I don't have a static ip for my home PC so when my ISP change it I ave to adjust every time.


If it is giving you relay access denied when you are trying to send an email from outside your network to a domain that your server is not authoritative for then it means your receive connector does not grant you the permissions for sending/relaying. Most likely what you need to do is to authenticate to the server to be granted the permissions for relaying but that does depend upon the configuration of your receive connector. In Exchange 2007/2010/2013 you would need to enable ExchangeUsers permission group as well as an authentication mechanism such as Basic authentication.

Once you're sure your receive connector is configured make sure your email client is configured for authentication as well for the SMTP server. It depends upon your server setup but normally for Exchange you would configure the username by itself, no need for the domain to appended or prefixed to it.

To test things out with authentication via telnet you can go over my post here for directions: https://jefferyland.wordpress.com/2013/05/28/essential-exchange-troubleshooting-send-email-via-telnet/


Set your SMTP auth to true if using the PHPmailer class:

$mail->SMTPAuth = true;

Configuring $mail->SMTPAuth = true; was the solution for me. The reason why is because without authentication the mail server answers with 'Relay access denied'. Since putting this in my code, all mails work fine.


Examples related to smtp

5.7.57 SMTP - Client was not authenticated to send anonymous mail during MAIL FROM error PHPMailer - SMTP ERROR: Password command failed when send mail from my server php function mail() isn't working Gmail Error :The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required "An attempt was made to access a socket in a way forbidden by its access permissions" while using SMTP Getting error while sending email through Gmail SMTP - "Please log in via your web browser and then try again. 534-5.7.14" SmtpException: Unable to read data from the transport connection: net_io_connectionclosed How to configure SMTP settings in web.config Send mail via CMD console Mail not sending with PHPMailer over SSL using SMTP

Examples related to exchange-server

Relay access denied on sending mail, Other domain outside of network Powershell command to hide user from exchange address lists Send SMTP email using System.Net.Mail via Exchange Online (Office 365) Exchange Powershell - How to invoke Exchange 2010 module from inside script? Reading e-mails from Outlook with Python through MAPI Read MS Exchange email in C#

Examples related to sendmail

Send mail via CMD console Relay access denied on sending mail, Other domain outside of network Using sendmail from bash script for multiple recipients sendmail: how to configure sendmail on ubuntu? VBScript to send email without running Outlook Send SMTP email using System.Net.Mail via Exchange Online (Office 365) Sending a mail from a linux shell script Sending HTML mail using a shell script Debugging PHP Mail() and/or PHPMailer How to send a html email with the bash command "sendmail"?