1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00

Handle relays as virtual transports through podop

This commit is contained in:
kaiyou 2018-09-27 16:30:20 +02:00
parent 9890e1fb2a
commit f5668dea51
3 changed files with 5 additions and 9 deletions

View File

@ -35,11 +35,8 @@ def postfix_alias_map(alias):
return flask.abort(404)
@internal.route("/postfix/spoofed/<email>")
def postfix_spoofed(email):
return flask.abort(404)
@internal.route("/postfix/transport/<email>")
def postfix_transport(email):
return flask.abort(404)
localpart, domain = email.split('@', 1) if '@' in email else (None, email)
relay = models.Relay.query.get(domain) or flask.abort(404)
return flask.jsonify("smtp:[{}]".format(relay.smtp))

View File

@ -62,8 +62,8 @@ virtual_mailbox_domains = ${podop}domain
virtual_mailbox_maps = ${podop}mailbox
# Mails are transported if required, then forwarded to Dovecot for delivery
# relay_domains = ${podop}transport
# transport_maps = ${podop}transport
relay_domains = ${podop}transport
transport_maps = ${podop}transport
virtual_transport = lmtp:inet:{{ HOST_LMTP }}
# In order to prevent Postfix from running DNS query, enforce the use of the

View File

@ -17,7 +17,6 @@ def start_podop():
("alias", "url", "http://admin/internal/postfix/alias/§"),
("domain", "url", "http://admin/internal/postfix/domain/§"),
("mailbox", "url", "http://admin/internal/postfix/mailbox/§"),
("spoofed", "url", "http://admin/internal/postfix/spoofed/§"),
])
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))