docker-smtp icon indicating copy to clipboard operation
docker-smtp copied to clipboard

trouble with sending emails

Open TigenTigen opened this issue 6 years ago • 5 comments

Hello, not sure to write it here, but I can't solve the problem by myself, so... I used this docker image to run as single smtp server for web app via docker-compose. Compose configuration: smtp: image: namshi/smtp:latest networks: - nginx_ext_network environment: MAILNAME: 'mailer' restart: always ports: - "25:25" But then the web app require to send an email, smtp server tries to do it, but fails. I tried it multiple times. With different ports. With different emails. Nothing works. Can you help me? Maybe some problem with my configuration? Or maybe you've seen this before?

Logs: `

  • 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 [email protected] 275 T: remote_smtp for [email protected] 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 == [email protected] 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 [email protected] 278 T: remote_smtp for [email protected] 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 == [email protected] R=dnslookup T=remote_smtp defer (-18) H=mx.yandex.ru [77.88.21.89]: Remote host closed connection in response to initial connection

`

TigenTigen avatar Aug 17 '19 17:08 TigenTigen

Same

vesamet avatar Nov 14 '19 02:11 vesamet

I have the same issue. My SMTP service in docker-compose.yml goes as follows:

  smtp:
    image: namshi/smtp
    restart: always
    ports:
      - '25:25'
    volumes:
      - ./:/web
    environment: 
      - KEY_PATH=/web/config/ssl_keys/privkey.pem
      - CERTIFICATE_PATH=/web/config/ssl_keys/fullchain.pem

with ./ also being used by Django and Celery. I'm trying to send email through Django, here's my settings.py:

EMAIL_HOST = 'smtp'
EMAIL_PORT = '25'
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'noreply@localhost'

I'm trying to send a password reset email through saving a PasswordResetForm (how it's done by a default implementation, had to make my own for reasons).

Someone help?

ArtyIF avatar Apr 18 '20 20:04 ArtyIF

Same issue. Any idea ?

roseyda avatar Sep 16 '20 07:09 roseyda

turns out i needed to add a couple DNS records (MX, DMARC, SPF and DKIM)

ArtyIF avatar Sep 16 '20 11:09 ArtyIF

turns out i needed to add a couple DNS records (MX, DMARC, SPF and DKIM)

Could you please elaborate a bit more for us newbies? :-)

fredericoschardong avatar Nov 07 '21 03:11 fredericoschardong