PortChecker Logo
PortChecker

端口 465 — SMTPS (TCP)

SMTPS

什么是端口 465?

安全 SMTP

这是 well-known 端口(0–1023),常被 SMTPS 等核心服务使用。  ·  RFC 8314

什么情况下需要开放端口 465?

Open on mail submission servers accepting client email via implicit TLS. Needed if users send email through your mail server. Port 587 (STARTTLS) is the modern preferred alternative.

常见用途与软件

  • Postfix (implicit TLS)
  • Gmail SMTP relay
  • Microsoft 365 SMTP relay
  • SendGrid
  • Mailgun

安全

Port 465 with implicit TLS is inherently more secure than STARTTLS on port 587 because TLS is mandatory from connection start — there is no plain-text upgrade handshake that can be intercepted. Ensure valid TLS certificates and strong cipher suites. Authentication is required; never allow unauthenticated relay.

端口 465 安全吗?

开放端口会增加攻击面。安全性取决于 SMTPS 的配置。

中风险

保持 SMTPS 及时更新安全补丁。要求强身份验证并将访问限制为最低必要的 IP 地址。

立即检查端口 465

测试任意主机的端口 465 连通性。

1-65535

开放端口 465

要允许到端口 465 (SMTPS) 的入站连接,请配置防火墙并在路由器上添加端口转发规则,指向设备的本地 IP 地址。

Windows 防火墙

打开 Windows Defender 防火墙 → 高级设置 → 入站规则 → 新建规则 → 端口 → TCP → 特定本地端口: 465 → 允许连接 → 命名并保存规则。

netsh advfirewall firewall add rule name="Open Port 465" dir=in action=allow protocol=tcp localport=465
Linux (UFW / iptables)sudo ufw allow 465/tcpsudo iptables -A INPUT -p tcp --dport 465 -j ACCEPT
路由器

登录路由器(192.168.1.1 或 192.168.0.1)→ 端口转发 → 添加新规则: 协议 TCP, 外部端口 465, 内部 IP: 设备的本地 IP, 内部端口 465 → 保存。

如何关闭端口 465

若不需要 SMTPS,请在防火墙或路由器中阻止该端口。

Windows 防火墙

要在 Windows 上屏蔽端口 465,请以管理员身份在 PowerShell 或命令提示符中运行以下命令:

netsh advfirewall firewall add rule name="Block Port 465" dir=in action=block protocol=tcp localport=465
Linux (UFW / iptables)执行:sudo ufw deny 465/tcpsudo iptables -A INPUT -p tcp --dport 465 -j DROP
路由器

删除或禁用端口 465 的端口转发规则。

常见问题

端口 465 用于什么?▾

465 端口是 SMTPS 的标准 TCP 端口。它被需要接受该服务入站连接的服务器和应用程序所使用。是否需要开放取决于您是否在运行 SMTPS 服务器——如果没有,应保持关闭。

保持端口 465 打开安全吗?▾

开放的 465 端口会扩大攻击面。如果您没有主动运行 SMTPS,请在防火墙中关闭此端口并删除端口转发规则。如果 SMTPS 需要可访问,请将访问限制为已知 IP 地址并保持软件更新。