【问题标题】:php sendmail doesn't work after I changed the router更改路由器后php sendmail不起作用
【发布时间】:2017-02-24 04:34:00
【问题描述】:

我正在运行一个使用 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

【问题讨论】:

  • 这个网站是为编程问题。我们不是一般的网络技术支持。

标签: php sendmail router dd-wrt


【解决方案1】:

Marc B 在他的评论中是正确的。这不是您提出此类问题的最佳网站。试试Network Engineering Stack Exchange 或类似的东西。

现在,如果这是一个 PHP 问题,那么是的,您已发布到正确的站点,但需要重新措辞您的问题以更符合要求。如果是这种情况,您是否仔细检查了PHP manual on the send mail function 中的所有注意事项?从编程的角度来看,您的错误可能只是您尝试发送电子邮件的方式。旧路由器可能只是忽略了您的错误(格式不正确的消息)并无论如何都发送了东西;根据我的经验,情况并非如此,因为您的路由器通常与此无关,除了根据您的设置执行路由或转发工作。

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

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

您的服务器未在此行记录发件人电子邮件地址。在您使用邮件功能的 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$ 10 月 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,统计=$

我可能读错了(这又是一个编程站点),但您的邮件中继设置为您的本地主机。为什么?您 11 日的旧日志显示您使用的是 google 中继。

似乎您用于发送电子邮件的 PHP 脚本或您的 PHP 配置/服务器本身配置错误。

【讨论】:

  • 很抱歉我一直来这个地方,直到现在才意识到哈哈。顺便说一句,我在两个日期都使用了相同的脚本,而且我已经使用了多年,所以这不是脚本错误。我会试试你推荐的网站。谢谢!
【解决方案2】:

如果您可以从网络中 ping 删除服务器,您应该也可以发送邮件,但是请验证您的新路由器的配置,看看是否有什么东西阻止了 smtp 端口 25 输出

【讨论】:

  • 我能够 ping 并完美地运行服务器。我还打开了所有必要的端口,包括 SMTP,但仍然无法正常工作。我最终切换回旧路由器并更新了固件似乎解决了问题。
猜你喜欢
  • 2013-02-28
  • 2022-06-24
  • 2013-12-28
  • 1970-01-01
  • 1970-01-01
  • 2020-12-04
  • 1970-01-01
  • 2013-03-29
  • 1970-01-01
相关资源
最近更新 更多