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.

I'm trying to setup a new help desk program (Kayako), but I'm having problems relaying the mail to our mail server.

Here's the error I'm getting:

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

I changed ownership on the clientmqueue folder to smmsp:apache with the same 770 permissions as it normally has, however the error still occurs.

share|improve this question

3 Answers 3

According to the "bat book" (4th edition, page 168) the recommended permissions for the directory are:

chown smmsp:smmsp clientmqueue
chmod 0770 clientmqueue
share|improve this answer
    
That's what I had them set to originally, but I changed it because of the error I keep getting. I'm assuming the 'Permission denied' error was because Apache didn't have ownership. Turning off SELinux enforcement didn't help, either. –  nojak Jul 25 '12 at 23:22
    
Did you reboot the machine after turning SELinux off? –  adamo Jul 26 '12 at 6:08
    
Here's how someone else solved this sudo setsebool -P httpd_can_sendmail on –  adamo Jul 26 '12 at 6:09
    
Interesting. I'll have to try that tomorrow. Thanks! –  nojak Jul 26 '12 at 7:42

Sendmail should be running setgid, otherwise the mail queue would have to be writable by PHP. It sounds like this is not the case on your server.

share|improve this answer
    
Sounds like a major security risk to me. –  nojak Jul 26 '12 at 0:12
    
-rwxr-sr-x. 1 root smmsp 839880 Jun 25 11:31 /usr/sbin/sendmail.sendmail –  Michael Hampton Jul 26 '12 at 0:41
1  
@nojak well then, if you know what you're doing then you set it up however you want. –  tylerl Jul 26 '12 at 0:52
    
I was just wondering if there was any other way to get it working. I appreciate the response, but it sounds risky. If you would like to clarify why it's not a potential security risk, or if that's the only way to get it working, that would be much more appreciate than a snide remark. –  nojak Jul 26 '12 at 1:58
    
Unfortunately the suggestion didn't work... Same error. Thanks again for the response, though. Much appreciated. –  nojak Jul 26 '12 at 2:04
up vote 0 down vote accepted

So, I ended up starting from scratch, just to make sure I only had the minimal install on there, and that there weren't any conflicting packages.

SELinux was still keeping me from connecting to the external mail server, however.

I would receive warnings like this:

[Warning]: stream_socket_client(): unable to connect to mail.mydomain.com:25 (Permission denied) (Transport/StreamBuffer.php:263)

I found that I needed to allow HTTPD scripts and modules to connect to the network by setting an SELinux boolean for httpd_can_network_connect to on.

I did this by running the following command: setsebool -P httpd_can_network_connect on

If you don't use the -P flag, the change is not saved to the policy file, and will not persist through reboots.

Just thought I'd post this for anyone else that runs into a similar issue. I believe that httpd_can_network_connect not being set to on was causing the sendmail error as well.

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.