Commit 7cec45b4 authored by Joshua Tauberer's avatar Joshua Tauberer

tools/mail.py should not list archived mailboxes

broken by b30d7ad8 when the API began to list both real users and archived mailboxes in the JSON response
parent e0dc8ff0
...@@ -67,6 +67,7 @@ elif sys.argv[1] == "user" and len(sys.argv) == 2: ...@@ -67,6 +67,7 @@ elif sys.argv[1] == "user" and len(sys.argv) == 2:
# Dump a list of users, one per line. Mark admins with an asterisk. # Dump a list of users, one per line. Mark admins with an asterisk.
users = mgmt("/mail/users?format=json", is_json=True) users = mgmt("/mail/users?format=json", is_json=True)
for user in users: for user in users:
if user['status'] == 'inactive': continue
print(user['email'], end='') print(user['email'], end='')
if "admin" in user['privileges']: if "admin" in user['privileges']:
print("*", end='') print("*", end='')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment