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

Changed messages in postfix test (refs #24224).

parent eaa6a0cd
No related branches found
No related tags found
No related merge requests found
...@@ -43,13 +43,17 @@ def print_green(txt): ...@@ -43,13 +43,17 @@ def print_green(txt):
def check_listening_port(): def check_listening_port():
# check that postfix listens the port 25 correctly # check that postfix listens the port 25 correctly
status, out = subprocess.getstatusoutput('netstat -pant | grep master | grep 127.0.0.1:25') status, out = subprocess.getstatusoutput('netstat -pant | grep master | grep ":25"')
if status != 0: if status != 0:
print_red('The port 25 is not listened by postfix "master" process.') print_red('The port 25 is not listened by postfix "master" process.')
return 1 return 1
else: print_green('Postfix "master" process is listening port 25 correctly.')
print_green('Postfix is listening port 25 correctly.') if '127.0.0.1:25' not in out:
return 0 print_red('Postfix "master" process is not listening address 127.0.0.1, please check postfix configuration.')
print('Postfix should listen address 127.0.0.1 to be sure that this server cannot be used as an SMTP relay by external services.')
return 1
print_green('Postfix "master" process is listening address 127.0.0.1 correctly.')
return 0
def check_relay(): def check_relay():
......
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