From abfeafa026088898bca97cebc42a6cefd14f80dc Mon Sep 17 00:00:00 2001 From: Alexandra Stone <144961922+alexcmatm@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:07:57 -0700 Subject: [PATCH] Add gmail relay handling for emails This change adds ehlo and starttls when the server hostname is smtp-relay.gmail.com and authentication is disabled. Just sending the message and quitting isn't enough for gmail specifically. --- api/tacticalrmm/core/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/tacticalrmm/core/models.py b/api/tacticalrmm/core/models.py index 8139b700..61052fe3 100644 --- a/api/tacticalrmm/core/models.py +++ b/api/tacticalrmm/core/models.py @@ -221,6 +221,12 @@ class CoreSettings(BaseAuditModel): ) server.send_message(msg) server.quit() + if self.smtp_host == "smtp-relay.gmail.com" and not self.smtp_requires_auth: + # gmail smtp relay specific handling. + server.ehlo() + server.starttls() + server.send_message(msg) + server.quit() else: # smtp relay. no auth required server.send_message(msg)