From 31a915e1adc4e94334780bb94e5913ddfea1fc27 Mon Sep 17 00:00:00 2001 From: n8fr8 Date: Thu, 7 May 2026 21:17:36 -0400 Subject: [PATCH 1/2] only install madmail if selected also reinstall/config if toggled in admin --- app/routes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index 0c504bb..196e9de 100644 --- a/app/routes.py +++ b/app/routes.py @@ -270,7 +270,8 @@ def step4(): set_setting(s, setting_value) set_setting('first_setup', "false") dump_settings("settings.txt") - run_madmail_installer() + if get_setting("enable_deltachat") == "true": + run_madmail_installer() db.session.commit() return redirect(url_for('setup_complete')) if get_setting("first_setup") == "true": @@ -312,6 +313,7 @@ def admin_settings(): print(form.errors) if form.validate_on_submit(): if form.submit.data: + deltachat_newly_enabled = False for s in populate_settings: new_value = getattr(form, s).data if s in bool_settings: @@ -325,6 +327,10 @@ def admin_settings(): non_admin_settings_changed = True if s in CHANGES_REQUIRING_RESTART: app.config['SETTINGS_CHANGED'] = True + if s == 'enable_deltachat' and new_value == "true": + deltachat_newly_enabled = True + if deltachat_newly_enabled: + run_madmail_installer() new_logo = form.butterbox_logo.data if new_logo.filename: From 5b418add4d7704f3478d912d19364a84d3f68cd4 Mon Sep 17 00:00:00 2001 From: n8fr8 Date: Thu, 7 May 2026 21:17:51 -0400 Subject: [PATCH 2/2] fix install script for madmail v0.46.0 --- install_madmail.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/install_madmail.py b/install_madmail.py index 167d8fd..626bc71 100644 --- a/install_madmail.py +++ b/install_madmail.py @@ -9,7 +9,7 @@ def run_madmail_installer(): butterbox_hostname = settings["butterbox_hostname"] cmd = f"sudo ../madmail/madmail install" - child = pexpect.spawn(cmd, encoding = "utf-8")# + child = pexpect.spawnu(cmd) child.logfile = open("install_log.txt", "w") child.expect("Customize every setting") child.sendline("2") @@ -27,8 +27,8 @@ def run_madmail_installer(): child.sendline("") child.expect("TLS mode") child.sendline("self_signed") - ##child.expect("Disable TLS verification for clients") - ##child.sendline("n") + child.expect("Disable TLS") + child.sendline("y") child.expect("SMTP port") child.sendline("25") child.expect("Submission port") @@ -39,9 +39,7 @@ def run_madmail_installer(): child.sendline("143") child.expect("IMAP TLS port") child.sendline("993") - child.expect("Allow insecure") - child.sendline("n") - child.expect("Enable chatmail endpoint for user registration") + child.expect("Enable chatmail") child.sendline("y") child.expect("Chatmail HTTP port") child.sendline("8081")