4

I'm hosting a portion of a website for a client, and sending e-mails from their primary domain from a server in my network. Proper SPF records are in place for this, but SPF checking is still failing.

SPF seems to be checking the Return-Path: header, which is currently showing up as serverusername@serverhostname. The server hostname uses an internal tld and means nothing to the outside world. The mail sending script is written in perl, and I tried passing a different return path value to sendmail via the -f flag, and also by explicitly adding a Return-Path: header. Both methods have resulted in no change to the Return-Path:.

How can I change the Return-Path: in sendmail to the from e-mail address of the e-mail I'm sending so SPF passes?

Update:

Here are the contents of /etc/mail:

access
access.db
domaintable
domaintable.db
helpfile
local-host-names
mailertable
mailertable.db
Makefile
sendmail.cf
sendmail.cf.orig
sendmail.cf.rpmnew
sendmail.mc
submit.cf
submit.mc
trusted-users
virtusertable
virtusertable.db
adamo
  • 6,965
noctorum
  • 105
  • Do you know which mail relaying server you are using? Qmail, postfix, something else? – WerkkreW Apr 09 '12 at 18:51
  • This box only has sendmail setup. – noctorum Apr 09 '12 at 18:59
  • There has to be an underlying mail server, which needs to be configured. – WerkkreW Apr 09 '12 at 19:00
  • There are no init scripts for postfix, qmail, exim etc., but mail is being sent out successfully with just sendmail. I'll update my main question with a list of the configuration files available in /etc/mail. – noctorum Apr 09 '12 at 19:03
  • That's really odd, maybe I have no idea what I'm talking about! Take a look in sendmail.cf to see if the configuration for the sender domains, return paths, etc are in there. – WerkkreW Apr 09 '12 at 19:08
  • It includes configs for local-host-names (which should just be incoming), a relay-domains file which isn't there or used, an empty mailertable, a virtusertable with no entry for this domain (since incoming mail isn't coming back to this box), and an accessdb file. This particular domain hasn't been added to any of those since it isn't accepting incoming e-mail from those addresses. – noctorum Apr 09 '12 at 19:17
  • Return path is set to the sendmail default: H?P?Return-Path: <$g> – noctorum Apr 09 '12 at 19:20
  • It would help if you could also add a log or a precise description of the error you are getting. – adamo Apr 09 '12 at 20:11

1 Answers1

3

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.

You cannot change Return-Path: the way you try. Have your script submit emails to your mail server via SMTP. Or you can try FEATURE(masquerade_envelope)

ricmarques
  • 1,134
adamo
  • 6,965