Sites hosted on SiteGround no longer receive email notifications for contact form submissions. It may also happen with Flywheel and a few other hosts. Most hosts appear to be unaffected.
This was probably introduced by #6657 (version 4.9). Initially tracked in 385-gh-jpop-issues.
When testing the fix, it'll be important to verify it on a variety of hosts.
The email should be received, and there shouldn't be any errors in the log.
The email is not received, and the log shows an error: Could not instantiate mail function.
Hmm, this actually doesn't look like it's a Jetpack bug. It seems like their Exim server is rejecting any message with a display name, even though those are completely valid according to RFC5322.
name-addr and display-name parts)This mu-plugin is a minimal test case:
$result = mail( '"[email protected]" <[email protected]>', 'test from sg - php mail() full addy', 'this should work but doesnt' );
var_dump( $result );
die();
That would be really unusual, though, and I'd be surprised if we were the first ones to encounter it, so maybe something else is going on?
Either way, at the moment things seem to point to something at the server layer, so I'm going to try and reach out to them and see what they say.
Ah, nevermind, it looks like the @ character needs to be escaped in the display-name, since it's a special character in atoms.
Sending to "foo\@jetpack.com" <[email protected]> works.
I'll send a PR for that tomorrow.
Has there been any more forward momentum on this? User reported in 3254177-t, site is hosted on SiteGround.
Not yet, sorry, I've been swamped this week. I won't have any time next week either, but I'm hoping to get this wrapped up the week after that.
If anyone wants to take it over so they can get it done sooner, let me know and I can push the code I already have to a WIP branch.
Hi, been tracking this on another forum. We were just upgraded to WP 4.8 by our hosting provider and we're running jetpack plugin v5. We just started experiencing the same issue. Our hosting provider is Bluehost, they don't see any issues on their end. We installed Email-Log plugin which shows the contact forms being submitted. We also installed WP-Mail-SMTP to see if the issue was with wp_mail() but that sent emails with no problems. Right now all form submissions are getting logged in the Feedback & in the Email-Log but is no one is receiving them. Quite a few people have on other forums have said that they have experienced the same issue.
Any help or updates would be great.
Thank you for all your work and effort into getting this resolved.
Also reported in #3264915-t.
@adrearubin Sorry for the trouble! Can you contact us with more details here? http://jetpack.com/contact-support/
It sounds like there may just be an issue with wp_mail() on your server, so I don't think this is related.
Another reported in 3245022-t (on SiteGround)
Another: 3262015-t (SiteGround)
3282597-t
Also seeing in 3287037-t (SiteGround)
Is there any update to this? If not, we will need to change from Jetpack to a functioning contact form.
@titanzrule32 Our developers are working on a fix. You can follow along at #7367 if you'd like!
We at Flywheel have this same issue, #7350.
@splitinfinities Thanks for the heads up, I'm working to see if we can get this fixed sooner rather than later :)
@iandunn Any progress on this? Just ran across this in another ticket. 619508-zen
@aheckler: I think @dereksmart was going to take it over since I'm doing a Calypso rotation for the next few months.
626795-zen
660563-zen (Bluehost - want to confirm it's related)
Sounds like this may have reappeared in 5.7. Could someone look into it again?
896031-zen
@chaselivingston Can you ask the user to install a plugin like https://wordpress.org/plugins/wp-mail-logging/ or similar so we can inspect the emails getting sent out after the fact and attempt to determine why Siteground may be nerfing them, and bring the data to them directly?
The user replied in 896031-zen with two logs. One of the failed contact form, one of the successful new user email.
Another affected user in 896031-zen
According to Siteground, the issue appears to be that the from address is e.g.[email protected] (including the www. in the email address, resulting in:
SITEGROUND: AUTHENTICATED Sorry ... The "MAIL FROM" email address [email protected] / www.example.com_ you are using is not hosted on this server. Sending mails from addresses not hosted on our server is not allowed. Please check the "MAIL FROM" settings of your mail client and make sure you set the "MAIL FROM" address to an email account which is hosted on the server.
But it's not possible to set up an email address using @www.example.com, only @example.com
The brilliant @jeherve found a solution: changing the email address used by the mail function:
add_filter( 'wp_mail_from', 'example_wp_mail_from' );
function example_wp_mail_from( $original_email_address ) {
return '[email protected]';
}
User in 896031-zen was able to get the form to work by adding that code.
On another note on 896031-zen as the user followed up: looks like the folks at SiteGround worked on that as well and implemented a fix somewhere into their WordPress site. The user has no idea what they did in detail, but they reported the email SiteGround sent to them, in case we want to take a look at it.
No new reports since January. I'll close this one, and we can reopen if this starts happening again.
Worth noting that in any case, the work-around above may help.
Most helpful comment
The brilliant @jeherve found a solution: changing the email address used by the mail function:
User in 896031-zen was able to get the form to work by adding that code.