我将我的网络服务器设置为使用 postfix 作为智能服务器发送电子邮件,并且它不允许我网络上的任何其他计算机通过它发送邮件。我已经能够从我的网络服务器发送电子邮件到我喜欢的任何地址,并且仍然可以这样工作。
但我想改变 postfix 拒绝本地 LAN 上所有客户端的事实。我希望我的台式电脑能够通过我的网络服务器发送电子邮件,但我无法绕过这些日志消息:
Aug 13 21:58:01 localserver postfix/smtpd[21838]: connect from diablo[2001:980:1b7f:1:d568:1d76:bc9a:e356]
Aug 13 21:58:05 localserver postfix/smtpd[21838]: disconnect from diablo[2001:980:1b7f:1:d568:1d76:bc9a:e356]
我尝试将 IPv6 地址添加到mynetworks
main.cf 中的行,但这并不能解决问题。
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = localserver.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = some.server.nl., localserver.local, localhost.local, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sender_restrictions = reject_unknown_sender_domain
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -n -m "${EXTENSION}"
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_auth_only = yes
tls_random_source = dev:/dev/urandom
有人提示/提示吗?
答案1
在我的生产邮件服务器上工作得很好,但 Postfix似乎想要 IPv6 地址上的网络掩码。例如:
[2001:980:1b7f:1:d568:1d76:bc9a:e356]/128
或者,因为当您阅读本文时,您的隐私地址可能会发生变化:
[2001:980:1b7f:1::]/64
答案2
中列出的 IPv6 地址mynetworks
与错误提到的地址不匹配。所以可能就是这样。
尽管我不鼓励使用mynetworks
.相反,移至permit_sasl_authenticated
最高位置smtpd_recipient_restrictions
并通过经过身份验证的 SMTP 发送。然后您可以从任何 IP(v4 或 v6)发送。