我创建了一组 docker 容器来运行 Web 应用程序(pyhton/django)。一个,如果他们是 smtp-server:
smtp:
image: namshi/smtp:latest
networks:
- nginx_ext_network
environment:
MAILNAME: 'mailer'
restart: always
ports:
- "25:25"
Run Code Online (Sandbox Code Playgroud)
但是 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: …
Run Code Online (Sandbox Code Playgroud)