From 2b3f5db9da1721d031ebaf3c19ac997cc14308a2 Mon Sep 17 00:00:00 2001 From: robert schouten Date: Mon, 27 Feb 2017 14:39:46 +0800 Subject: [PATCH] [hotfix] comply with imap and pop auth failed response (#2712) * [hotfix] comply with imap and pop auth failed response * simplified hotfix for imap and pop auth response --- frappe/email/doctype/email_account/email_account.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/email/doctype/email_account/email_account.py b/frappe/email/doctype/email_account/email_account.py index 7e04c8f609..0f9f736bea 100755 --- a/frappe/email/doctype/email_account/email_account.py +++ b/frappe/email/doctype/email_account/email_account.py @@ -123,7 +123,9 @@ class EmailAccount(Document): try: email_server.connect() except (error_proto, imaplib.IMAP4.error), e: - if in_receive and ("authentication failed" in e.message.lower() or "log in via your web browser" in e.message.lower()): + message = e.message.lower().replace(" ","") + if in_receive and any(map(lambda t: t in message, ['authenticationfail', 'loginviayourwebbrowser', #abbreviated to work with both failure and failed + 'loginfailed', 'err[auth]', 'errtemporaryerror'])): #temporary error to deal with godaddy # if called via self.receive and it leads to authentication error, disable incoming # and send email to system manager self.handle_incoming_connect_error(