Linux – sendmail is using return-path instead of from address

linuxreturn-pathsendmailspam

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?

Best Answer

From the bat book (page 1165):

The Return-Path: header is intended to show the envelope address of the real sender as opposed to the sender used for replying (the From: and Reply-To: headers). In posting Usenet news, for example, the Return-Path: shows “news” and the From: shows the address of the posting user. But in general, Return-Path: should never be used for replying to mail. It is intended to be used solely for notification of delivery errors.

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.