From 4d49f182ec11b37ec41d339951121ca6696d813f Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Tue, 19 Aug 2025 17:26:33 +0200 Subject: [PATCH] Make sure amavis can still be installed --- run.py | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/run.py b/run.py index 7bb2d70..5d0aa3a 100755 --- a/run.py +++ b/run.py @@ -3,12 +3,9 @@ """An installer for Modoboa.""" import argparse +import configparser import datetime import os -try: - import configparser -except ImportError: - import ConfigParser as configparser import sys from modoboa_installer import checks @@ -29,7 +26,6 @@ PRIMARY_APPS = [ "radicale", "uwsgi", "nginx", - "rspamd", "postfix", "dovecot" ] @@ -200,6 +196,10 @@ def main(input_args): config.set("modoboa", "version", args.version) config.set("modoboa", "install_beta", str(args.beta)) + PRIMARY_APPS.append( + "amavis" if config.get("antispam", "type") == "amavis" else "rspamd" + ) + if args.backup or args.silent_backup: backup_system(config, args) return @@ -251,36 +251,30 @@ def main(input_args): f"Congratulations! You can enjoy Modoboa at https://{hostname} " "(admin:password)" ) - if config.get("rspamd", "enabled"): - rspamd_password = config.get("rspamd", "password") - utils.success( - f"You can also enjoy rspamd at https://{hostname}/rspamd " - f"(password: {rspamd_password})" - ) else: utils.success( f"Restore complete! You can enjoy Modoboa at https://{hostname} " "(same credentials as before)" ) - if config.get("rspamd", "enabled"): - rspamd_password = config.get("rspamd", "password") - utils.success( - f"You can also enjoy rspamd at https://{hostname}/rspamd " - "(password: {rspamd_password})" - ) + if config.getboolean("rspamd", "enabled"): + rspamd_password = config.get("rspamd", "password") + utils.success( + f"You can also enjoy rspamd at https://{hostname}/rspamd " + f"(password: {rspamd_password})" + ) utils.success( "\n" "Modoboa is a free software maintained by volunteers.\n" "You like the project and want it to be sustainable?\n" "Then don't wait anymore and go sponsor it here:\n" - ) + ) utils.printcolor( "https://github.com/sponsors/modoboa\n", utils.YELLOW - ) + ) utils.success( "Thank you for your help :-)\n" - ) + ) if __name__ == "__main__":