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

Fixed return code for mail test.

parent 365a01ca
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import random
import time
import imp
YELLOW = '\033[93m'
GREEN = '\033[92m'
RED = '\033[91m'
DEF = '\033[0m'
......@@ -28,6 +29,10 @@ def print_color(txt, col):
print('%s%s%s' % (col, txt, DEF))
def print_yellow(txt):
print_color(txt, YELLOW)
def print_red(txt):
print_color(txt, RED)
......@@ -62,8 +67,8 @@ def check_relay():
with open('/etc/mailname', 'r') as f:
d = f.read().strip()
if d not in ('ubicast.tv', 'ubicast.eu'):
print_red('/etc/mailname does not contain ubicast.eu or ubicast.tv, mails will probably not be received on ubicast mailing lists')
return 2
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:
......
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