Update tests/test_utils_sendmail.py
Run CI Tests / test (push) Successful in 53s

This commit is contained in:
2025-07-31 13:28:09 +02:00
parent 470a1bccd1
commit dc2bc76678
+8 -1
View File
@@ -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"