diff --git a/tests/test_email.py b/tests/test_email.py index cae12ce397a1ed93c3f61ddeccbe6ba07705ef06..66f32f9b1f3ee53b5b86ab3a6c6b2ae571c57f75 100755 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -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: