Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My centos server can send mail using the 'mail' command but not from php. Maillog says:

sendmail[18010]: NOQUEUE: SYSERR(nginx): can not chdir(/var/spool/clientmqueue/): Permission denied

My permissions are as follows:

lrwxrwxrwx 1 nginx nginx 30 Oct 30 20:27 /usr/lib/sendmail -> /etc/alternatives/mta-sendmail 
lrwxrwxrwx 1 nginx nginx 21 Oct 30 20:27 /usr/sbin/sendmail -> /etc/alternatives/mta

lrwxrwxrwx 1 nginx nginx 27 Oct 30  2012 /etc/alternatives/mta -> /usr/sbin/sendmail.sendmail
lrwxrwxrwx 1 nginx nginx 26 Oct 30  2012 /etc/alternatives/mta-sendmail -> /usr/lib/sendmail.sendmail

lrwxrwxrwx 1 nginx nginx     16 Oct 30  2012 /usr/lib/sendmail.sendmail -> ../sbin/sendmail
-rwxr-xr-x 1 root  smmsp 775064 Aug 11  2011 /usr/sbin/sendmail.sendmail

What would all these links be for?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Sendmail-8.12+ installation: file permissions

Sendmail-8.12+ binary should be installed as set GROUP id.
(/usr/sbin/sendmail.sendmail in your case)

http://www.sendmail.org/~ca/email/doc8.12/SECURITY

-r-xr-sr-x  root   smmsp    ... /PATH/TO/sendmail
drwxrwx---  smmsp  smmsp    ... /var/spool/clientmqueue
share|improve this answer
    
Great. I looked up s bits here faqs.org/docs/securing/chap5sec52.html, changed the permissions, and it works. Thanks. –  Adripants Jul 4 '13 at 2:10
1  
@Adripants : Set group id sendmail is much better than previous set root id :-) –  Andrzej A. Filip Jul 9 '13 at 15:16

There's also an SELINUX boolean policy called httpd_can_sendmail.... I'm pretty sure this has to be set to true also.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.