I have a customer that is complaining about emails marked as spam.
I'm looking at the header. It shows the correct From: reg@company.com
However, it doesn't like the return-path.
Return-Path: <apache@servername.mycompany.com>
Received-SPF: neutral (google.com: x.x.x.x is neither permitted nor denied by domain of apache@servername.mycompany.com) client-ip=x.x.x.x;
Authentication-Results: mx.google.com; spf=neutral (google.com: x.x.x.x is neither permitted nor denied by domain of apache@servername.mycompany.com) smtp.mail=apache@servername.mycompany.com
How do I configure sendmail to use the From address for the Return-Path?
From the bat book (page 1165):
Your client is not having problems with the Return-Path: header. Neither with SPF since the result is neutral as the headers tell us. You client must accept the fact that the intended recipients consider what he sends as spam.
If this is indeed a false positive consider setting up proper SPF and DKIM records for the domain and see if the situation improves.
It looks like you email is from an automated sender which is sending using one of Google's server. It may be connecting to GMail to send the message. Your server appears to have an SPF record, which neither includes the Google SPF list nor indicates that it should be enforced. Including a Sender header for apache@servername.mycompany.com may help.
There are a number of factors that will make you email look like Spam before you even start sending it.
Failing the first two tests are strongly indicative of Spam, or an automated mail source. Person to person e-mail almost always pass these tests, while Spam often fails. The next two tests are indicative of non-Spam.
Once you have started sending the email there are other tests that apply.
I find I get a relatively high failure rate on DKIM signed documents from automated senders. This is mainly related to the public keys not being available from DNS.