WordPress.org

Forums

Subscribe2
[resolved] false mismatch: "You appear to be sending notifications from an email ..." (4 posts)

  1. Gary Pardun
    Member
    Posted 1 year ago #

    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/

  2. mattyrob
    Member
    Posted 1 year ago #

    @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.

  3. Gary Pardun
    Member
    Posted 1 year ago #

    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.

  4. mattyrob
    Member
    Posted 1 year ago #

    @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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Subscribe2
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic