Postfix - 无法从mail()php函数发送邮件

时间:2017-09-26 13:48:59

标签: php email postfix

我有简单的postfix + dovecot配置,当我使用Outlook(SMTP AUTH + IMAP)时一切正常。问题是当我尝试通过localhost上的mail()函数发送电子邮件时。收件人收到:

Diagnostic-Code:    smtp; 575 email@email sender requires authentication

我的配置文件如下:

unknown_local_recipient_reject_code = 550
mynetworks_style = host
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
myorigin = domain.bg


smtpd_use_tls=yes
smtpd_tls_cert_file = /etc/letsencrypt/live/domain/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/domain/privkey.pem

smtp_use_tls = yes
fallback_relay = 
smtpd_tls_security_level = may

和master.cf

smtp      inet  n       -       n       -       -       smtpd
submission inet n       -       n       -       -       smtpd
# -o smtpd_tls_security_level=may
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       n       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING

0 个答案:

没有答案