简体   繁体   English

SMTP:延迟发送的电子邮件(约8小时)

[英]SMTP: Emails sent with delay (~8 hours)

I have the impression (still investigating on it) that the emails my webapp automatically sends are highly delayed (something like 8 hours late). 我的印象是(仍在调查中)我的Webapp自动发送的电子邮件被高度延迟 (大约晚8小时)。

  • Could this be my SMTP server that is overloaded? 这可能是我的SMTP服务器超载了吗?
  • Could this be related to SPAM filtering? 这可能与垃圾邮件过滤有关吗?
  • Is this why apps such as Mandrill exit? 这就是为什么像Mandrill这样的应用程序退出的原因?

I have been searching in those directions, without success. 我一直在朝那些方向搜索,但没有成功。

I am using 1&1 as a domain name provider. 我正在使用1&1作为域名提供商。

It's possible that something could be introducing a delay between when your application generates these messages, and when your SMTP server actually sends them, as you allude to in your question. 正如您在问题中提到的,在您的应用程序生成这些消息与SMTP服务器实际发送它们之间,可能会引入延迟。

It's also possible that the receiving MX could be deferring acceptance of the messages, thinking that your sending SMTP server could be a spammer. 考虑到您发送的SMTP服务器可能是垃圾邮件发送者,接收MX也可能会推迟对邮件的接受。 This is known as 'greylisting'. 这就是所谓的“灰名单”。 In this case, your SMTP server must make several retries before the message is finally accepted by the receiving MX, and this is what is causing the delay. 在这种情况下,您的SMTP服务器必须重试几次,才能最终使接收MX接受该消息,这就是造成延迟的原因。 It is not uncommon for receiving MX's to greylist sending SMTP servers with questionable IP reputation or improperly configured DNS. 接收MX到发送带有可疑IP信誉或DNS配置不正确的SMTP服务器的白名单的情况并不少见。

Is it possible for you to check the logs on the SMTP server that sends these messages? 您是否可以检查发送这些消息的SMTP服务器上的日志? If so, the logs will show you a timestamp for each delivery attempt, and from the timestamps it will be clear which of the above is happening. 如果是这样,日志将为您显示每次传递尝试的时间戳,从时间戳中可以很清楚地看到上述情况。

Also, looking at the headers of one of the delayed messages (after it was finally received) may shed some light on where the delay is. 同样,查看延迟消息之一的标头(在最终收到消息之后)可能会揭示延迟的位置。 Reading from the bottom up, you should see a timestamp showing when the message was generated, followed by timestamps for the arrival of the message at each server that relayed it. 从下往上阅读,您应该看到一个时间戳,显示生成消息的时间,然后是该消息到达中继它的每个服务器的时间戳。 From these timestamps, you should be able to see where the delay was. 从这些时间戳记中,您应该能够看到延迟在哪里。

Might they be running on a cronjob that only sends them every so often? 他们是否可能在仅经常发送一次的cronjob上运行?

Or perhaps they are sent using a task queue of background jobs (like Resque), and the queue is just really backed up? 还是使用后台作业的任务队列(例如Resque)发送它们,并且该队列真的得到了备份?

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

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