use /usr/sbin/sendmail in php exec()

endelwar

Member
May 2, 2004
9
0
151
Earth
cPanel Access Level
Root Administrator
when I use /usr/sbin/sendmail directly in a php exec() this error is reported: "sendmail cannot be called directly from a shell with the current user id".

I've already tried /scripts/eximup --force that changed permissions from -rwsr-sr-t to -rwxr-sr-x but didn't worked; I've also upgraded from 4.52 to 4.62 (downloaded from diff.cpanel.net) but no results again.
 

endelwar

Member
May 2, 2004
9
0
151
Earth
cPanel Access Level
Root Administrator
webignition said:
Firstly, why do you want to use exec() to send mail via sendmail - can't the mail() function be used?
Well, Mailwatch asks for it, so I must follow his rules ;)

webignition said:
Secondly, check that you don't have the SMTP tweak enabled in WHM > Tweak Security
I've disabled the SMTP tweak, but it doesn't work. It reports the same error.
 

avijit

Well-Known Member
Jul 26, 2004
116
0
166
India
Try checking the permission of the /usr/sbin/sendmail binary .