SMTP Docker容器不发送电子邮件

时间:2019-08-17 18:07:04

标签: docker smtp

我创建了一组Docker容器来运行Web应用程序(pyhton / django)。一个如果他们是smtp服务器:

smtp:
    image: namshi/smtp:latest
    networks:
      - nginx_ext_network
    environment:
      MAILNAME: 'mailer'
    restart: always
    ports:
      - "25:25"

但是随后Web应用程序要求发送电子邮件,smtp服务器尝试执行此操作,但是失败。 我尝试了多次。具有不同的端口。用不同的电子邮件。什么都没有。

smtp容器的日志:

+ sed -ri '
    s/^#?(dc_local_interfaces)=.*/\1='\''[0.0.0.0]:25 ; [::0]:25'\''/;
    s/^#?(dc_other_hostnames)=.*/\1='\'''\''/;
    s/^#?(dc_relay_nets)=.*/\1='\''172.19.0.2\/16'\''/;
    s/^#?(dc_eximconfig_configtype)=.*/\1='\''internet'\''/;
' /etc/exim4/update-exim4.conf.conf
+ update-exim4.conf -v
using non-split configuration scheme from /etc/exim4/exim4.conf.template
    1 LOG: MAIN
    1   exim 4.89 daemon started: pid=1, -q15m, listening for SMTP on port 25 (IPv6 and IPv4)
  273 LOG: MAIN
  273   <= webmaster@localhost H=mailer_apache_1.mailer_nginx_ext_network (83d1331a44cb) [172.19.0.3] P=esmtp S=2162 id=156606357503.34.13723816267095054951@83d1331a44cb
  273 LOG: smtp_connection MAIN
  273   SMTP connection from mailer_apache_1.mailer_nginx_ext_network (83d1331a44cb) [172.19.0.3] closed by QUIT
  274 Exim version 4.89 uid=101 gid=101 pid=274 D=40001
Berkeley DB: Berkeley DB 5.3.28: (September  9, 2013)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM DNSSEC Event OCSP PRDR SOCKS TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
  274 delivering 1hz2fv-00004P-1K
  274 R: dnslookup for djangomailape@gmail.com
  275 T: remote_smtp for djangomailape@gmail.com
  275 Connecting to gmail-smtp-in.l.google.com [2a00:1450:4010:c08::1a]:25 ... failed: Cannot assign requested address
  275 LOG: MAIN
  275   H=gmail-smtp-in.l.google.com [2a00:1450:4010:c08::1a] Cannot assign requested address
  275 Connecting to gmail-smtp-in.l.google.com [64.233.165.27]:25 ... connected
  275   SMTP(close)>>
  275 LOG: MAIN
  275   H=gmail-smtp-in.l.google.com [64.233.165.27]: Remote host closed connection in response to initial connection
  275 Connecting to alt1.gmail-smtp-in.l.google.com [2404:6800:4008:c04::1a]:25 ... failed: Cannot assign requested address
  275 LOG: MAIN
  275   H=alt1.gmail-smtp-in.l.google.com [2404:6800:4008:c04::1a] Cannot assign requested address
  275 Connecting to alt1.gmail-smtp-in.l.google.com [74.125.204.27]:25 ... connected
  275   SMTP(close)>>
  275 LOG: MAIN
  275   H=alt1.gmail-smtp-in.l.google.com [74.125.204.27]: Remote host closed connection in response to initial connection
  275 Connecting to alt2.gmail-smtp-in.l.google.com [2607:f8b0:400e:c04::1b]:25 ... failed: Cannot assign requested address
  275 LOG: MAIN
  275   H=alt2.gmail-smtp-in.l.google.com [2607:f8b0:400e:c04::1b] Cannot assign requested address
  275 Connecting to alt3.gmail-smtp-in.l.google.com [2607:f8b0:4003:c09::1b]:25 ... failed: Cannot assign requested address
  275 LOG: MAIN
  275   H=alt3.gmail-smtp-in.l.google.com [2607:f8b0:4003:c09::1b] Cannot assign requested address
  275 Connecting to alt4.gmail-smtp-in.l.google.com [2607:f8b0:4001:c16::1b]:25 ... failed: Cannot assign requested address
  275 LOG: MAIN
  275   H=alt4.gmail-smtp-in.l.google.com [2607:f8b0:4001:c16::1b] Cannot assign requested address
  274 LOG: MAIN
  274   == djangomailape@gmail.com R=dnslookup T=remote_smtp defer (99): Cannot assign requested address H=alt1.gmail-smtp-in.l.google.com [74.125.204.27]
  276 LOG: MAIN
  276   <= webmaster@localhost H=mailer_apache_1.mailer_nginx_ext_network (83d1331a44cb) [172.19.0.3] P=esmtp S=2187 id=156606361852.33.3228996691969512605@83d1331a44cb
  276 LOG: smtp_connection MAIN
  276   SMTP connection from mailer_apache_1.mailer_nginx_ext_network (83d1331a44cb) [172.19.0.3] closed by QUIT
  277 Exim version 4.89 uid=101 gid=101 pid=277 D=40001
Berkeley DB: Berkeley DB 5.3.28: (September  9, 2013)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM DNSSEC Event OCSP PRDR SOCKS TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
  277 delivering 1hz2gc-00004S-H8
  277 R: dnslookup for eleriya-25@yandex.ru
  278 T: remote_smtp for eleriya-25@yandex.ru
  278 Connecting to mx.yandex.ru [2a02:6b8::89]:25 ... failed: Cannot assign requested address
  278 LOG: MAIN
  278   H=mx.yandex.ru [2a02:6b8::89] Cannot assign requested address
  278 Connecting to mx.yandex.ru [87.250.250.89]:25 ... connected
  278   SMTP(close)>>
  278 LOG: MAIN
  278   H=mx.yandex.ru [87.250.250.89]: Remote host closed connection in response to initial connection
  278 Connecting to mx.yandex.ru [213.180.193.89]:25 ... connected
  278   SMTP(close)>>
  278 LOG: MAIN
  278   H=mx.yandex.ru [213.180.193.89]: Remote host closed connection in response to initial connection
  278 Connecting to mx.yandex.ru [213.180.204.89]:25 ... connected
  278   SMTP(close)>>
  278 LOG: MAIN
  278   H=mx.yandex.ru [213.180.204.89]: Remote host closed connection in response to initial connection
  278 Connecting to mx.yandex.ru [77.88.21.89]:25 ... connected
  278   SMTP(close)>>
  278 LOG: MAIN
  278   H=mx.yandex.ru [77.88.21.89]: Remote host closed connection in response to initial connection
  277 LOG: MAIN
  277   == eleriya-25@yandex.ru R=dnslookup T=remote_smtp defer (-18) H=mx.yandex.ru [77.88.21.89]: Remote host closed connection in response to initial connection

有什么建议吗?

0 个答案:

没有答案