Skip to content
Snippets Groups Projects
Commit 2729e542 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Fixed regexp to search for postfix config

parent 8c564b90
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment