Skip to content
Snippets Groups Projects
Verified Commit b7c72294 authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

handle EMAIL_SMTP_SERVER host:port notation

parent 83c9e25a
No related branches found
No related tags found
No related merge requests found
......@@ -210,9 +210,14 @@ def main():
# get settings
conf = u.load_conf()
relay = conf.get("EMAIL_SMTP_SERVER", "").replace("[", "").replace("]", "")
relay_host = (
conf.get("EMAIL_SMTP_SERVER", "")
.replace("[", "")
.replace("]", "")
.split(":")[0]
)
ip_addr = (
(socket.gethostbyname(relay) if relay else None)
(socket.gethostbyname(relay_host) if relay_host else None)
or conf.get("NETWORK_IP_NAT")
or conf.get("NETWORK_IP")
or u.get_ip()
......@@ -230,7 +235,7 @@ def main():
errors += check_err if check_err else errors
# check that relayhost is correct
check_warn, check_err = check_relay(relay, domain)
check_warn, check_err = check_relay(relay_host, domain)
warnings += check_warn if check_warn else warnings
errors += check_err if check_err else errors
......
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