ubuntu – Postfix:验证是否正确建立了所有传出TLS连接

我的任务是设置在Ubuntu上运行的Postfix服务器.电子邮件通过我的中继发送,一切似乎都很好,除了我似乎无法让TLS与Gmail或其他邮件客户端一起工作.例如,请参阅main.cf文件的TLS输出
# TLS parameters

smtpd_tls_cert_file=/etc/ssl/certs/company.com.crt
smtpd_tls_key_file=/etc/ssl/private/company.com.key
smtpd_tls_CAfile=/etc/ssl/certs/gd_bundle.crt
smtp_tls_CApath=/etc/ssl/certs
smtpd_use_tls=yes
smtpd_tls_auth_only=yes
smtpd_tls_security_level=may
smtp_tls_security_level=may
smtp_tls_loglevel=1
smtpd_tls_loglevel=1
smtp_tls_note_starttls_offer=yes
smtpd_tls_session_cache_database=btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database=btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

我通过Telnet完成了以下操作来验证STARTTLS:

Connected to localhost.
Escape character is '^]'.
220 prod-email.company.local ESMTP Postfix (Ubuntu)
EHLO localhost
250-prod-email.company.local
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 SMTPUTF8
STARTTLS
220 2.0.0 Ready to start TLS

我还看到TLS与日志中的许多其他中继/交换服务器建立连接(除了这些示例之外还有很多):

Nov  2 11:08:58 prod-email postfix/smtp[7864]: Trusted TLS connection established to mx2-us1.ppe-hosted.com[67.231.154.163]:25: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Nov  2 11:22:23 prod-email postfix/smtp[8672]: Trusted TLS connection established to mail.relaissanmaurizio.it[194.209.228.112]:25: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Nov  2 11:22:25 prod-email postfix/smtp[8689]: Trusted TLS connection established to mail.relaissanmaurizio.it[194.209.228.112]:25: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Nov  2 11:31:06 prod-email postfix/smtp[8676]: Trusted TLS connection established to mx1-us1.ppe-hosted.com[148.163.129.50]:25: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Nov  2 11:51:13 prod-email postfix/smtp[9165]: Trusted TLS connection established to mail.relaissanmaurizio.it[194.209.228.112]:25: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Nov  2 11:51:15 prod-email postfix/smtp[9229]: Trusted TLS connection established to mail.relaissanmaurizio.it[194.209.228.112]:25: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)

我也在/var/log/mail.log中看到特定客户的这些奇怪日志:

454 4.7.0 Connection is not TLS encrypted. Recipient organization requires TLS.

当看起来我提供TLS用于外发电子邮件时,这怎么可能?至少它根据上面的日志(TLS连接建立)看起来这样.

我的问题是,为什么我在上面的示例中看不到与Gmail服务器或服务器建立的这些TLS连接?我仍然收到通过这个中继服务器发送的收到的Gmails上的小红色挂锁,说它没有被加密.我的一些邮件被推迟,因为它说连接不是TLS加密的?

如何验证TLS是否正常工作以及是否所有外发电子邮件都使用TLS加密到接受TLS协议的电子邮件

非常感谢任何人的帮助.

最好的祝福

编辑:

openssl s_client -connect localhost:25 -starttls smtp

 STARTTLS
 554 5.5.1 Error: TLS already active

我的证书没有错误.

Gmail和Outlook的电子邮件标头也不显示TLS加密.

我很茫然…

更新:我只是试图通过更新正在使用的证书(通配符证书在12月到期)来实现这一点,并且TLS仍然无法正常工作.请帮忙.

更新:我还尝试强制使用TLS for gmail并收到以下错误

TLS is required,but was not offered by host alt1.gmail-smtp-in.l.google.com[74.125.192.27]

为什么google不提供TLS?我很迷惑…

你坐在防火墙后面吗?

如果是,请检查您是否使用ESMTP检查规则.从global_policy中删除此规则可能会有所帮助.

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...