我已經在幾個在線指南中設置了postfix和dovecot,並始終存在我發送的電子郵件不會被加密的問題。 我一直在通過發送電子郵件到我的@ gmail.com帳戶來測試設置,因爲我確信谷歌服務器將支持TLS加密,並且Gmail郵件webmail中的電子郵件清楚地顯示紅色劃掉的掛鎖以顯示它們未加密。如何在postfix中加密外發電子郵件
如果我設置
smtpd_tls_security_level = encrypt
smtp_tls_security_level = encrypt
我得到這個錯誤
TLS is required, but was not offered by host gmail-smtp-in.l.google.com[64.233.167.27]
如果我將它設置爲可發送電子郵件,而無需對其進行加密。
這是postconf的輸出-n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_command =
mailbox_size_limit = 0
mydestination = $myhostname, localdomain, localhost, localhost.localdomain, localhost, mail.example.com, example.com
myhostname = mail.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = subnet
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_tls_CAfile = /routeto/my.ca-bundle
smtp_tls_cert_file = /routeto/my.crt
smtp_tls_key_file = /routeto/my.key
smtp_tls_loglevel = 1
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_client_hostname
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = example.com
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /routeto/my.ca-bundle
smtpd_tls_cert_file = /routeto/my.crt
smtpd_tls_key_file = /routeto/my.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
,這是一個遠程登錄的輸出端口25上,接着EHLO測試
250-mail.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
和在端口587
同樣的事情250-mail.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
服務器是運行全新安裝的Ubuntu 16.04的VPS,我相信它沒有運行任何防火牆,所以我不知道下一步該怎麼做。 –
我發佈的telnet輸出實際上是我自己的服務器,但現在你已經說過了,從我自己的測試Gmail服務器更合理,你是完全正確的,這是我的服務器的谷歌服務器測試 '250-mx.google.com爲您服務,250-SIZE 157286400 250-8BITMIME 250-ENHANCEDSTATUSCODES 250 SMTPUTF8' 並且這與我自己的筆記本電腦相同'250-SIZE 157286400 250-8BITMIME 250-STARTTLS 250- ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8' STARTTLS未提供給我的服務器... –
@DuncanConnolly:攔截防火牆通常不在本地系統上,即防火牆在網絡中的其他地方,但在真正的服務器的路徑。 –