admin-scripts/count_emails.py

15 lines
293 B
Python
Raw Normal View History

2021-05-18 11:16:37 +02:00
#!/usr/bin/python3
import api_requests as api
ENDPOINT = 'get/mailbox/all'
emails_count = 0
try:
for user in api.mailcow(ENDPOINT):
emails_count += user["messages"]
except TypeError:
print("Mailcow : What is your IP address ?")
print("Emails count : " + str(emails_count))