sendmail problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rogelio23
Forum Newbie
Posts: 2
Joined: Wed Dec 06, 2006 3:03 am

sendmail problem

Post by rogelio23 »

My mail function is not working:

Please help me fix this, the error message appear like this: Permission denied: unable to execute shell to run mail delivery binary

I tried running this mail function on linux on the command line, and its run correctly. but on browser the error message appeared.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post. Your. Code.

Your command line user is in all likelihood a different user from the one the browser will use. The web server's user will need access rights to the command to be able to use it.

Alternately, you could switch to using a POP server with Swift.
rogelio23
Forum Newbie
Posts: 2
Joined: Wed Dec 06, 2006 3:03 am

Post by rogelio23 »

How do I set the access of web server's user so that the sendmail will allow it to run? I tried using phpmailer that I think is similar to swift, but its the same sendmail is not allowing it to run.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

PHPMailer uses mail() by default so of course it would be the same :) Use SMTP with swift.

To change the access control permissions of sendmail you need to be in the TRUSTED_USERS list in sendmail.cf. So apache running under "www" or "nobody" needs to be in the list.

If it's at an ever lower level than the sendmail config:

Code: Select all

which sendmail #Remember path
chmod o+x /usr/sbin/sendmail #(or whatever the path was)
chmod o+x /usr/sbin #(Or whatever the path was)
Post Reply