Clean up output
This commit is contained in:
parent
da79194e87
commit
23cd165d2d
@ -30,13 +30,16 @@ for account in accounts:
|
|||||||
resp_code, messages = imap_ssl.search(None, 'UnSeen')
|
resp_code, messages = imap_ssl.search(None, 'UnSeen')
|
||||||
if resp_code == 'OK':
|
if resp_code == 'OK':
|
||||||
if len(messages[0].split()) > 0:
|
if len(messages[0].split()) > 0:
|
||||||
print('True')
|
#print('True')
|
||||||
print(messages[0].split())
|
#print(messages[0].split())
|
||||||
print(len(messages[0].split()))
|
unread_messages = len(messages[0].split())
|
||||||
else:
|
else:
|
||||||
print('False')
|
print('False')
|
||||||
|
|
||||||
############### Logout of Mailbox ######################
|
############### Logout of Mailbox ######################
|
||||||
print("\nLogging Out....")
|
print("\nLogging Out....")
|
||||||
|
|
||||||
imap_ssl.close()
|
imap_ssl.close()
|
||||||
|
if unread_messages:
|
||||||
|
message = f"{account} has {unread_messages} messages."
|
||||||
|
print(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user