我的 Postfix 设置不会接收来自本地主机(sendmail)以外任何地方的电子邮件。
我可以从我的服务器登录并发送电子邮件,但没有任何消息发送。
这是我的 postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
disable_vrfy_command = yes
inet_interfaces = all
mailbox_size_limit = 0
message_size_limit = 0
mydestination =
mydomain = dangersalad.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = host
myorigin = /etc/mailname
readme_directory = no
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject
smtpd_tls_cert_file = /etc/ssl/private/mail.mydomain.com.crt
smtpd_tls_key_file = /etc/ssl/private/mail.mydomain.com.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/maps/alias.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_domains = mysql:/etc/postfix/maps/domain.cf
virtual_mailbox_limit = 0
virtual_mailbox_maps = mysql:/etc/postfix/maps/user.cf
virtual_uid_maps = static:5000
这是日志中的错误
Jan 9 19:14:06 mail postfix/smtpd[2389]: connect from mail-ie0-f171.google.com[209.85.223.171]
Jan 9 19:14:07 mail postfix/smtpd[2389]: NOQUEUE: reject: RCPT from mail-ie0-f171.google.com[209.85.223.171]: 554 5.7.1 <[email protected]>: Sender address rejected: Access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-ie0-f171.google.com>
Jan 9 19:14:07 mail postfix/smtpd[2389]: disconnect from mail-ie0-f171.google.com[209.85.223.171]
有什么建议吗?
答案1
这种行为是由以下线条创建的
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject
和
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
不要(重复不)直接删除reject
!
我建议不要运行任何可公开访问的邮件服务器,除非您已经拥有管理这些庞然大物的经验。在您的网络中运行它,使用小型虚拟化结构来感受陷阱,然后读。
例如,一个很好的来源是Ubuntu 服务器指南