Hi!
I’m kinda new to Home Assistant, but I’m slowly get things working. I’ve managed to debug most, but this has me totally stumped. I have looked at a few issues around SMTP, but I can’t seem to find one that mirrors this…
I managed to get it working last week, for a few great days, but then it stopped! I think it was due to some router-level updates I made - the issues started some time shortly after a few small updates.
- I have a modem that feeds into a router - all my home things sit behind the second router. I did make a change where I connected this second router to VPN, meaning that the server sits behind the VPN.
- I noticed some unknown ports being forwarded on my stock modem, so I factory reset it. I’m not really a “port forwarding person”, so I don’t think I would have changed too much on here.
- I added some additional things to the config file - just to get the correct “latitude” etc, as the VPN was causing it to be picked up incorrectly.
At some point after the above, it seemed like the system stopped sending emails.
I have emailed separately from the account (without HA) and it works, so I don’t believe it’s an issue with the VPN, but I suppose it could be…
Can anyone help???
CONFIG:
notify:
- platform: smtp
name: alert_test
server: smtp.gmail.com
timeout: 15
port: 587
encryption: starttls
sender: xxx
sender_name: xxx
starttls: 1
username: xxx
password: xxx
recipient:
- xxx
The error I get is definitely related to the setup of the SMTP, but I don’t know exactly what the issue is.
Error setting up platform smtp
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 78, in async_setup_platform
platform.get_service, hass, p_config, discovery_info
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 84, in get_service
if mail_service.connection_is_valid():
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 138, in connection_is_valid
server = self.connect()
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 124, in connect
mail = smtplib.SMTP(self._server, self._port, timeout=self._timeout)
File "/usr/local/lib/python3.7/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/local/lib/python3.7/smtplib.py", line 336, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/local/lib/python3.7/smtplib.py", line 307, in _get_socket
self.source_address)
File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection
raise err
File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network unreachable