我目前正在尝试在 RHEL 上设置 postfix 作为我们内部票务系统的 SMTP 中继。
基本配置运行正常;邮件被发送和接收。我们确实更改了一些标头以保护我们的内部网络,但仅此而已。
Trying 10.71.17.107...
Connected to mail-gw.doma.in.
Escape character is '?'.
220 mail-gw.doma.in ESMTP Postfix
STARTTLS
220 2.0.0 Ready to start TLS
Run Code Online (Sandbox Code Playgroud)
类似地,我可以向 GMail 服务器请求 STARTTLS,所以我认为防火墙不是问题:
Trying 108.177.15.26...
Connected to gmail-smtp-in.l.google.com.
Escape character is '?'.
220 **************************************************
EHLO mail-gw.doma.in
250-mx.google.com at your service, [91.198.93.107]
250-STARTTLS
STARTTLS
220 2.0.0 Ready to start TLS
Run Code Online (Sandbox Code Playgroud)
我已经为这个 mail-gw 获得了一个免费的 SSL 证书,它似乎是有效的。但是,每当我将消息转发到 GMail 时,它都会显示该消息尚未加密。
这是我的master.cf
smtp inet n - n - - smtpd -v
submission inet n - n - - smtpd -v
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_recipient=no
Run Code Online (Sandbox Code Playgroud)
这是我的 main.cf
smtp_sasl_auth_enable = no
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwords
smtp_tls_CAfile = /etc/pki/tls/certs/mail-gw_doma_in.ca-bundle
smtp_tls_cert_file = /etc/pki/tls/certs/mail-gw_doma_in.crt
smtp_tls_key_file = /etc/pki/tls/private/prv.key
smtp_tls_loglevel = 1
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtpd_cache
smtp_use_tls = yes
smtpd_tls_CAfile = /etc/pki/tls/certs/mail-gw_doma_in.ca-bundle
smtpd_tls_cert_file = /etc/pki/tls/certs/mail-gw_doma_in.crt
smtpd_tls_key_file = /etc/pki/tls/private/prv.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
Run Code Online (Sandbox Code Playgroud)
我完全没有想法,特别是因为互联网上的所有解决方案都是 smtp_tls_security_level = may。
任何帮助,将不胜感激。
e:根据评论,这是我与 Google 的连接日志。
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: < gmail-smtp-in.l.google.com[173.194.76.27]:25: 220 **************************************************
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: name_mask: disable_esmtp
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: name_mask: delay_dotcrlf
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: 14ED21038196: enabling PIX workarounds: disable_esmtp delay_dotcrlf for gmail-smtp-in.l.google.com[173.194.76.27]:25
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: > gmail-smtp-in.l.google.com[173.194.76.27]:25: HELO mail-gw.doma.in
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: < gmail-smtp-in.l.google.com[173.194.76.27]:25: 250 mx.google.com at your service
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: server features: 0x31000 size 0
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: smtp_stream_setup: maxtime=300 enable_deadline=0
Nov 15 07:06:44 atdc1-proxy01 postfix/smtp[26878]: > gmail-smtp-in.l.google.com[173.194.76.27]:25: MAIL FROM:<dct_test_it@doma.in>
Run Code Online (Sandbox Code Playgroud)
应该是这样吗?当我调试传入连接时,我看到我的服务器使用所有 SMTP 选项(包括 STARTTLS)进行响应?更令人困惑的是,因为 telnet 到 google 主机还为我提供了 STARTTLS。
我终于找到了解决方案。由于某种原因 - 我不确定如何 - 我的 Postfix 认为我们的防火墙正在执行 SMTP 检查,并启用了 PIX 解决方法“disable_esmtp”
因此,我的 Postfix 仅启动了与 HELO 的连接,并且没有获得 STARTTLS 的选项。
解决方案:在 main.cf 中,仅启用其他解决方法。为了简洁起见,我现在这样做:
smtp_pix_workarounds = delay_dotcrlf
Run Code Online (Sandbox Code Playgroud)
我很难相信我还没有发现任何有关此事的信息。
| 归档时间: |
|
| 查看次数: |
2653 次 |
| 最近记录: |