diff --git a/management/status_checks.py b/management/status_checks.py index 3459d358..92d5c887 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -259,6 +259,7 @@ def check_free_memory(rounded_values, env, output): if rounded_values: memory_msg = "System free memory is below 10%." output.print_error(memory_msg) +import subprocess def run_network_checks(env, output): # Also see setup/network-checks.sh. @@ -269,8 +270,8 @@ def run_network_checks(env, output): # Stop if we cannot make an outbound connection on port 25. Many residential # networks block outbound port 25 to prevent their network from sending spam. # See if we can reach one of Google's MTAs with a 5-second timeout. - _code, ret = shell("check_call", ["/bin/nc", "-z", "-w5", "aspmx.l.google.com", "25"], trap=True) - if ret == 0: + ret = subprocess.run("/usr/bin/nc -z -w5 aspmx.l.google.com 25", shell=True, capture_output=True) + if ret.returncode == 0: output.print_ok("Outbound mail (SMTP port 25) is not blocked.") else: output.print_error("""Outbound mail (SMTP port 25) seems to be blocked by your network. You