{"id":2032,"date":"2011-02-13T18:40:44","date_gmt":"2011-02-13T18:40:44","guid":{"rendered":"http:\/\/bitvolution.bitmortar.com\/?p=931"},"modified":"2011-02-13T18:40:44","modified_gmt":"2011-02-13T18:40:44","slug":"wordpress-failing-to-email-me-about-new-blog-comments","status":"publish","type":"post","link":"https:\/\/www.tomfotherby.com\/blog\/index.php\/2011\/02\/wordpress-failing-to-email-me-about-new-blog-comments\/","title":{"rendered":"WordPress failing to email me about new blog comments"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.tomfotherby.com\/blog\/wp-content\/uploads\/2009\/12\/WordpressLogo_blue-m.png?resize=100%2C100&#038;ssl=1\" alt=\"Wordpress Logo\" width=\"100\" height=\"100\" class=\"alignleft size-full wp-image-611\" style=\"padding: 20px\" \/><\/p>\n<p>Did you know that WordPress sends you emails when you get a new blog comment? <em>I didn&#8217;t<\/em> &#8211; because it has never worked for me. But once I knew it was supposed to email me I looked into it and found a fix.<\/p>\n<p><em>Setup:<\/em> My setup is running WordPress.org on a Ubuntu 9.04 box called <em>Butterfree<\/em> with sendmail installed.<\/p>\n<p>The problem was that the <code>Return-Path<\/code> header in my outgoing mails wasn&#8217;t valid which caused some mail recipients to reject the mail, while other less picky ones, accepted the mail fine (e.g. gmail). The <code>Return-Path<\/code> header that sendmail was using looked something like this:<\/p>\n<pre>\nReturn-Path: &lt;www-data@butterfree.bitvolution.com&gt;\n<\/pre>\n<p><\/p>\n<p>\nI found this by changing the admin email from the one that didn&#8217;t work to a gmail one, then posting a test comment on one of my posts. Then I waited for the email to arrive in gmail and selected &#8220;<em>show original<\/em>&#8221; from the gmail interface. A quicker way is to check the entries in <code>\/var\/log\/mail.log<\/code>.<\/p>\n<p>In order to fix the issue, I configured the return path in emails sent from WordPress (i.e. PHP) to something different using the <code>-f<\/code> parameter for sendmail:<\/p>\n<p><span class=\"iconTerminal\">sudo emacs \/etc\/php5\/apache2\/php.ini<\/span><\/p>\n<p>Find the <code>sendmail_path<\/code> and uncomment it and add the <code>-f<\/code> flag:<br \/>\n<code><br \/>\n; -f will set the \"return-path\" headers.<br \/>\nsendmail_path = \/usr\/sbin\/sendmail -i -t -f sendmail@bitvolution.com<br \/>\n<\/code><\/p>\n<p>Doing this solved this issue so I now get email about new comments.<\/p>\n<p>My fix feels a bit of a hack. I would be interested in how to solve this problem the right way, so let me know if you can give me some advice. For example, perhaps I should have done something with my DNS settings for my domain?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you know that WordPress sends you emails when you get a new blog comment? I didn&#8217;t &#8211; because it has never worked for me. But once I knew it was supposed to email me I looked into it and found a fix. Setup: My setup is running WordPress.org on a Ubuntu 9.04 box called [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[79],"tags":[105,26,87],"class_list":["post-2032","post","type-post","status-publish","format-standard","hentry","category-technical","tag-sendmail","tag-ubuntu","tag-wordpress"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2032"}],"version-history":[{"count":0,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2032\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}