phpmailer使用sendmail发送邮件

6 篇文章 0 订阅

tail /var/log/maillog日志错误
1.NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied

chown smmsp:smmsp /var/spool/clientmqueue
chmod 770 /var/spool/clientmqueue
chgrp smmsp /usr/sbin/sendmail
chmod g+s /usr/sbin/sendmail

另外

/usr/sbin/setsebool -P httpd_can_sendmail=on

原因是apache默认并不运行sendmail。你必须手动开启。

2. Mar 1 16:40:16 localhost sm-msp-queue[31173]: p218WjqH030935: to=*@*.com, delay=00:07:31, xdelay=00:00:00, mailer=relay, pri=139557, relay=[127.0.0.1] [127.0.0.1], dsn=
4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
原来是sendmail在Fedora中默认的配置有问题,
修改/etc/mail/sendmail.mc文件:

DAEMON_OPTIONS(`Port=smtp,Name=MTA’)dnl 
dnl #DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl  

把原来的指定Addr注释掉,
原来这种配置只能向本机地址发送邮件,
然后重新加载配置文件:

make -C /etc/mail  

重启服务:

service sendmail restart 

使用mail发信就正常了。
3. make -C /etc/mail报错:

#make -C /etc/mail
make: Entering directory '/etc/mail'
WARNING: 'sendmail.mc' i modified. Please install package sendmail-cf to update your configuration.

解决:
Your system likely came with a default sendmail.mc and sendmail.cf file in /etc/mail. These are part of package called sendmail.

However, the files to actually make sendmail.mc into a sendmail.cf are part of a separate package called sendmail-cf.

The message is telling you in essence it can't make the file because you don't have the sendmail-cf package installed.

If you're on RedHat/CentOS/Fedora you can likely just do "yum install sendmail-cf" to get the latest package installed. (RHEL 4 and earlier use up2ate rather than yum.)

For other distros you'd use their package management tools for downloading and installing the sendmail-cf package.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值