From 2729e542c64f637c7a7aafa0eb4dd252e6dcf9ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Tue, 12 May 2020 16:04:28 +0200 Subject: [PATCH] Fixed regexp to search for postfix config --- tests/test_email.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_email.py b/tests/test_email.py index 433efc53..81ecc114 100755 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -60,7 +60,7 @@ def check_relay(relay_host: str, relay_port: str, domain: str) -> tuple: errors = 0 # get relayhost value from Postfix config - status, out = subprocess.getstatusoutput("grep relayhost /etc/postfix/main.cf") + status, out = subprocess.getstatusoutput("grep -E '^relayhost' /etc/postfix/main.cf") if status == 0: configured_relay = ( @@ -75,7 +75,7 @@ def check_relay(relay_host: str, relay_port: str, domain: str) -> tuple: with open("/etc/mailname", "r") as mailname: myorigin = mailname.read().strip() else: - out = subprocess.getoutput("grep myorigin /etc/postfix/main.cf") + out = subprocess.getoutput("grep -E '^myorigin' /etc/postfix/main.cf") myorigin = out.replace("myorigin", "").strip() # possible origin names origins = set( -- GitLab