Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: instead of

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


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
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 add the following lines:

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 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 after you edit – adamo Feb 25 '13 at 12:24

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


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.