I’ve been using Hassbian and am trying to migrate to Hass.io however my SMTP notifications are failing in Hass.io (but work fine in Hassbian).
I’ve done a bit of testing and it seems that when I’m using Hass.io and attach images to my notifications, once the sum of all attachments approaches ~100kb then i get the below error.
This does not happen with “Hassbian 0.59.2” and I can attach a large number of images without issues but occurs on every version of Hass.io I’ve tried including the latest “Hass.io 0.61.1”
Any help would be greatly appreciated. This is stopping me from moving to Hass.io
2018-01-20 23:07:29 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall notify.email_notification: title=<homeassistant.helpers.template.Template object at 0x6d807630>, message=<homeassistant.helpers.template.Template object at 0x6d807330>, data=images=['/config/cbr.jpg', '/config/mbr.jpg', '/config/lr.jpg']>
Traceback (most recent call last):
File "/usr/lib/python3.6/smtplib.py", line 354, in send
self.sock.sendall(s)
File "/usr/lib/python3.6/ssl.py", line 972, in sendall
v = self.send(byte_view[count:])
File "/usr/lib/python3.6/ssl.py", line 941, in send
return self._sslobj.write(data)
File "/usr/lib/python3.6/ssl.py", line 642, in write
return self._sslobj.write(data)
socket.timeout: The write operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/components/notify/smtp.py", line 178, in _send_email
mail.sendmail(self._sender, self.recipients, msg.as_string())
File "/usr/lib/python3.6/smtplib.py", line 882, in sendmail
(code, resp) = self.data(msg)
File "/usr/lib/python3.6/smtplib.py", line 568, in data
self.send(q)
File "/usr/lib/python3.6/smtplib.py", line 357, in send
raise SMTPServerDisconnected('Server not connected')
smtplib.SMTPServerDisconnected: Server not connected
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1010, in _event_to_service_call
yield from service_handler.func(service_call)
File "/usr/lib/python3.6/site-packages/homeassistant/components/notify/__init__.py", line 137, in async_notify_message
yield from notify_service.async_send_message(**kwargs)
File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
future.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/notify/smtp.py", line 171, in send_message
return self._send_email(msg)
File "/usr/lib/python3.6/site-packages/homeassistant/components/notify/smtp.py", line 183, in _send_email
mail.quit()
File "/usr/lib/python3.6/smtplib.py", line 983, in quit
res = self.docmd("quit")
File "/usr/lib/python3.6/smtplib.py", line 420, in docmd
self.putcmd(cmd, args)
File "/usr/lib/python3.6/smtplib.py", line 367, in putcmd
self.send(str)
File "/usr/lib/python3.6/smtplib.py", line 359, in send
raise SMTPServerDisconnected('please run connect() first')
smtplib.SMTPServerDisconnected: please run connect() first
The script that is being executed is as below:
email_script:
sequence:
- alias: Send Email
service: notify.Email_Notification
data:
title: 'HASS Configuration File TEST5'
message: 'Sent by Home Assistant, {{now().strftime("%A %H:%M:%S %d-%m-%Y")}}'
data:
images:
- /config/cbr.jpg
- /config/mbr.jpg
- /config/lr.jpg