This commit is contained in:
@@ -55,6 +55,13 @@ def test_sendmail_mime_format_to_file():
|
|||||||
|
|
||||||
import subprocess
|
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():
|
def setup_postfix():
|
||||||
subprocess.run("echo 'postfix postfix/mailname string localhost.localdomain' | sudo debconf-set-selections", shell=True)
|
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)
|
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():
|
def test_sendmail_real_local_verbose():
|
||||||
|
start_postfix()
|
||||||
setup_postfix()
|
setup_postfix()
|
||||||
|
|
||||||
to_addr = "yasmine.tligui@psi.ch"
|
to_addr = "yasmine.tligui@psi.ch"
|
||||||
|
|||||||
Reference in New Issue
Block a user