Postfix启用发送到互联网的任何域与authentication,但没有SSL

当我尝试通过SMTP和Postfix发送邮件时,出现“5.7.1无法中继”错误。

改变了大量的configuration后,它工作我发送电子邮件到服务器相同的域(到该主机上的其他帐户):

smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination 

但是,我仍然发送到其他域时,这个错误。 Dovecot安装在我的服务器上。

如何允许中继到任何域,但在端口25 SMTP简单的身份validation? 没有SSL / TLS等


如果我将我用作testing收件人的域添加到我的目的地:

 mydestination = o2.pl 

我有:

 Recipient address rejected: User unknown in local recipient table 

没有mydestinationconfiguration的示例日志:

 Oct 6 00:50:40 XXXXXXX postfix/smtpd[5409]: NOQUEUE: reject: RCPT from MY_HOME_HOST: 554 5.7.1 <[email protected]>: Relay access denied; from=<TEST_ACCOUN@MY_DOMAIN.pl> to=<[email protected]> proto=ESMTP helo=<[127.0.0.1]> 

去除后:

 reject_unauth_destination 

当我尝试发送电子邮件时,雷鸟只是在等待。 它挂在“连接到MY_OWN_DOMAIN …”

我将TLS切换到“否”,但没有帮助。 当我telnet到本地主机上的端口25,我没有从SMTP的欢迎消息

可能是因为:

  "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit 

但是当我添加“check_relay_domains”时,我收到了来自thunderbird的错误,该SMTP服务器发送破坏的欢迎信息。

最后我得到新的错误:

 Recipient address rejected: Relay access denied. 

我的整个main.cf:

 smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) 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 smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit smtpd_sender_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit #smtpd_client_restrictions = permit smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks check_relay_domains smtpd_data_restrictions = reject_unauth_pipelining # TLS parameters smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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 # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = MY_OWN_DOMAIN.pl alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = MY_OWN_DOMAIN.pl relay_domains = $mydomain mydestinations = $mydomain, $myhostname, localhost, localhost.localdomain relayhost = inet_interfaces = all mynetworks_style = host home_mailbox = Maildir/ #mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all 

这看起来不像一个SSL问题,而不像身份validation问题。 如果Postfix将您识别为授权发件人,那么它不应该在谈论中继。 您的SMTP客户端是否configuration为对服务器进行身份validation? 如果不是这样,请重新设置,然后重试。


还有一件事 :你已经在你的smtpd_recipient_restrictions获得了permit_sasl_authenticated ,但是在main.cf中没有看到任何SASLauthenticationconfiguration – 这可能是问题;

如果Postfix希望通过SASL对您进行身份validation,但是没有SASL提供程序来进行身份validation,则会像其他任何未经身份validation的用户那样对待您。 一个完整的解决scheme超出了这个答案的范围,但我build议从Postfix SASL howto开始,这在设置我自己的Postfix服务器时帮助很大。