nobody@hostname in php mail() Return-Path

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
Undeliverable mail sent by a user with PHP mail() gets returned to nobody@hostname instead of the user. That's because the Return-Path always seems to be set to nobody@hostname no matter what headers are used in mail() to try to redirect the Return-Path. We tried Errors-To, Return-Path, &-f$sender& so far with no success.

Has anyone found a way to change the Return-Path?
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
[quote:a445a56e3e][i:a445a56e3e]Originally posted by Juanra[/i:a445a56e3e]

About the -f command line option and Exim:

http://www.exim.org/exim-html-3.20/doc/html/spec_5.html#SEC73

http://www.exim.org/exim-html-3.20/doc/html/spec_11.html#SEC393

http://www.exim.org/exim-html-3.20/doc/html/spec_11.html#SEC251


[/quote:a445a56e3e]
Very useful. Many thanks.

Setting this in exim.conf:

untrusted_set_sender = true

enabled &-f$sender& in PHP mail()

I'm not yet sure if there are any security implications with this but it worked.

Best regards,

Norman
 

rpmws

Well-Known Member
Aug 14, 2001
1,787
10
318
back woods of NC, USA
so do the headers look like you want them to now? I have been having this problem for a while. Can the script specify what the header looks like now? .. I know before certian things never worked.
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
[quote:326ff3f535][i:326ff3f535]Originally posted by rpmws[/i:326ff3f535]

so do the headers look like you want them to now? I have been having this problem for a while. Can the script specify what the header looks like now? .. I know before certian things never worked. [/quote:326ff3f535]
The -f parameter in PHP mail() is working correctly with the above fix. It is redirecting the Return-Path to the address set in that parameter. Before that fix the Return-Path was always being set to nobody@hostname so any undeliverable mail used to end up returned to us instead of the user.