使用Exim4获取中继不允许错误

时间:2019-06-28 13:45:19

标签: django smtp exim exim4

我当前遇到以下错误:

2019/06/27 18:18:44 [DEBUG] plugin: waiting for all plugin processes to complete…
Error: Error refreshing state: 1 error occurred:
* google_sql_database_instance.loadtest-db: 1 error occurred:
2019-06-27T18:18:44.876-0400 [DEBUG] plugin.terraform-provider-google_v1.20.0_x4: 2019/06/27 18:18:44 [ERR] plugin: plugin server: accept unix /var/folders/5v/9clr5rgs3dg3y7363q9204rc0000gp/T/plugin261867312: use of closed network connection
2019-06-27T18:18:44.876-0400 [DEBUG] plugin.terraform-provider-google-beta_v1.20.0_x4: 2019/06/27 18:18:44 [ERR] plugin: plugin server: accept unix /var/folders/5v/9clr5rgs3dg3y7363q9204rc0000gp/T/plugin356238661: use of closed network connection
* google_sql_database_instance.loadtest-db: google_sql_database_instance.loadtest-db: Error reading SQL Database Instance “lt20190627”: googleapi: Error 403: Cloud SQL Admin API has not been used in project 563584335869 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/sqladmin.googleapis.com/overview?project=563584335869 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured

我的update-exim4.conf.conf如下所示:

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

当我运行echo 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' 时,我收到一封电子邮件,使我相信配置很好,但是,当我尝试通过托管在同一台服务器上的django应用发送电子邮件时,以上错误。我的应用程序配置如下:

"Subject: sendmail test" | sendmail -v example@exmple.com

应用程序日志中的错误如下:

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

我的应用程序也恰好被码头化了!

1 个答案:

答案 0 :(得分:0)

将我的配置更新如下:

dc_eximconfig_configtype='smarthost'
dc_other_hostnames='example.com;'
dc_local_interfaces=''
dc_readhost=''
dc_relay_domains='*'
dc_minimaldns='false'
dc_relay_nets='170.17.0.0/16' #allow docker
dc_smarthost='your.smtp.server'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'

然后在我的env.py中

EMAIL_HOST = "172.17.0.1" #docker bridge

这允许中继传入的电子邮件。