From 88c174fb7aef88e8796256158509840060b6dfa5 Mon Sep 17 00:00:00 2001 From: David Rothera Date: Sun, 2 Dec 2018 10:46:47 +0000 Subject: [PATCH] Query alternative table for domain matches At present postfix checks this view for matches in the domain table and is used to accept/deny messages sent into it however it never checks for matches in the alternative table. Fixes #718 --- core/admin/mailu/internal/views/postfix.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/admin/mailu/internal/views/postfix.py b/core/admin/mailu/internal/views/postfix.py index 79fbdb8a..74e49864 100644 --- a/core/admin/mailu/internal/views/postfix.py +++ b/core/admin/mailu/internal/views/postfix.py @@ -6,7 +6,9 @@ import flask @internal.route("/postfix/domain/") def postfix_mailbox_domain(domain_name): - domain = models.Domain.query.get(domain_name) or flask.abort(404) + domain = models.Domain.query.get(domain_name) or \ + models.Alternative.query.get(domain_name) or \ + flask.abort(404) return flask.jsonify(domain.name)