无法从 Cloud9 盒子连接到 AWS SMTP

发布于 2025-01-15 03:40:18 字数 1135 浏览 1 评论 0原文

我有一个脚本尝试通过连接到 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:

enter image description here

& the routing table for Box B is:

enter image description here

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:

enter image description here

& Box B is:

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海不蓝 2025-01-22 03:40:18

您可能在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文