diff --git a/management/cli.py b/management/cli.py index f48b889c..0708b985 100755 --- a/management/cli.py +++ b/management/cli.py @@ -18,13 +18,13 @@ import sys, getpass, urllib.request, urllib.error, json, csv import contextlib -def mgmt(cmd, data=None, is_json=False, method='GET'): +def mgmt(cmd, data=None, is_json=False): # The base URL for the management daemon. (Listens on IPv4 only.) mgmt_uri = 'http://127.0.0.1:10222' setup_key_auth(mgmt_uri) - req = urllib.request.Request(mgmt_uri + cmd, urllib.parse.urlencode(data).encode("utf8") if data else None) #, method=method) + req = urllib.request.Request(mgmt_uri + cmd, urllib.parse.urlencode(data).encode("utf8") if data else None) try: response = urllib.request.urlopen(req) except urllib.error.HTTPError as e: @@ -137,7 +137,7 @@ elif sys.argv[1] == "user" and sys.argv[2] == "quota" and len(sys.argv) == 4: elif sys.argv[1] == "user" and sys.argv[2] == "quota" and len(sys.argv) == 5: # Set a user's quota - users = mgmt("/mail/users/quota", { "email": sys.argv[3], "quota": sys.argv[4] }, method='POST') + users = mgmt("/mail/users/quota", { "email": sys.argv[3], "quota": sys.argv[4] }) elif sys.argv[1] == "user" and len(sys.argv) == 5 and sys.argv[2:4] == ["mfa", "show"]: # Show MFA status for a user. diff --git a/management/mailconfig.py b/management/mailconfig.py index d9b7d7c3..1ec17295 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -1438,12 +1438,12 @@ def remove_mail_alias(address_utf8, env, do_kick=True, auto=None, ignore_if_not_ return return_status -def add_auto_aliases(aliases, env): - conn, c = open_database(env, with_connection=True) - c.execute("DELETE FROM auto_aliases") - for source, destination in aliases.items(): - c.execute("INSERT INTO auto_aliases (source, destination) VALUES (?, ?)", (source, destination)) - conn.commit() +# def add_auto_aliases(aliases, env): +# conn, c = open_database(env, with_connection=True) +# c.execute("DELETE FROM auto_aliases") +# for source, destination in aliases.items(): +# c.execute("INSERT INTO auto_aliases (source, destination) VALUES (?, ?)", (source, destination)) +# conn.commit() def get_system_administrator(env): return "administrator@" + env['PRIMARY_HOSTNAME']