changing nobody when emailing through php

epanagio

Well-Known Member
May 26, 2012
50
1
58
cPanel Access Level
Website Owner
I am using php to send emails to myself when my users take take certain actions. Those emails used to come to me via [email protected]

After reading cpanel documentation about making my server more secure I disabled emails from user nobody. Is there a way to change php's way of determining the user ID?

In the php code to send the email I specify:
$headers .= "From: <[email protected]>" . "\r\n";
but the exim_mainlog says
Mail delivery failed: returning message to sender" for [email protected]
Thanks,
Evan
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Hello :)

Do you have root access to this system? If so, you can update your PHP handler to suPHP so that email is sent as the account username rather than the "nobody" username. The other alternative is to modify your script to use SMTP authentication to send out email.

Thank you.
 

epanagio

Well-Known Member
May 26, 2012
50
1
58
cPanel Access Level
Website Owner
I do have root access but I can't figure out the "suPHP" part. Where do I change this?

I looked in the "php configuration editor" and I didn't see anything of interest there.

Hello :)

Do you have root access to this system? If so, you can update your PHP handler to suPHP so that email is sent as the account username rather than the "nobody" username. The other alternative is to modify your script to use SMTP authentication to send out email.

Thank you.