Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 916
man19688 Avatar asked Jun 26 '13 22:06

man19688


People also ask

What does it mean when email says Relay Access Denied?

This means that you are trying to send the mail from an outgoing mail server (SMTP) other than the one that is associated to your mailbox, and that the outgoing mail server does not allow such an action.

How do I fix relay access denied in Gmail?

Solution for Relay Access Denied error on the user side. First of all, you should ask your email service provider for assistance and verify your email settings with them. You will need to check that you have proper credentials, such as Mail server, Username, and Password.

What does 550 5.7 relaying denied mean?

It's likely that the server isn't set up correctly to receive and relay messages sent from <Microsoft _365_domain>..." This issue can occur if connectors have been enabled in the Microsoft 365 domain's Exchange Online, 'mail flow' settings and those connectors are either no longer active or are faulty.


2 Answers

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/

like image 52
Jeffery Land Avatar answered Sep 28 '22 17:09

Jeffery Land


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.

like image 21
Thomas Stettler Avatar answered Sep 28 '22 17:09

Thomas Stettler