I'm trying to send mail from the command line as a non-root user on CentOS. I'm using the following command but getting an error:
$ echo test | mail -s "test" to@example.com -c cc@example.com
WARNING: RunAsUser for MSP ignored, check group ids (egid=102, want=51)
can not write to queue directory /var/spool/clientmqueue/ (RunAsGid=102, required=51): Permission denied
I've added the user to group 51 (smmtp) and I can both cd and write to that directory as the user.
Why am I getting the error?
Some relevant permissions:
# ls -la /var/spool/clientmqueue/
total 8
drwxrwx--- 2 smmsp smmsp 4096 Mar 8 14:25 .
drwxr-xr-x. 13 root root 4096 Oct 21 15:09 ..
# ls -la /usr/sbin/sendmail
lrwxrwxrwx 1 root root 21 Oct 21 15:09 /usr/sbin/sendmail -> /etc/alternatives/mta
# ls -la /etc/alternatives/mta
lrwxrwxrwx 1 root root 27 Oct 21 15:09 /etc/alternatives/mta -> /usr/sbin/sendmail.sendmail
# ls -la /usr/sbin/sendmail.sendmail
-rwxr-sr-x 1 root smmsp 833512 Nov 11 2010 /usr/sbin/sendmail.sendmail