1

I just changed Return-Path in 2 of my servers which run Exim and Posfix. The third server runs Sendmail. I spent several hours trying to find information how to change it but can not find anything. So, I need to change Return-Path so that sent emails contain Return-Path: [email protected] instead of [email protected].

I can not change the server's hostname itself because my data center wants additional 5 EUR/month for a custom PTR record.

Thanks.

1
  • 2
    5 euros per month to set a PTR record? That's utterly absurd. Any reputable host will allow you to set these for free. Feb 24, 2013 at 18:22

3 Answers 3

1

I copy from the bat book:

There must be only one Return-Path: header in any mail message, and it should be placed there by the site performing final delivery. This header should be declared in the configuration file like this:

H?P?Return-Path: $g

The ?P? flag ensures that only delivery agents that perform final delivery insert this header. Those delivery agents are usually prog and local, which usually contain an F=P delivery agent flag

So if you want to set it to something else at the bottom of your sendmail.mc add the following lines:

LOCAL_CONFIG
H?P?Return-Path: blah-blah

Also note that if this header is already defined, then it cannot be replaced unless sendmail was compiled with H_ACHECK defined for conf.c.

2
  • 1
    sendmail.mc file didn't contain "Return-Path". So, I added your suggested lines, restarted sendmail. No effect. Sendmail still uses server's hostname as a return-path. Feb 25, 2013 at 11:26
  • 1
    You need to produce a new sendmail.cf after you edit sendmail.mc.
    – adamo
    Feb 25, 2013 at 12:24
1

https://web.archive.org/web/20161120105550/http://www.sendmail.com:80/sm/open_source/docs/m4/masquerading.html

As I understand you look for FEATURE(`masquerade_envelope')
[only "header sender"/"From:" is modified by default, other features extend it]

P.S. If you want to keep "header sender"/"From:" unchanged AFAIR it possible with FEATURE(`genericstable').

1
  • You may ask sendmail related questions at news:comp.mail.sendmai
    – AnFi
    Mar 6, 2013 at 23:02
0

Aaargh. Bloody dawn horrible m4. I do not use it, never did. I create my sendmail.cf by hand

You need to code a rule called like this to change the right side of the mail addr to whatever you want
H?P?Return-Path: $>Rule

SRule ....

Code the rule on it own with a name outside H for headers inside sendmail.cf alone out of any other rule Test it with

sendmail -bt -d21.12

? rules addr

NameOfRule [email protected]

see if it comes as you like [email protected]

Be aware of DMARC with spf & dkim validation The From: domain part be same in the Return-Path domain part So my advice change both or leave alone.

And read the bat book. No blogs, nothing else.

Poor Exim and Posfix they are a shame :-((, miles behind sendmail

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .