diff --git a/management/cli.py b/management/cli.py index 4f7a273c..b45e912f 100755 --- a/management/cli.py +++ b/management/cli.py @@ -60,7 +60,6 @@ def setup_key_auth(mgmt_uri): if len(sys.argv) < 2: print("""Usage: - {cli} system default-quota [new default] (set default quota for system) {cli} user (lists users) {cli} user add user@domain.com [password] {cli} user password user@domain.com [password] @@ -152,12 +151,6 @@ elif sys.argv[1] == "alias" and sys.argv[2] == "add" and len(sys.argv) == 5: elif sys.argv[1] == "alias" and sys.argv[2] == "remove" and len(sys.argv) == 4: print(mgmt("/mail/aliases/remove", { "address": sys.argv[3] })) -elif sys.argv[1] == "system" and sys.argv[2] == "default-quota" and len(sys.argv) == 3: - print(mgmt("/system/default-quota?text=1")) - -elif sys.argv[1] == "system" and sys.argv[2] == "default-quota" and len(sys.argv) == 4: - print(mgmt("/system/default-quota", { "default_quota": sys.argv[3]})) - else: print("Invalid command-line arguments.") sys.exit(1) diff --git a/management/daemon.py b/management/daemon.py index e850e6c6..2ad8c480 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -21,7 +21,7 @@ import auth, utils from mailconfig import get_mail_users, get_mail_users_ex, get_admins, add_mail_user, set_mail_password, remove_mail_user from mailconfig import get_mail_user_privileges, add_remove_mail_user_privilege from mailconfig import get_mail_aliases, get_mail_aliases_ex, get_mail_domains, add_mail_alias, remove_mail_alias -from mailconfig import get_mail_quota, set_mail_quota, get_default_quota, validate_quota +from mailconfig import get_mail_quota, set_mail_quota from mfa import get_public_mfa_state, provision_totp, validate_totp_secret, enable_mfa, disable_mfa import contextlib @@ -192,7 +192,7 @@ def mail_users(): @app.route('/mail/users/add', methods=['POST']) @authorized_personnel_only def mail_users_add(): - quota = request.form.get('quota', get_default_quota(env)) + quota = request.form.get('quota', '0') try: return add_mail_user(request.form.get('email', ''), request.form.get('password', ''), request.form.get('privileges', ''), quota, env) except ValueError as e: @@ -675,29 +675,6 @@ def privacy_status_set(): utils.write_settings(config, env) return "OK" -@app.route('/system/default-quota', methods=["GET"]) -@authorized_personnel_only -def default_quota_get(): - if request.values.get('text'): - return get_default_quota(env) - else: - return json_response({ - "default-quota": get_default_quota(env), - }) - -@app.route('/system/default-quota', methods=["POST"]) -@authorized_personnel_only -def default_quota_set(): - config = utils.load_settings(env) - try: - config["default-quota"] = validate_quota(request.values.get('default_quota')) - utils.write_settings(config, env) - - except ValueError as e: - return ("ERROR: %s" % str(e), 400) - - return "OK" - # MUNIN @app.route('/munin/') diff --git a/management/mailconfig.py b/management/mailconfig.py index ae366310..2f44bf25 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -344,7 +344,7 @@ def add_mail_user(email, pw, privs, quota, env): if validation: return validation if quota is None: - quota = get_default_quota() + quota = '0' try: quota = validate_quota(quota) @@ -429,10 +429,6 @@ def dovecot_quota_recalc(email): # force dovecot to recalculate the quota info for the user. subprocess.call(["doveadm", "quota", "recalc", "-u", email]) -def get_default_quota(env): - config = utils.load_settings(env) - return config.get("default-quota", '0') - def validate_quota(quota): # validate quota quota = quota.strip().upper() diff --git a/management/templates/users.html b/management/templates/users.html index da04fcc9..e46b8391 100644 --- a/management/templates/users.html +++ b/management/templates/users.html @@ -30,7 +30,7 @@
- +
@@ -165,15 +165,6 @@ curl -X POST -d "email=new_user@mydomail.com" https://{{hostname}}/admin/mail/us