我一直在尝试在 Ubuntu 16.04 上使用 postfix 和 dovecot 设置仅发送 SMTP 服务器。我遇到的问题是,当我尝试发送电子邮件时,我会收到回复。
4.7.0 TLS 因本地问题不可用
所以我猜问题出在我的 postfix TLS 设置中。如果我检查 postfix 服务的状态
9 月 19 日 15:03:15 mail.example.org postfix[3571]: /usr/sbin/postconf: 警告:/etc/postfix/main.cf:未使用的参数:smtpd_tls_session_cache_header=yes 9 月 19 日 15:03:15 mail.example.org postfix[3571]: /usr/sbin/postconf: 警告:/etc/postfix/main.cf:未使用的参数:smtpd_tls_note_starttls_offer=yes 9 月 19 日 15:03:15 mail.example.org postfix[3571]: /usr/sbin/postconf: 警告:/etc/postfix/main.cf:未使用的参数:smtpd_tls_recieved_header=yes
所以我猜想这与这些设置有关。但我不明白它们到底出了什么问题,我尝试删除这些行,但错误仍然出现。
Postfix 配置:
mydomain = branelmail.dk
myhostname = mail.branelmail.dk
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = /dev/null
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
debug_peer_level = 2
# TLS parameters
smtpd_use_tls = yes
smtpd_tls_cert_file=/etc/ssl/certs/mail.branelmail.dk.pem
smtpd_tls_key_file=/etc/ssl/private/mail.branelmail.dk.key
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# You can use log level 3 or 4 for more advanced troubleshooting
smtpd_tls_loglevel = 4
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
relayhost =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
#smtpd_tls_note_starttls_offer = yes
#smtpd_tls_recieved_header = yes
#smtpd_tls_session_cache_header = yes
tls_random_source = dev:/dev/urandom
答案1
好吧,我找到了一个解决方案,看来我们生成的证书有问题,在线购买证书后,它就可以正常工作了。因此,如果有人遇到同样的问题,只需确保您使用的证书已正确设置即可。