今天使用mail命令发送邮件时,发送不了,错误信息如下:
/etc/mail/submit.cf: line 432: readcf: option RunAsUser: unknown user smmsp
/etc/mail/submit.cf: line 451: readcf: option TrustedUser: unknown user smmsp
Mail submission program must have RunAsUser set to non root user
报错信息提示:smmsp用户不存在,切换到root用户查看:
cat /etc/passwd | grep smm
运行命令后发现结果为空,那么就是smmsp用户被误删除了,解决方法:
groupadd smmsp
useradd smmsp -g smmsp -d /var/spool/clientmqueue -m -s /sbin/nologin
chown -R smmsp:smmsp /var/spool/clientmqueue
chmod -R 770 /var/spool/clientmqueue
之后运行脚本正常运行,完美解决!