Parcourir la source

[Fix] Retry on Authentication error by Gmail, if emails are pulled from/pushed to server too frequently (#2090)

* [Fix] Authentication error is raised by Gmail, if emails are pulled from/pushed to server too frequently

* [Fix] Minor Fix
version-14
Shreyas Patil il y a 8 ans
committed by Rushabh Mehta
Parent
révision
4e4f5b2d53
1 fichiers modifiés avec 2 ajouts et 5 suppressions
  1. +2
    -5
      frappe/email/smtp.py

+ 2
- 5
frappe/email/smtp.py Voir le fichier

@@ -34,16 +34,14 @@ def send(email, append_to=None, retry=1):
except smtplib.SMTPRecipientsRefused: except smtplib.SMTPRecipientsRefused:
frappe.msgprint(_("Invalid recipient address"), title='Email Failed') frappe.msgprint(_("Invalid recipient address"), title='Email Failed')
raise raise
except smtplib.SMTPServerDisconnected:
except (smtplib.SMTPServerDisconnected, smtplib.SMTPAuthenticationError):
if not retry: if not retry:
raise raise
else: else:
retry = retry - 1 retry = retry - 1
_send(retry) _send(retry)


_send(retry)


_send(retry)


def get_outgoing_email_account(raise_exception_not_set=True, append_to=None): def get_outgoing_email_account(raise_exception_not_set=True, append_to=None):
"""Returns outgoing email account based on `append_to` or the default """Returns outgoing email account based on `append_to` or the default
@@ -207,4 +205,3 @@ class SMTPServer:
except smtplib.SMTPException: except smtplib.SMTPException:
frappe.msgprint(_('Unable to send emails at this time')) frappe.msgprint(_('Unable to send emails at this time'))
raise raise


Chargement…
Annuler
Enregistrer