我一直负责设置在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完成了以下操作来validationSTARTTLS:
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与日志中的许多其他中继/交换服务器build立连接(这些例子不止这些):
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用于外发电子邮件时,这怎么可能? 至less它根据上面的日志看起来是这样的(TLS连接build立)。
我的问题是,为什么我在上面的例子中没有看到与Gmail服务器或服务器build立的这些TLS连接? 我仍然收到通过这个中继服务器收到的Gmail上的红色小挂锁,表示它没有被encryption。 我的一些邮件被延期,因为它说连接不是TLSencryption的?
如何validationTLS是否正常工作,并且所有外发电子邮件正在使用TLS进行encryption以接受TLS协议?
任何人的帮助,不胜感激。
最好的祝福
编辑:
openssl s_client -connect localhost:25 -starttls smtp STARTTLS 554 5.5.1 Error: TLS already active
给我没有错误关于我的证书。
Gmail和Outlook的电子邮件标题也不显示TLSencryption。
我很茫然…
我将你的Postfixconfiguration与一个工作configuration进行了比较,注意到你的configuration缺lesssmtp_use_tls = yes 。
根据这个postfix邮件列表文章 ,smtp_ *条目作为发件人适用于您的SMTP服务器,而以smtp d _ *开头的条目作为收件人适用于您的SMTP服务器。 看来你的问题只限于你的SMTP服务器作为发件人 。
我还发现这个Postfix文档 ,其中指出smtp_use_tls默认设置为“no”。
所以我会build议设置smtp_use_tls = yes ,看看是否有任何事情。 如果没有,也许其他smtp_ *设置可能是问题。
编辑: smtp_use_tls应在新版本的Postfix的smtp_tls_security_level重写。 我注意到你没有提到你的Postfix版本,但是这可能只会在2.3以前的时候有帮助。