Make sure amavis can still be installed

This commit is contained in:
Antoine Nguyen
2025-08-19 17:26:33 +02:00
parent a9ae8c50ad
commit 4d49f182ec

34
run.py
View File

@@ -3,12 +3,9 @@
"""An installer for Modoboa.""" """An installer for Modoboa."""
import argparse import argparse
import configparser
import datetime import datetime
import os import os
try:
import configparser
except ImportError:
import ConfigParser as configparser
import sys import sys
from modoboa_installer import checks from modoboa_installer import checks
@@ -29,7 +26,6 @@ PRIMARY_APPS = [
"radicale", "radicale",
"uwsgi", "uwsgi",
"nginx", "nginx",
"rspamd",
"postfix", "postfix",
"dovecot" "dovecot"
] ]
@@ -200,6 +196,10 @@ def main(input_args):
config.set("modoboa", "version", args.version) config.set("modoboa", "version", args.version)
config.set("modoboa", "install_beta", str(args.beta)) 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: if args.backup or args.silent_backup:
backup_system(config, args) backup_system(config, args)
return return
@@ -251,36 +251,30 @@ def main(input_args):
f"Congratulations! You can enjoy Modoboa at https://{hostname} " f"Congratulations! You can enjoy Modoboa at https://{hostname} "
"(admin:password)" "(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: else:
utils.success( utils.success(
f"Restore complete! You can enjoy Modoboa at https://{hostname} " f"Restore complete! You can enjoy Modoboa at https://{hostname} "
"(same credentials as before)" "(same credentials as before)"
) )
if config.get("rspamd", "enabled"): if config.getboolean("rspamd", "enabled"):
rspamd_password = config.get("rspamd", "password") rspamd_password = config.get("rspamd", "password")
utils.success( utils.success(
f"You can also enjoy rspamd at https://{hostname}/rspamd " f"You can also enjoy rspamd at https://{hostname}/rspamd "
"(password: {rspamd_password})" f"(password: {rspamd_password})"
) )
utils.success( utils.success(
"\n" "\n"
"Modoboa is a free software maintained by volunteers.\n" "Modoboa is a free software maintained by volunteers.\n"
"You like the project and want it to be sustainable?\n" "You like the project and want it to be sustainable?\n"
"Then don't wait anymore and go sponsor it here:\n" "Then don't wait anymore and go sponsor it here:\n"
) )
utils.printcolor( utils.printcolor(
"https://github.com/sponsors/modoboa\n", "https://github.com/sponsors/modoboa\n",
utils.YELLOW utils.YELLOW
) )
utils.success( utils.success(
"Thank you for your help :-)\n" "Thank you for your help :-)\n"
) )
if __name__ == "__main__": if __name__ == "__main__":