Browse 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 8 years ago
committed by Rushabh Mehta
parent
commit
4e4f5b2d53
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      frappe/email/smtp.py

+ 2
- 5
frappe/email/smtp.py View File

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

_send(retry)


_send(retry)

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


Loading…
Cancel
Save