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.
This commit is contained in:
parent
aa029b005f
commit
abfeafa026
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue