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"