我目前收到以下错误:
2019-06-28 14:45:41 no host name found for IP address 192.168.X.X
2019-06-28 14:45:41 H=(cabc5b9f0d80) [192.168.X.X] F=<noreply@X.X.X.X> rejected RCPT <example@exmple.com>: relay not permitted
我的 update-exim4.conf.conf 如下所示:
dc_eximconfig_configtype='smarthost'
dc_other_hostnames='example.com; localhost.localdomain; localhost'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost='example.com'
dc_relay_domains='*'
dc_minimaldns='false'
dc_relay_nets='smtpserver.url'
dc_smarthost='example.com'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
当我运行 echo"Subject: sendmail test" | sendmail -v example@exmple.com
时,我收到一封电子邮件,这使我相信配置很好,但是,当我尝试通过托管在同一台服务器上的 django 应用程序发送电子邮件时,我收到了上述错误。我的应用程序配置如下所示:
EMAIL_HOST = "example.com"
EMAIL_PORT = 25
EMAIL_NAME = "exmaple"
EMAIL_ALIAS = "noreply@X.X.X.X"
EMAIL_HOST_USER = ""
EMAIL_HOST_PASSWORD = ""
EMAIL_USE_TLS = False
EMAIL_BATCH_SIZE = 50
EMAIL_BATCH_PAUSE = 300
应用程序日志中的错误如下:
Task scheduler.tasks.workflow_send_email[740b2e55-896e-4a75-9e19-4fa5562783e2] raised unexpected: SMTPRecipientsRefused({'example@example.com': (550, b'relay not permitted')},)
...
smtplib.SMTPRecipientsRefused: {'example@example.com': (550, b'relay not permitted')}
我的应用程序也恰好被码头化了!