发邮件的困难:
2015/3/12 15:54
tail -f /var/log/maillog : NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied
sudo chown smmsp:smmsp /var/spool/clientmqueue
sudo /usr/sbin/usermod -G smmsp -g apache apache
重启apache,也还是不行。。
maillog报错改变:
NOQUEUE: SYSERR(apache): can not write to queue directory /var/spool/clientmqueue/ (RunAsGid=48, required=51): Permission denied
并且/var/log/httpd/error_log已经不报错
chmod 777 clientmqueue 邮件就能发送了
2015/3/12 18:15
[[email protected] html]# chown smmsp:smmsp /var/spool/clientmqueue
[[email protected] html]# chmod 2770 /var/spool/clientmqueue
[[email protected] html]# chgrp smmsp /usr/sbin/sendmail
[[email protected] html]# chmod g+s /usr/sbin/sendmail
[[email protected] html]# /usr/sbin/usermod -G smmsp -g apache apache
2015/3/6 18:50
使用CI自带的发邮件,遇错误:Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.
sudo yum install postfix , 装好后仍然一样,
发现log中: Program mode requires special privileges, e.g., root or TrustedUser.
chmod -R 777 ugc_ci_framework 也不work;
/etc/php.ini 改成sendmail.postfix , /etc/init.d/httpd restart 重启了apache php配置生效,log报错换成:sendmail.postfix: fatal: unable to use my own hostname
在框架外面直接用php的mail(),也是Program mode requires special privileges, e.g., root or TrustedUser.