繁体   English   中英

更改路由器后,php sendmail无法正常工作

[英]php sendmail doesn't work after I changed the router

我正在运行一个使用PHP sendmail函数的Web服务器,该服务器直接连接到路由器,将旧路由器替换为新路由器后,它不再起作用。

旧路由器-Cisco RV082-常规固件新路由器-Netgear R7000-DD-WRT v3.0-r30700M kongac

我尝试打开所有端口并关闭防火墙,但仍然无法正常工作。 请帮忙。

这是日志的一部分。 10月11日是工作日,10月13日不是。

/var/log/mail.log

Oct 11 13:58:08 localhost sm-mta[3613]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128
Oct 11 13:58:08 localhost sm-mta[3613]: u9BKw7pL003611: to=<joe@ctclogis.com>, ctladdr=<www-data@localhost.localdomain> (33/33), delay=00:00:01, xdelay=00:00:01, maile$
Oct 11 13:58:09 localhost sm-mta[3613]: u9BKw7pL003611: to=<export@ypusa21.com>, ctladdr=<www-data@localhost.localdomain> (33/33), delay=00:00:02, xdelay=00:00:02, mai$
Oct 11 13:58:09 localhost sm-mta[3613]: STARTTLS=client, relay=alt1.aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128$
Oct 11 13:58:10 localhost sm-mta[3613]: u9BKw7pL003611: to=<joe@ctclogis.com>, ctladdr=<www-data@localhost.localdomain> (33/33), delay=00:00:03, xdelay=00:00:03, maile$

Oct 13 19:20:26 localhost sm-mta[6369]: u9E2KQ20006369: from=<>, size=2122, class=0, nrcpts=1, msgid=<201610140220.u9E2K13e006368@localhost.localdomain>, proto=ESMTP, $
Oct 13 19:20:26 localhost sm-msp-queue[6368]: u9E2K13e006368: to=www-data, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31509, relay=[127.0.0.1] [127.0.0.1], dsn$
Oct 13 19:20:26 localhost sm-mta[6370]: u9E2KQ20006369: to=<www-data@localhost.localdomain>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32350, dsn=2.0.0, stat=$
Oct 13 19:20:26 localhost sm-msp-queue[6368]: u9DM8URU004818: u9E2K13f006368: sender notify: Warning: could not send message for past 4 hours

马克B在他的评论中是正确的。 这不是让您提出此类问题的最佳站点。 尝试使用网络工程堆栈交换或类似的方法。

现在,如果这是一个PHP问题,那么可以,您已经发布到了正确的网站,但是需要重新措辞以更加合规。 如果是这种情况,您是否仔细检查了PHP手册中有关发送邮件功能的所有注意事项? 从编程的角度来看,您的错误可能只是您尝试发送电子邮件的方式。 旧路由器可能只是忽略了您的错误(格式错误的消息)并以任何方式发送了内容; 根据我的经验,情况并非如此,因为您的路由器通常与此无关,只是根据您的设置来完成其路由或转发工作。

更具体地说,我正在尝试整理您的日志,我认为在PHP方面,您可能会犯一些错误。

10月13日19:20:26 localhost sm-mta [6369]:u9E2KQ20006369:from = <>,size = 2122,class = 0,nrcpts = 1,msgid = <201610140220.u9E2K13e006368@localhost.localdomain>,proto = ESMTP, $

您的服务器未在此行上记录发件人电子邮件地址。 在使用mail函数的PHP脚本中,您忘记设置一个了吗?

10月13日19:20:26 localhost sm-msp-queue [6368]:u9E2K13e006368:to = www-data,delay = 00:00:00,xdelay = 00:00:00,mailer = relay,pri = 31509,中继= [127.0.0.1] [127.0.0.1],dsn $,十月13日19:20:26 localhost sm-mta [6370]:u9E2KQ20006369:to =,delay = 00:00:00,xdelay = 00:00:00, mailer = local,pri = 32350,dsn = 2.0.0,stat = $

我可能读错了这个内容(同样是编程站点),但是您的邮件中继已设置为本地主机。 为什么? 您从11日开始的旧日志显示了您使用Google中继。

似乎在PHP脚本中您用来发送电子邮件的信息或PHP配置/服务器本身配置有误。

如果可以ping从网络中删除服务器,则还应该能够发送邮件,但是请通过新路由器验证配置,以查看是否存在阻止smtp端口25退出的事件

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM