Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#print "UID searched with: "+ command + ", got result "+repr(search_status)+" and found "+repr(search_result)
email_ids = search_result[0].split()
if len(email_ids):
print "Processing messages from IMAP: %d "% (len(email_ids))
for email_id in email_ids:
self.import_email(email_id)
if self.status != ReaderStatus.READING:
break
else:
print "No IMAP messages to process"
self.successful_read()
self.set_status(ReaderStatus.PAUSED)
except IMAP4.abort as e:
raise IrrecoverableError(e)
except IMAP4.error as e:
raise ClientError(e)