首页 > 系统服务 > 详细

linux ci 发邮件 sendmail

时间:2015-03-13 14:39:59      阅读:797      评论:0      收藏:0      [点我收藏+]

发邮件的困难:

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

[root@bogon html]# chown smmsp:smmsp /var/spool/clientmqueue

[root@bogon html]# chmod 2770 /var/spool/clientmqueue

[root@bogon html]# chgrp smmsp /usr/sbin/sendmail

[root@bogon html]# chmod g+s /usr/sbin/sendmail

[root@bogon 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.



本文出自 “技术是逼出来的。” 博客,请务必保留此出处http://linkindick.blog.51cto.com/2345165/1619974

linux ci 发邮件 sendmail

原文:http://linkindick.blog.51cto.com/2345165/1619974

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!