Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble with sending emails #57

Open
TigenTigen opened this issue Aug 17, 2019 · 5 comments
Open

trouble with sending emails #57

TigenTigen opened this issue Aug 17, 2019 · 5 comments

Comments

@TigenTigen
Copy link

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

`

@vesamet
Copy link

vesamet commented Nov 14, 2019

Same

@ArtyIF
Copy link

ArtyIF commented Apr 18, 2020

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?

@roseyda
Copy link

roseyda commented Sep 16, 2020

Same issue.
Any idea ?

@ArtyIF
Copy link

ArtyIF commented Sep 16, 2020

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

@fredericoschardong
Copy link

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? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants