Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: root@mydomain.com instead of root@my-servers-hostname.com.

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

Thanks.

share|improve this question
    
5 euros per month to set a PTR record? That's utterly absurd. Any reputable host will allow you to set these for free. –  Michael Hampton Feb 24 '13 at 18:22

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
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. –  user1821484 Feb 25 '13 at 11:26
    
You need to produce a new sendmail.cf after you edit sendmail.mc. –  adamo Feb 25 '13 at 12:24

https://www.sendmail.com/sm/open_source/docs/m4/masquerading.html

As I understand you look for FEATURE(`masquerade_envelope') ["header sender"/"From:" is modified by default].

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

share|improve this answer
    
You may ask sendmail related questions at news:comp.mail.sendmai –  Andrzej A. Filip Mar 6 '13 at 23:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.