gdm*_*gdm 12 php postfix sendmail
我成功地在我的 VPS 上安装了 Postfix。我想发送加密的电子邮件。我安装了所有证书和私钥并设置了我的 conf 文件:
smtpd_tls_key_file = <path to my private key>
smtpd_tls_cert_file = <path to my cert file>
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination
smtpd_tls_security_level = encrypt
Run Code Online (Sandbox Code Playgroud)
但我不知道还能做什么。我的意思是,我如何检查我的电子邮件是否被加密?我使用 phpmail()函数发送外发邮件。
mas*_*oeh 23
当 postfix向其他服务器发送电子邮件时,postfix 将充当SMTP 客户端。因此,您需要参考有关 SMTP 客户端和 TLS 的相关文档。
要为 postfix SMTP 客户端激活 TLS 加密功能,您需要将此行放入 main.cf
smtp_tls_security_level = may
Run Code Online (Sandbox Code Playgroud)
它会将 postfix SMTP 客户端置于 Opportunistic-TLS 模式,即如果服务器支持 STARTTLS ESMTP 功能,则 SMTP 事务被加密。否则,消息以明文形式发送。
要查明 SMTP 交易是否加密,增加到 smtp_tls_loglevel1
smtp_tls_loglevel = 1
Run Code Online (Sandbox Code Playgroud)
使用此配置,postfix 将具有像此 SMTP 事务已加密的日志行。
postfix-2nd/smtp[66563]: Trusted TLS connection established to gmail-smtp-in.l.google.com[74.125.200.27]:25: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Run Code Online (Sandbox Code Playgroud)
完成配置文件的编辑后,请记住执行:
postfix reload
Run Code Online (Sandbox Code Playgroud)
使更改生效。
注意:您上面的配置仅涵盖 Postfix SMTP 服务器smtpd,一个用于接收电子邮件的守护进程。