Add port to relay if it contains a colon

This closes #1357
master
Philip Rosenberg-Watt 5 years ago
parent b248f6a800
commit ff1dfec39a

@ -36,7 +36,11 @@ def postfix_transport(email):
return flask.abort(404)
localpart, domain_name = models.Email.resolve_domain(email)
relay = models.Relay.query.get(domain_name) or flask.abort(404)
return flask.jsonify("smtp:[{}]".format(relay.smtp))
ret = "smtp:[{0}]".format(relay.smtp)
if ":" in relay.smtp:
split = relay.smtp.split(':')
ret = "smtp:[{0}]:{1}".format(split[0], split[1])
return flask.jsonify(ret)
@internal.route("/postfix/sender/login/<path:sender>")

@ -0,0 +1 @@
Relay a domain to a nonstandard SMTP port by adding ":<port_num>" to the remote hostname or IP address.
Loading…
Cancel
Save