Skip to content
Snippets Groups Projects
Commit 3c4458bf authored by Florent Thiery's avatar Florent Thiery
Browse files

support journalctl postfix log case

parent 1fef8635
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,11 @@ def send_test_email():
timeout = 120
waited = 2
out = ''
cmd = 'grep "%s" /var/log/mail.log' % email
if os.path.isfile('/var/log/mail.log'):
cmd = 'grep "%s" /var/log/mail.log' % email
else:
print('/var/log/mail.log not found, trying journalctl')
cmd = 'journalctl -u postfix | grep %s' % email
while True:
status, out = subprocess.getstatusoutput(cmd)
if status == 0:
......
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