[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
This commit is contained in:
parent
9aad1c52c4
commit
2b3f5db9da
1 changed files with 3 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue