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

email alerter failed to alert #204

Open
Remanent opened this issue Apr 16, 2021 · 1 comment
Open

email alerter failed to alert #204

Remanent opened this issue Apr 16, 2021 · 1 comment

Comments

@Remanent
Copy link

Remanent commented Apr 16, 2021

discord alert works just fine, but email alerta in the same scraper does not work.

E2021-04-16 04:19:51,048 [root] email alerter failed to alert
Traceback (most recent call last):
File "/src/alerter/common.py", line 38, in call
alerter(**kwargs)
File "/src/alerter/emailer.py", line 53, in call
with smtplib.SMTP(self.relay) as s:
File "/usr/local/lib/python3.9/smtplib.py", line 255, in init
(code, msg) = self.connect(host, port)
File "/usr/local/lib/python3.9/smtplib.py", line 341, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/local/lib/python3.9/smtplib.py", line 312, in _get_socket
return socket.create_connection((host, port), timeout,
File "/usr/local/lib/python3.9/socket.py", line 843, in create_connection
raise err
File "/usr/local/lib/python3.9/socket.py", line 831, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

@EricJMarti Please look into this as email is totally broken atm.

@FiduciaryOne
Copy link

I had this error and was able to fix it by doing a few things:

  1. Finding the local address change of the docker container(s) using ifconfig. In my case it was 172.18.0.0/16 and 172.17.0.0/16
  2. Adding those IP ranges (in that format) to /etc/postfix/main.cf, in the mynetworks line. That line now looks like:
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.18.0.0/16 172.17.0.0/16
  3. Restarting postfix with "sudo systemctl restart postfix"
  4. Running the container with the relay set as my local LAN IP for my Raspberry Pi, in my case 192.168.1.X

Doing those and launching a new container with those settings, I'm successfully sending email! Not sure why sendmail/postfix didn't want to accept mail on 127.0.0.1.

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

2 participants