﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
16805	default 'from' hostname	lonnylot		"The logic used to create the hostname portion of default e-mail address when calling wp_mail doesn't make sense.

Lines 384-392 of wp-includes/pluggable.php read:
{{{
	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;
	}
}}}

We assume that if www. is in the sitename that it is not part of the e-mail address. I reviewed a few RFCs and have not found where 'www.' is prohibited from the hostname portion of an e-mail address. I concede that john.smith@ www.sitename.com is now common, but it is still a legal name.

Additionally, if the $_SERVER[ 'SERVER_NAME' ] is a sub-domain such as blogs.sitename.com the e-mail is going to send from john.smith@ blogs.sitename.com.

For consistency I suggest we either remove all nth level domain names above the first or remove none. This way it will be more obvious when people need to use the wp_mail_from filter and not just appear to be random."	defect (bug)	new	normal	Awaiting Review	Mail	3.1	normal		close	info@…
