XF 1.3 Relaying Disallowed on Contact Emails

Adrian Schneider

Active member
When users attempt to use the contact form, the mail fails to send, with the error (real email substituted)
Zend_Mail_Protocol_Exception: Email to x@y.com failed: Relaying disallowed - library/Zend/Mail/Protocol/Abstract.php:431

I'm using Zoho for my mail, and the mail is properly configured using SMTP. Mail sends properly for standard emails (ex, activation mail). Upon a few hours of troubleshooting, I assume this is because the From header is not matching the domain.

I've set up SPF records, as well as the domain key so Zoho is properly configured to send mail (and it is - when it's from the correct address). The server I'm on is not running a mail server, nor would I like it to be, so I'm looking for some assistance on either fixing this at the configuration level, or relying on a correct From header, and an added Reply-To header.

For the development I have done in the past using Zend_Mail, I ran into similar problems on other mail hosts. Either spam filters would pick it up, or other hard to debug errors would occur. This led me to use a real From account, and reply-to the dynamic address instead.

Any help would be appreciated.

Thanks
 
Upon a few hours of troubleshooting, I assume this is because the From header is not matching the domain.
This is most likely correct. We actually follow the standard recommendation here which is to use the "Sender" header (which indicates the address initiating the email, while from indicates where the content came from). The SMTP server should really be validating on the Sender header if present and then falling back to the From header.

The code in ControllerPublic_Misc could be tweaked to change the from and set a Reply-To if necessary.
 
Top Bottom