Mail undeliverable giving “Diagnostic-Code: smtp; 553 Relaying disallowed” error

I am running ubuntu 16.04 on an AWS EC2 instance. I’ve setup LAMP and configured apache to run multiple domains on the server. I plan to run a small number of low traffic websites on the same box.

I’ve changed name servers for one domain to point to the route 53 setup that I’ve configured. I’ve setup email with a provider zoho. I’m trying to route email through this provider.

An elastic ip address has been assigned to the EC2 instance and I’ve created records inside my hosted zone like so:

domain.co.uk.   A   {elastic-ip-address}    

domain.co.uk.   MX  10 mx.zoho.com 20 mx2.zoho.eu
domain.co.uk. NS    
ns-xxx.awsdns-xx.com. 
ns-xxx.awsdns-xx.co.uk. 
ns-xxx.awsdns-xx.net. 
ns-xxxx.awsdns-xx.org.

domain.co.uk. SOA   ns-xxx.awsdns-xx.com. awsdns-hostmaster.amazon.com. x xxxx xxx xxxxxxx xxxxx

www.domain.co.uk. A {elastic-ip-address}

{unique-zoho-code}.domain.co.uk. CNAME zmverify.zoho.eu

To my knowledge I’ve followed all instructions laid out by Zoho, this is reflected in the records above. Although I’ve not correctly set the spf and dkim records, I don’t think this is the cause of the issue I’m facing since the advice mentioned that these records would help improve deliverability, rather than enable it all together. I’m no expert on this though.

Apache seems to be configured correctly as after changing my hosts file I can see each website running.

When I try to email the address setup with zoho such as user@domain.co.uk, the email is returned un-delivered with the following error:

Final-Recipient: rfc822; user@domain.co.uk
Action: failed
Status: 5.0.0
Remote-MTA: dns; mx.zoho.com. ({ip-address-B}, the server for the domain domain.co.uk.)
Diagnostic-Code: smtp; 553 Relaying disallowed

Zoho have sent me an automated email stating that the current MX records are as follows:

Priority MX Records IP Address
20 mx2.zoho.eu. {ip-address-A}
10 mx.zoho.com. {ip-address-B}

I don’t recognise either of the ip addresses mentioned although the second is the same as the ip address mentioned in the undeliverable message.

Is it possible to configure records in this way even though I’m running multiple domains on through the one version of apache?

How can I correct my setup to enable receiving email?

Answer

Support finally came back to me, the issue was that the service was setup for the EU, but the support docs led me to configure one of the MX records as a US record i.e: mx.zoho.com should have been mx.zoho.eu

Attribution
Source : Link , Question Author : goose , Answer Author : goose

Leave a Comment