亚马逊EC2 / SES SMTP超时 [英] Amazon EC2/SES SMTP Timeout

查看:1346
本文介绍了亚马逊EC2 / SES SMTP超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题想从使用SMTP SES我的EC2实例发送电子邮件时。出于某种原因,我得到零星的超时问题,在那里我可以不再与SMTP主机。要注意的是通过SES发送工作大概75%的时间是很重要的。

I have an issue when trying to send emails from my EC2 instance using SMTP to SES. For some reason I am getting sporadic timeout issues, where I can no longer contact the SMTP host. It is important to note that sending through SES works probably 75% of the time.

我将开始与一些细节。我的SES账户是工作时间的的。发件人邮件已被证实,我的极限已经提高到10k /天,5邮件/秒。我在IM pression,我会得到一个限制特定的错误,如果这是关系到我的极限。对于我的SMTP的配置,我使用posfix瓦特/ TLS。我已经发布在官方AWS SES论坛一个非常类似的职位,但还没有出现任何的成功呢。这些信息对于那个岗位是这个岗位的底部。

I will start with some details. My SES account is working most of the time. The sender email has been verified, and my limits have been increased to 10k/day, 5 emails/second. I am under the impression that I would get a limit-specific error if this was related to my limits. For my SMTP configuration, I am using posfix w/TLS. I have posted a very similar post on the official AWS SES forums, but have not had any success there yet. The information for that post is at the bottom of this post.

下面是今天早上一个失败的例子。所有我跑下面的命令是从,我想从发送邮件的EC2实例中运行。很抱歉的新尺寸后,我只是想确保我有一切。

Here is an example of a failure from this morning. All of the commands I ran below were run from the EC2 instance that I am trying to send mail from. Sorry for the novel-sized post, I just want to make sure I include everything.

我给自己的电子邮件没有被交付:

An email I sent to myself was not being delivered:

Jun 25 06:16:36 intranet01 postfix/smtp18832: 9E00C230DA: to=<myemailaddress>, relay=none, delay=150, delays=0.02/0.01/150/0, dsn=4.4.1, status=deferred (connect to email-smtp.us-east-1.amazonaws.comhttp://107.22.187.122:25: Connection timed out)

当我看到我试图连接到电子邮件主机通过端口25。我无法连接的故障:

And when I seen the failure I tried connecting to the email host over port 25. I could not connect:

root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25  
Trying 174.129.28.151...  
^C

几分钟后,我的递延电子邮件终于经历了:

A few minutes later my deferred email finally went through:

Jun 25 06:23:14 intranet01 postfix/smtp18861: 9E00C230DA: to=<myemailaddress>, relay=email-smtp.us-east-1.amazonaws.comhttp://184.73.218.23:25, delay=548, delays=548/0.02/0.21/0.36, dsn=2.0.0, status=sent (250 Ok 0000013823cf7441-83710873-e946-4c80-8a54-0dd72bae6f30-000000)
Jun 25 06:23:14 intranet01 postfix/qmgr3972: 9E00C230DA: removed

现在我可以连接到端口25:

And now I can connect to port 25:

root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25  
Trying 107.20.152.208...  
Connected to email-smtp.us-east-1.amazonaws.com.  
Escape character is '^]'.  
220 email-smtp.amazonaws.com ESMTP SimpleEmailService-222567251  
^]

有关踢,我决定去看看SES主机端点。事实证明,这只是一个ELB CNAME,与指向多个AZ的接口A记录。

For kicks, I decided to look at the SES host endpoint. It turns out it is just an ELB cname, with A records that point to interfaces in multiple AZ's.

root@intranet01 sbin# dig email-smtp.us-east-1.amazonaws.com  

; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.17.amzn1 <<>> email-smtp.us-east-1.amazonaws.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8592
;; flags: qr rd ra; QUERY: 1, ANSWER: 9, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:  
;email-smtp.us-east-1.amazonaws.com. IN A  

;; ANSWER SECTION:  
email-smtp.us-east-1.amazonaws.com. 54 IN CNAME ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com.  
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com. 60 IN A 174.129.200.82  
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com. 60 IN A 184.73.219.75  
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com. 60 IN A 107.20.152.208  
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com. 60 IN A 107.20.160.81  
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com. 60 IN A 107.20.203.50  
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com. 60 IN A 107.22.229.233 
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com. 60 IN A 174.129.6.189  
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com. 60 IN A 174.129.28.151

我试图发送另一条消息,它失败了。这一次,我通过每一个A记录的循环解决了SES的cname返回。我无法连接到任何人。在此期间,我还试图从我的本地机器(不是我的EC2实例)连接,和它的工作就好了。

I tried sending another message and it failed. This time I looped through each of the A record addresses that the SES cname returned. I could not connect to any of them. During this time I also tried connecting from my local machine (not my EC2 instance), and it worked just fine.

root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 174.129.28.151...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 174.129.6.189...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 107.22.229.233...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 107.20.203.50...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 107.20.160.81...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 107.20.152.208...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 184.73.219.75...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 174.129.200.82...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 174.129.28.151...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 174.129.6.189...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 107.22.229.233...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 107.20.203.50...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 107.20.179.13...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 107.20.160.81...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 184.73.219.75...
^C
root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 174.129.200.82...
^C

等待大约30秒钟后,我又试了一次,这一次它的工作。

After waiting around 30 seconds I tried again, this time it worked.

root@intranet01 sbin# telnet email-smtp.us-east-1.amazonaws.com 25
Trying 174.129.28.151...
Connected to email-smtp.us-east-1.amazonaws.com.
Escape character is '^]'.
220 email-smtp.amazonaws.com ESMTP SimpleEmailService-222567251
^C^[
^]

telnet>

正如我先前所说,我贴在AWS SES论坛一个非常类似的帖子。该职位可以在下面找到。

As I stated earlier, I posted a very similar post on the AWS SES forum. The post can be found below.

<一个href="https://forums.aws.amazon.com/thread.jspa?threadID=97736&tstart=0">https://forums.aws.amazon.com/thread.jspa?threadID=97736&tstart=0

此外,看来我并不孤单,因为我发现在SES论坛这等后,貌似同样的问题。

Also, it appears that I am not alone, as I found this other post on the SES forum, looks like the same problem.

<一个href="https://forums.aws.amazon.com/thread.jspa?threadID=91260&tstart=0">https://forums.aws.amazon.com/thread.jspa?threadID=91260&tstart=0

我想可能有某种EC2 SMTP限制,因此我填写了发送电子邮件,从EC2申请表,但因为我使用亚马逊的服务,而不是第三方,似乎傻了我。到目前为止,我填写表格后没有听到任何来自亚马逊回来了。

I thought there might be some sort of EC2 SMTP limitation, so I filled out the "sending email from EC2" request form, but it seems silly to me since I am using Amazon's service, as opposed to a 3rd party. So far I have not heard anything back from Amazon after filling out the form.

有没有人有什么想法?先谢谢了。

Does anyone have any ideas? Thanks in advance.

推荐答案

所以显然EC2有它自身的局限性。我以为(错误地)认为其生产获得SES也将意味着从EC2宽松的SMTP的限制,但它们是两个完全不同的产品我想这是不是这样的。

So apparently EC2 has it's own limits. I assumed (incorrectly) that having production access to SES would also mean relaxed SMTP limitations from EC2, but as they are two completely separate products I guess that is not the case.

不过,正如我在帖子的最后一段说,你可以<一href="https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request">Request删除电子邮件发送限制来纷纷上调这些限制。我这样做,问题停止(他们花了5个小时左右,让我的极限删除)。

But as I stated in the last paragraph of my post, you can Request to Remove Email Sending Limitations to have these limits raised. I did that and the problem stopped (it took them around 5 hours to get my limits removed).

在EC2节流记录在连接到亚马逊SES SMTP端点实际上限制为端口25,这样的替代,并立即解决的简单使用端口587,而不是(这有点不幸的是,一些官员SES示例使用端口25确实):

The EC2 throttling is documented in Connecting to the Amazon SES SMTP Endpoint and actually constrained to port 25, so an alternative and immediate solution is simply using port 587 instead (it's a bit unfortunate that several official SES examples are using port 25 indeed):

重要

弹性计算云(EC2)节流电子邮件流量通过端口25   默认。为了避免超时通过SMTP发送电子邮件时,   端点从EC2,使用不同的端口(587或2587),或填写一份   <一href="https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request">Request删除电子邮件发送限制以消除油门。

Elastic Compute Cloud (EC2) throttles email traffic over port 25 by default. To avoid timeouts when sending email through the SMTP endpoint from EC2, use a different port (587 or 2587) or fill out a Request to Remove Email Sending Limitations to remove the throttle.

要注意的是这可能是稍微过时的为好,只要两个 AWS管理控制台和部分的Amazon 指的是较为常见的备用端口465和587 SES SMTP问题只是:

Beware that this might be slightly outdated as well, insofar both the AWS Management Console and section Amazon SES SMTP Issues are referring to the more common alternative ports 465 and 587 only:

您是从Amazon EC2实例通过端口25发送到亚马逊SES,你不能达到你的亚马逊SES发送限制或者您   接收超时 - 亚马逊SES EC2规定默认发送限制   在邮件通过25端口发送和节流出站连接,如果你   试图超出这些限制。为了消除这些限制,提交   <一href="https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request">Request删除电子邮件发送限制。您还可以连接   亚马逊SES通过端口465或端口587,这两者都不是节流。

You are sending to Amazon SES from an Amazon EC2 instance via port 25 and you cannot reach your Amazon SES sending limits or you are receiving time outs — Amazon SES EC2 imposes default sending limits on email sent via port 25 and throttles outbound connections if you attempt to exceed those limits. To remove these limits, submit a Request to Remove Email Sending Limitations. You can also connect to Amazon SES via port 465 or port 587, neither of which is throttled.

这篇关于亚马逊EC2 / SES SMTP超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆