We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95a4f4f commit 34707f2Copy full SHA for 34707f2
1 file changed
app/core/email_backends.py
@@ -79,6 +79,8 @@ def _authenticate_xoauth2(self) -> None:
79
if not self.username:
80
raise SMTPAuthenticationError(530, b"EMAIL_HOST_USER must be set to the Gmail address.")
81
82
+ # STARTTLS 이후 smtplib가 ehlo_resp를 비워두기 때문에, docmd("AUTH") 전에 EHLO를 재전송해야 503을 피할 수 있다.
83
+ self.connection.ehlo_or_helo_if_needed()
84
auth_payload = f"user={self.username}\x01auth=Bearer {self._access_token}\x01\x01"
85
auth_payload = f"XOAUTH2 {b64encode(auth_payload.encode()).decode()}"
86
code, response = self.connection.docmd("AUTH", auth_payload)
0 commit comments