diff -ru wordpress.461/wp-includes/link-template.php wordpress/wp-includes/link-template.php
--- wordpress.461/wp-includes/link-template.php	2016-07-20 19:33:30.000000000 -0500
+++ wordpress/wp-includes/link-template.php	2016-10-18 14:27:28.803482900 -0500
@@ -4026,3 +4026,24 @@
 	 */
 	return apply_filters( 'get_avatar_data', $args, $id_or_email );
 }
+
+/**
+ * Retrieve the domain name for the current site, with leading www. stripped.
+ * Intended for use in sending emails.
+ *
+ * @since 4.7.0
+ *
+ * @return string Domain name for the current site, with leading www. stripped.
+ */
+function get_email_domain() {
+	$dom = parse_url( get_home_url( get_current_blog_id() ), PHP_URL_HOST );
+	$result = preg_replace( '#^www\.#', '', strtolower( $dom ));
+	/**
+	 * Filters the email domain name.
+	 *
+	 * @since 4.7.0
+	 *
+	 * @param string $result   Email domain.
+	 */
+	return apply_filters( 'get_email_domain', $result );
+}
diff -ru wordpress.461/wp-includes/ms-functions.php wordpress/wp-includes/ms-functions.php
--- wordpress.461/wp-includes/ms-functions.php	2016-08-04 22:56:42.000000000 -0500
+++ wordpress/wp-includes/ms-functions.php	2016-10-18 13:34:23.968482900 -0500
@@ -797,7 +797,7 @@
 	$activate_url = esc_url($activate_url);
 	$admin_email = get_site_option( 'admin_email' );
 	if ( $admin_email == '' )
-		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
+		$admin_email = 'support@' . get_email_domain();
 	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
 	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
 	$message = sprintf(
@@ -890,7 +890,7 @@
 	// Send email with activation link.
 	$admin_email = get_site_option( 'admin_email' );
 	if ( $admin_email == '' )
-		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
+		$admin_email = 'support@' . get_email_domain();
 	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
 	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
 	$message = sprintf(
@@ -1492,7 +1492,7 @@
 	$admin_email = get_site_option( 'admin_email' );
 
 	if ( $admin_email == '' )
-		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
+		$admin_email = 'support@' . get_email_domain();
 
 	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
 	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
@@ -1570,7 +1570,7 @@
 	$admin_email = get_site_option( 'admin_email' );
 
 	if ( $admin_email == '' )
-		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
+		$admin_email = 'support@' . get_email_domain();
 
 	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
 	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
diff -ru wordpress.461/wp-includes/pluggable.php wordpress/wp-includes/pluggable.php
--- wordpress.461/wp-includes/pluggable.php	2016-08-20 02:21:32.000000000 -0500
+++ wordpress/wp-includes/pluggable.php	2016-10-18 13:35:05.761482900 -0500
@@ -322,13 +322,7 @@
 	 */
 
 	if ( !isset( $from_email ) ) {
-		// Get the site domain and get rid of www.
-		$sitename = strtolower( $_SERVER['SERVER_NAME'] );
-		if ( substr( $sitename, 0, 4 ) == 'www.' ) {
-			$sitename = substr( $sitename, 4 );
-		}
-
-		$from_email = 'wordpress@' . $sitename;
+		$from_email = 'wordpress@' . get_email_domain();
 	}
 
 	/**
@@ -1466,7 +1460,7 @@
 		$notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
 	}
 
-	$wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
+	$wp_email = 'wordpress@' . get_email_domain();
 
 	if ( '' == $comment->comment_author ) {
 		$from = "From: \"$blogname\" <$wp_email>";
