Affects Version/s: 2.0
Fix Version/s: None
The default value used by Mail_smtp for the HELO request is 'localhost', this gets picked up by SpamAssassin rule HELO_LOCALHOST with a large default score of 3.941 (Enough for most spam filters to tag this email as spam). This can be confirmed by looking at an email from CiviMail and see that the first Received header is along the lines of:
Received: from localhost (fqdn.example.com [10.1.1.1])
Received: from fqdn.example.com (fqdn.example.com [10.1.1.1])
This value is configurable in Mail_smtp and can be set by adding a value to the $params array. This should either be set as the sending servers FQDN or the virtualhost name of the civicrm instance. I chose to use the virtual host value.
After the lines setting the $param['host'] and $param['port'] add something like:
$params['localhost'] = $_SERVER['SERVER_NAME'];
or better yet make this a config value.