From dc2bc76678da9b0d9f6769a6a5c7a4ac15e375c0 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Thu, 31 Jul 2025 13:28:09 +0200 Subject: [PATCH] Update tests/test_utils_sendmail.py --- tests/test_utils_sendmail.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_utils_sendmail.py b/tests/test_utils_sendmail.py index fbb0f3a0b..5dd48fadb 100644 --- a/tests/test_utils_sendmail.py +++ b/tests/test_utils_sendmail.py @@ -55,6 +55,13 @@ def test_sendmail_mime_format_to_file(): import subprocess +def start_postfix(): + try: + subprocess.run(["sudo", "service", "postfix", "start"], check=True) + print("✅ Postfix started") + except subprocess.CalledProcessError as e: + print("❌ Failed to start postfix:", e) + def setup_postfix(): subprocess.run("echo 'postfix postfix/mailname string localhost.localdomain' | sudo debconf-set-selections", shell=True) subprocess.run("echo 'postfix postfix/main_mailer_type string Internet Site' | sudo debconf-set-selections", shell=True) @@ -62,7 +69,7 @@ def setup_postfix(): def test_sendmail_real_local_verbose(): - + start_postfix() setup_postfix() to_addr = "yasmine.tligui@psi.ch"