Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

After my CentOS 6.4 install, sendmail-related components were set up as follows:

mail:x:12:mail,postfix in /etc/group

drwx------ 2 root mail 4096 Sep 6 14:06 /var/spool/mqueue

And I was getting these errors when invoking a shell script to send email with an attachment, but not a plain mail -s "subject" recipient < /dev/null on the command line

Sep  6 12:46:08 localhost sendmail[3554]: NOQUEUE: SYSERR(ics): can not chdir(/var/spool/mqueue/): Permission denied

This is what I did to fix the problem, but why did I have to do it, and what else could I have done? Those are my questions.

mail:x:12:mail,postfix,smmsp in /etc/group

drwxrwx--- 2 root smmsp 4096 Sep 6 14:06 /var/spool/mqueue

Edit:

To make matters stranger, a CentOS 5.9 system set up just the way my system was set up works fine without the error.

share|improve this question
    
see serverfault.com/questions/520531/… –  cas Sep 14 '13 at 0:15
    
Are you chrooted after installation? –  Mohsen Pahlevanzadeh Sep 14 '13 at 5:28
    
@MohsenPahlevanzadeh I'm not sure what your comment means. On every other system I have, I installed, made sure sendmail was running and mail client was installed, and then any user can send mail off the box. It works now, but not until I tweaked the things indicated in the OP. –  octopusgrabbus Sep 14 '13 at 13:48
    
@CraigSanders That's the answer. If you put in something to that affect, I'll accept it. –  octopusgrabbus Sep 14 '13 at 13:50
    
ok, done. btw, i'm not sure why you've tagged this 'postfix' because it's a question about sendmail, not postfix. –  cas Sep 15 '13 at 0:05
show 1 more comment

1 Answer

up vote 2 down vote accepted
+50

The sendmail binary should be in group smmsp and setgid and /var/spool/mqueue should be group smmsp, and group writable.

chgrp smmsp /usr/sbin/sendmail.sendmail
chmod a=rx,g+s /usr/sbin/sendmail.sendmail

chgrp smmsp /var/spool/mqueue
chmod ug=rwx,o= /var/spool/mqueue

see http://serverfault.com/questions/520531/sendmail-chdir-clientmqueue-permission-denied

As for the reason why - most likely a packaging bug. Report it to the Centos developers so they can fix it. http://bugs.centos.org

share|improve this answer
add comment

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.