3 ms·
Interesting concept. You should probably add some try/except blocks around parts of it though, specifically around this area: result, data = mail.search(None,
by albeec13 13y ago
Interesting concept. You should probably add some try/except blocks around parts of it though, specifically around this area:
result, data = mail.search(None,'(NOT BODY "BEGIN PGP MESSAGE")')
ids = data[0]
id_list = ids.split()
There's a chance "result" will indicate a failure and/or "data" will be None, causing the access to data[0] to throw an exception.
I haven't looked into what the API returns for "result" so I can't speculate on a fix, but I'm sure it should be easily handled.