Support » Plugin: Subscribe2 » false mismatch: "You appear to be sending notifications from an email …"

  • Resolved Gary Pardun

    (@garypardun)


    The settings page of Subscribe2 shows the error message:
    “You appear to be sending notifications from an email address from a different domain name to your blog, this may result in failed emails”

    The email domain name and the server host name are in fact the same but with different capitalization.

    The email address is gary@GarysFix.com and the server host name is garysfix.com.

    The simple correction is to change from strstr () to stristr() in the settings.php. It would also be helpful if the error message displayed the names it was comparing.

    Instead of:

    if ( !strstr($_SERVER['SERVER_NAME'], $domain) && $this->subscribe2_options['sender'] != 'author' ) {
    	echo "<div id=\"sender_message\" class=\"error\"><p class=\"s2_error\"><strong>" . __('You appear to be sending notifications from an email address from a different domain name to your blog, this may result in failed emails', 'subscribe2') . "</strong></p></div>";
    }

    Use:

    $myserver = $_SERVER['SERVER_NAME'];
    if ( !stristr($myserver, $domain) && $this->subscribe2_options['sender'] != 'author' ) {
    	echo "<div id=\"sender_message\" class=\"error\"><p class=\"s2_error\"><strong>" . __("You appear to be sending notifications from $sender, which has a different domain name than your blog server $myserver. This may result in failed emails.", 'subscribe2') . "</strong></p></div>";
    }

    http://wordpress.org/plugins/subscribe2/

Viewing 3 replies - 1 through 3 (of 3 total)
  • @gary,

    Using stristr() is not correct because it makes the entire email comparison case insensitive. An internet email standard (http://www.ietf.org/rfc/rfc5321.txt) states that the local-part of the email (the part before the ‘@’ must be treated as case sensitive.

    It seems that the domain part is treated as case insensitive in all cases so maybe I need to look at the comparison. But, the message does not stop the plugin working, it is designed to draw attention to a possible reason for non-sending before it becomes a problem. I’d also make a case that your email address while correct and allowed by the standards probably should use the same case and presentation as your site domain.

    Thanks for the reply.

    The stristr () function in the suggested code is comparing only the server name and domain name, not the whole email address. So we should be OK with the RFC.

    @gary,

    Good point. My brain was ready for some sleep when I looked at this last night. I made a fix but on reflection I think your approach is better. I will get it into the next version.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘false mismatch: "You appear to be sending notifications from an email …"’ is closed to new replies.