From 0e588e3ce07f8276c0da573536856f65594d9fb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu>
Date: Tue, 6 Feb 2018 08:53:16 +0100
Subject: [PATCH] Consider wrong smtp relay as non critical problem.

---
 tests/test_email.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/test_email.py b/tests/test_email.py
index cc8e2eb9..79490d6f 100755
--- a/tests/test_email.py
+++ b/tests/test_email.py
@@ -70,18 +70,18 @@ def check_relay():
             ip = conf.get('NETWORK_IP')
         with open('/etc/mailname', 'r') as f:
             d = f.read().strip()
-            if d not in ('ubicast.tv', 'ubicast.eu'):
-                print_yellow('/etc/mailname does not contain ubicast.eu or ubicast.tv, mails will probably not be received on ubicast mailing lists')
-                return 3
-            # check spf
-            status, output = subprocess.getstatusoutput('host -t TXT ubicast.eu')
-            if ip not in output:
-                print_red('ip %s is not in ubicast.eu SPF and emails sent from support@ubicast.eu will be treated as spam' % ip)
-                return 1
+        if d not in ('ubicast.tv', 'ubicast.eu'):
+            print_yellow('/etc/mailname does not contain ubicast.eu or ubicast.tv, mails will probably not be received on ubicast mailing lists')
+            return 3
+        # check spf
+        status, output = subprocess.getstatusoutput('host -t TXT ubicast.eu')
+        if ip not in output:
+            print_red('ip %s is not in ubicast.eu SPF and emails sent from support@ubicast.eu will be treated as spam' % ip)
+            return 1
     conf_relay = conf.get('EMAIL_SMTP_SERVER', '').strip('[]')
     if conf_relay != configured_relay:
         print_red('Configured STMP relay (%s) does not match the expected value (%s).' % (configured_relay, conf_relay))
-        return 1
+        return 3
     else:
         print_green('STMP relay is properly set.')
         return 0
-- 
GitLab