Skip to content

How to Resolve "NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied"

There was an error in maillog while sending a mail by PHP.

[root@web ~]# tail -f /var/log/maillog
Jan  6 20:38:11 web sendmail[2703]: NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied

It seems a permission issue. It could be blocked by SELinux, so let's check SELinux boolean value of sendmail.

[root@web ~]# getsebool -a | grep sendmail
httpd_can_sendmail --> off
logging_syslogd_can_sendmail --> off

You can see "httpd_can_sendmail" is turned off. Let's turn it on by "setsebool". It may take a while.

[root@web ~]# setsebool -P httpd_can_sendmail on
[root@web ~]# getsebool -a | grep mail
httpd_can_sendmail --> on
logging_syslogd_can_sendmail --> off

Don't forget to restart httpd after enabling.

[root@web ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Now, let's try to send a mail by PHP again. This time, it succeeded. I received the new mail in mailbox. Let's see the maillog again.

[root@web ~]# tail -f /var/log/maillog
Jan  6 21:06:46 web sendmail[2752]: s06D6kSB002752: from=apache, size=812, class=0, nrcpts=1, msgid=<>, relay=apache@localhost
Jan  6 21:06:47 web sendmail[2753]: s06D6kF9002753: from=<>, size=1035, class=0, nrcpts=1, msgid=<>, proto=ESMTP, daemon=MTA, relay=example []
Jan  6 21:06:47 web sendmail[2752]: s06D6kSB002752: to=Ed Chen's Logic <>, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30812, relay=[] [], dsn=2.0.0, stat=Sent (s06D6kF9002753 Message accepted for delivery)
Jan  6 21:06:51 web sendmail[2755]: STARTTLS=client,, version=TLSv1/SSLv3, verify=FAIL, cipher=RC4-SHA, bits=128/128
Jan  6 21:07:06 web sendmail[2755]: s06D6kF9002753: to=<>, ctladdr=<> (48/48), delay=00:00:19, xdelay=00:00:19, mailer=esmtp, pri=121035, [], dsn=2.0.0, stat=Sent (OK 1389013626 r7si54762570pbk.207 - gsmtp)

Now, the problem is resolved.

Leave a Reply

Your email address will not be published.