我正在尝试从命令行发送邮件作为CentOS上的非root用户.我正在使用以下命令,但收到错误:
$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
我已将用户添加到组51(smmtp),我可以cd和写入该目录作为用户.
为什么我收到错误?
一些相关权限:
# 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