Is there a way to change the default return path with sendmail?

Ben Holness picture Ben Holness · Nov 27, 2013 · Viewed 8.3k times · Source

I know that I can use the -f switch to set the return path with sendmail, I am wondering if it is possible to change the default return path somewhere, or if the only way is to set it per send.

Answer

AnFi picture AnFi · Nov 27, 2013

You may use FEATURE(genericstable) to rewrite sender addresses.

By default genericstable changes only "header sender" addresses.

FEATURE(masquerade_envelope) turns on also rewriting "envelope sender" address (which may be set by -f)

FEATURE(allmasquerade) turns on also rewriting "header recipients" (addresses in To: and Cc: headers)

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