Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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)

-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, changed the permissions, and it works. Thanks. – Adripants Jul 4 '13 at 2:10
@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


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.