首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在后缀中从输出端口25切换到587

问如何在后缀中从输出端口25切换到587
EN

Server Fault用户
提问于 2023-04-09 22:47:16
回答 1查看 136关注 0票数 0

我想寄一封邮件到gmail地址:

代码语言:javascript
复制
echo "This is the body of the email" | mail -s "This is the subject line" user@gmail.com

这就是我在日志里看到的

代码语言:javascript
复制
connect to gmail-smtp-in.l.google.com[142.250.27.27]:25: Connection refused
connect to gmail-smtp-in.l.google.com[2a00:1450:4025:401::1a]:25: Network is unreachable
connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4025:c03::1a]:25: Network is unreachable
connect to alt1.gmail-smtp-in.l.google.com[142.251.9.27]:25: Connection refused
connect to alt2.gmail-smtp-in.l.google.com[142.250.150.27]:25: Connection refused
Apr  9 20:04:02 ubuntu postfix/smtp[157056]: 228717CAA0: to=, relay=none, delay=0.22, delays=0.09/0.09/0.04/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[142.250.150.27]:25: Connection refused)

尝试用netcat测试这个目的地,结果是相同的:

代码语言:javascript
复制
ubuntu@ubuntu:~$ nc -zvn 142.251.9.27 25
nc: connect to 142.251.9.27 port 25 (tcp) failed: Connection refused

然后,我使用以下命令检查了端口587 --该命令进行了检查:

代码语言:javascript
复制
ubuntu@ubuntu:~$ openssl s_client -connect smtp.gmail.com:587 -starttls smtp
CONNECTED(00000003)
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1
verify return:1
depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
verify return:1
depth=0 CN = smtp.gmail.com
verify return:1

因此,我试图根据这强制后缀使用加密,因此修改了main.cf:

代码语言:javascript
复制
smtpd_tls_security_level=encrypt
smtp_tls_security_level=encrypt

但仍试图使用被封锁的端口25。所以我的问题是,我怎样才能强迫postfix使用与25不同的端口来发送发送出去的邮件?

EN

回答 1

Server Fault用户

发布于 2023-04-09 22:56:48

但仍试图使用被封锁的端口25。所以我的问题是,我怎样才能强迫postfix使用与25不同的端口来发送发送出去的邮件?

你不能这么做。

或者,你可以强迫后缀这样做。但世界其他地区预计电子邮件将通过25港发送。使用端口587将不起作用--这适用于来自客户端软件的身份验证提交(提示:端口名为该端口)。SMTP服务器到SMTP服务器通信不适用。

你必须告诉你的ISP打开端口25。任何业务的ISP都应该满足这样的要求。

票数 3
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1128310

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档