Skip to content
Snippets Groups Projects
Commit 10957731 authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

fix check_listen & and maillog support

parent f85f6cd1
No related branches found
No related tags found
No related merge requests found
...@@ -37,8 +37,8 @@ def check_listen() -> tuple: ...@@ -37,8 +37,8 @@ def check_listen() -> tuple:
if status != 0 or ("127.0.0.1:25" not in out and "[::1]:25" not in out): if status != 0 or ("127.0.0.1:25" not in out and "[::1]:25" not in out):
u.error("Postfix is not listening on localhost:25") u.error("Postfix is not listening on localhost:25")
errors += 1 errors += 1
else:
u.success("Postfix is listening on localhost:25") u.success("Postfix is listening on localhost:25")
return warnings, errors return warnings, errors
...@@ -126,10 +126,10 @@ def check_send(sender: str) -> tuple: ...@@ -126,10 +126,10 @@ def check_send(sender: str) -> tuple:
out = "" out = ""
# find logs # find logs
if Path("/var/log/mail.log").is_file(): if Path("/var/log/maillog").is_file():
cmd = "grep '{}' /var/log/mail.log".format(email)
elif Path("/var/log/maillog").is_file():
cmd = "grep '{}' /var/log/maillog".format(email) cmd = "grep '{}' /var/log/maillog".format(email)
elif Path("/var/log/mail.log").is_file():
cmd = "grep '{}' /var/log/mail.log".format(email)
else: else:
u.info("/var/log/mail.log not found, trying journalctl") u.info("/var/log/mail.log not found, trying journalctl")
cmd = "journalctl -t postfix/smtp | grep {}".format(email) cmd = "journalctl -t postfix/smtp | grep {}".format(email)
......
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