Relay access denied on sending mail, Other domain outside of network
Asked Answered
R

4

21

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?

Rapallo answered 26/6, 2013 at 22:44 Comment(0)
I
15

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/

Iodize answered 27/6, 2013 at 21:1 Comment(0)
D
4

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.

Duckboard answered 2/12, 2017 at 23:26 Comment(0)
F
0

I'm using THUNDERBIRD as a 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.

Fairground answered 25/7, 2017 at 9:25 Comment(0)
N
-3

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

$mail->SMTPAuth = true;
Nonfiction answered 10/2, 2016 at 6:18 Comment(1)
Although that answer isn't sufficient its still incorrect it should be $mail->SMTPAUTH = true;Maryannamaryanne

© 2022 - 2024 — McMap. All rights reserved.