From e5eaaacb607e073d31e78c8ac0cf259744a38e06 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 18 Jul 2025 13:33:27 -0700 Subject: [PATCH] email: Start servers during re-setup if they are not running - This helps during distribution upgrade from dovecot 2.3 to 2.4. Dovecot will stop running due to dovecot server 2.4 not understanding version 2.3 configuration files. When setup is re-run, starting the daemons again is the right thing to do. Tests: - With email app installed, upgrade from bookworm to trixie. Dovecot is stopped during distribution upgrade but after freedombox service runs, it recovers and starts running again. Signed-off-by: Sunil Mohan Adapa --- plinth/modules/email/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plinth/modules/email/__init__.py b/plinth/modules/email/__init__.py index 8f2f13b14..721976d98 100644 --- a/plinth/modules/email/__init__.py +++ b/plinth/modules/email/__init__.py @@ -222,9 +222,10 @@ class EmailApp(plinth.app.App): privileged.setup_spam() # Restart daemons - service_privileged.try_restart('postfix') - service_privileged.try_restart('dovecot') - service_privileged.try_restart('rspamd') + if self.is_enabled(): + service_privileged.restart('postfix') + service_privileged.restart('dovecot') + service_privileged.restart('rspamd') # Expose to public internet if old_version == 0: