-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Emails not being received #41
Comments
Ouh, interesting. |
Hi Nicolas, I’ve used Google and Zoho mail systems, which used to provide free 25 user accounts using your own domain name and both recommend setting up SPF records. My own ISP, Virgin Media UK, appear to use SPF, but just drops failing email without logs or warning. Fortunately, Zoho.com allows you to quarantine failing emails and examine the delivery failure. I found the “ini_set” necessary on one particular hosting account, to satisfy the provider’s rules. I don’t know how necessary it is generally, but causes no problem on other hosting providers I’ve used. This pre-dates the SPF issue and prevented any sending, but didn’t cause send() to fail. It may passible be set automatically by CPanel these days. To test, you need a receiving mail server correctly configured to use SPF checking. Last I looked, Zoho.com still provided single user accounts using your own domain. You can get a free domain name from freenom.com, for example, to use with this. You also need GS site for this domain, with your contact page. I will do a crude patch and let you know the outcome. |
With the following patch, email was delivered as expected:
The ini_set() described, was not required for this host and adding it made no difference. |
Thanks. Would like to try first a non GS-only or cms-specific way to do it, and that wouldn't require manually setting an address. It has been a while since I looked at those, but for example would something like that pass SPF ? $headers = "From: $encoded_name <no-reply@" . SERVERNAME . ">\n";
if ($email) {
$headers .= "Reply-To: $encoded_name <$email>\n";
$headers .= "Return-Path: $encoded_name <$email>";
} |
For me, that gives the same result. |
Great thanks for the follow-up, I'll implement that soon. |
fix #41 use no-reply@server as from header
Hi Nicolas,
Just trying to upgrade from version 0.9.1 and came back to an old issue.
Your plugin 1.1.4 is working as intended, CPanel Track Delivery even shows the email was delivered to the intended server, and yet it never arrives in my inbox.
The problem, I believe, is that the email is sent with the visitors email address, something which will be rejected by SPF validation these days.
Looking back, I realise I patched 0.9.1 send_mail() to always use GSFROMEMAIL as the sending address (also calling ini_set("sendmail_from", GSFROMEMAIL) required by some hosts, I found). This solved the problem, provided the SPF record includes the hosting server.
I must apologise for not reporting this solution way back on issue #12 .
I haven't quite worked out how to apply this to 1.1.4 properly. I'd likely patch P01contactForm::mailHeaders() as above.
The main side effect, is that "Reply" won't work in your email client, however "Reply-All" usually does, at least in the clients I've tried.
Regards,
Brian
The text was updated successfully, but these errors were encountered: