mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Do not fail smtp notify service on connection error (#27240)
* smtp notify dont disable service * auth fails smtp notify service
This commit is contained in:
parent
50b5dba43e
commit
15870e0185
@ -136,16 +136,15 @@ class MailNotificationService(BaseNotificationService):
|
|||||||
server = None
|
server = None
|
||||||
try:
|
try:
|
||||||
server = self.connect()
|
server = self.connect()
|
||||||
except smtplib.socket.gaierror:
|
except (smtplib.socket.gaierror, ConnectionRefusedError):
|
||||||
_LOGGER.exception(
|
_LOGGER.exception(
|
||||||
"SMTP server not found (%s:%s). "
|
"SMTP server not found or refused connection (%s:%s). "
|
||||||
"Please check the IP address or hostname of your SMTP server",
|
"Please check the IP address, hostname, and availability of your SMTP server.",
|
||||||
self._server,
|
self._server,
|
||||||
self._port,
|
self._port,
|
||||||
)
|
)
|
||||||
return False
|
|
||||||
|
|
||||||
except (smtplib.SMTPAuthenticationError, ConnectionRefusedError):
|
except smtplib.SMTPAuthenticationError:
|
||||||
_LOGGER.exception(
|
_LOGGER.exception(
|
||||||
"Login not possible. "
|
"Login not possible. "
|
||||||
"Please check your setting and/or your credentials"
|
"Please check your setting and/or your credentials"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user