I need to change the Return-Path in emails that are sent by the PHP's mail() function (via phpmailer, but that should make no difference).

Locally, exim is running and messes up the headers, so I added this to the exim configuration:

local_from_check = false
local_sender_retain = true

It does seem to have an undesirable effect (the Sender header is now missing, which is also wrong) but more importantly return-path remains unchanged (and is user@hostname)

How can you configure exim so that the Return-path remains untouched?

If that's not possible (or too hard) is it maybe possible to hardcode a Return-path in exim?

1 Answer 1


Also adding trusted_users = myuser does the trick.

By default exim does not allow any user to retain sender/return-path

You must log in to answer this question.

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