Zero was not being counted. This fixes that
This commit is contained in:
parent
1d0e7089fd
commit
d704f9c7e8
@ -30,7 +30,7 @@ client = influxdb_client.InfluxDBClient(
|
|||||||
for account in accounts:
|
for account in accounts:
|
||||||
with imaplib.IMAP4_SSL(host="imap.gmail.com", port=imaplib.IMAP4_SSL_PORT) as imap_ssl:
|
with imaplib.IMAP4_SSL(host="imap.gmail.com", port=imaplib.IMAP4_SSL_PORT) as imap_ssl:
|
||||||
print("Connection Object : {}".format(imap_ssl))
|
print("Connection Object : {}".format(imap_ssl))
|
||||||
print("Logging into mailbox...")
|
print(f"Logging into mailbox {account}...")
|
||||||
try:
|
try:
|
||||||
resp_code, response = imap_ssl.login(account, accounts[account])
|
resp_code, response = imap_ssl.login(account, accounts[account])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -52,10 +52,10 @@ for account in accounts:
|
|||||||
unread_messages = 0
|
unread_messages = 0
|
||||||
|
|
||||||
############### Logout of Mailbox ######################
|
############### Logout of Mailbox ######################
|
||||||
print("\nLogging Out....")
|
print(f"\nLogging Out of {account}....")
|
||||||
|
|
||||||
imap_ssl.close()
|
imap_ssl.close()
|
||||||
if unread_messages:
|
if unread_messages is not None:
|
||||||
message = f"{account} has {unread_messages} messages."
|
message = f"{account} has {unread_messages} messages."
|
||||||
date = strftime("%Y-%m-%d")
|
date = strftime("%Y-%m-%d")
|
||||||
time = strftime("%H:%M:%S")
|
time = strftime("%H:%M:%S")
|
||||||
|
Loading…
Reference in New Issue
Block a user