无法从 Cloud9 盒子连接到 AWS SMTP
我有一个脚本尝试通过连接到 AWS 和 AWS 的 SMTP 服务器来发送电子邮件。发送电子邮件(它没有使用 SDK - 我最初没有编写它)。我有 2 个 Cloud9 盒子。其中 1 个盒子 (A) 可以连接到 SMTP &用SES发送邮件就可以了。另一个邮箱 (B) 根本无法连接到 SMTP & telnet
将会超时。
这些盒子位于不同的 VPC 中。框 A 位于沙盒 VPC 中框 B 位于生产 VPC 中。两个盒子都位于公共子网中。框 A 的路由表为:
&框 B 的路由表为:
区别在于本地 IP 被路由到不同范围的私有 IP后一个路由表具有对等连接。
两个盒子都有一个默认的 Cloud9 SG,允许所有出站 IPv4 流量和 IPv4 流量。仅 SSH 流量传入。
在框 A 中执行 nslookup
的结果是:
< img src="https://i.sstatic.net/aUSOv.png" alt="在此处输入图像描述">
&框 B 是:
所以我不确定为什么 Box A 将 SMTP 解析为公共 IP,而 Box B 将其解析为私有 IP
I have a script that is trying to send an email by connecting to the SMTP server of AWS & sending an email (it is not using the SDK - I didn't write it initially). I have 2 Cloud9 boxes. 1 of these boxes (A) can connect to the SMTP & send emails with SES just fine. The other box (B) cannot connect to the SMTP at all & will timeout with a telnet
.
These boxes are in different VPCs. Box A is in a Sandbox VPC & Box B is in the Production VPC. Both boxes are in public subnets. The routing table for Box A is:
& the routing table for Box B is:
The difference being that local is routed to a different range of private IPs & that the latter route table has a peering connection.
Both boxes have a default Cloud9 SG which is to allow all outbound IPv4 traffic & only SSH traffic in.
The result of doing an nslookup
in Box A is:
& Box B is:
So I am not sure why Box A resolves the SMTP to a public IP but Box B resolves it to be a private IP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能在 Box B 的 VPC 中配置了 SES 专用终端节点。如果是这样,请确保您仔细阅读本文档,特别是确保终端节点的安全组允许足够的访问https://docs.aws.amazon.com/ses/latest/dg/send-email-set-up-vpc-endpoints.html
You may have an SES private endpoint configured in the Box B's VPC. If so, make sure that you read this doc carefully, and especially ensure that the endpoint's security group is allowing adequate access https://docs.aws.amazon.com/ses/latest/dg/send-email-set-up-vpc-endpoints.html