SMTP(postfix)和 iPhone - 无法发送电子邮件 - 拒绝:RCPT

SMTP(postfix)和 iPhone - 无法发送电子邮件 - 拒绝:RCPT

我已经尝试设置电子邮件服务器两天了,当我在 PC 上使用 roundcube 时,一切都运行正常,我可以发送和接收电子邮件,但当我想在 iPhone 上设置电子邮件时,问题就开始了。我可以接收电子邮件,但不能发送任何电子邮件。

Dec 25 15:44:16 servername postfix/smtpd[17833]: Anonymous TLS connection established from unknown[120.218.*.*]: TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)
Dec 25 15:44:16 servername postfix/smtpd[17833]: NOQUEUE: reject: RCPT from unknown[120.218.*.*]: 454 4.7.1 <[email protected]>: Relay access denied; from=<myEmail> to=<[email protected]> proto=ESMTP helo=<[192.168.1.104]>
Dec 25 15:44:17 kaka90 postfix/smtpd[17833]: disconnect from unknown[120.218.*.*]

我在 ubuntu 上使用 SSL/TLS、postfix+debian 运行它。Postfix 没有身份验证。这是我的 main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no

readme_directory = no

smtpd_tls_cert_file = /etc/ssl/domain/2_domain.crt
smtpd_tls_key_file =  /etc/ssl/startssl/myserver.key
smtpd_tls_CAfile = /etc/ssl/domain/1_root_bundle.crt
smtpd_use_tls=yes
smtp_use_tls=yes
smtpd_tls_auth_only = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level = may
smtp_tls_security_level = may
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_mandatory_ciphers = high
tls_high_cipherlist=EDH+CAMELLIA(****)
smtpd_tls_loglevel = 1
smtp_tls_loglevel = 1
smtpd_tls_received_header = yes
broken_sasl_auth_clients = yes
smtpd_delay_reject = yes

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options=noanonymous
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination, permit_mynetworks check_relay_domains

myhostname = domain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = domain
mydestination = domain, localhost.domain, localhost
relayhost =
mynetworks = 127.0.0.0/8 192.168.0.0/16 [::ffff:127.0.0.0]/104 [::1]/128
#mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

答案1

您可能在服务器上使用 Roundcube,并且 localhost 默认被授权发送邮件。您的 iPhone 来自外部 IP,并且它可能会随时间定期更改 IP,因此您不能简单地授权该 IP 发送邮件。您需要使用登录名/密码向 postfix 验证自己的身份,才能获得发送邮件的授权,就像您向 dovecot 验证自己的身份,才能获得阅读邮件的授权一样。

Postfix 似乎已设置为允许此操作 (smtpd_recipient_restrictions = permit_sasl_authenticated),但您是否已将 iPhone 配置为在发送邮件时使用与阅读邮件时相同的登录名/密码进行连接?如果您尚未这样做,您可能还想告诉它连接到提交端口 (587) 而不是 smtp 端口 (25)。

相关内容