|
|
|
@ -52,6 +52,18 @@ def basic_authentication():
|
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@internal.route("/postfix/domain/<domain_name>")
|
|
|
|
|
def postfix_mailbox_domain(domain_name):
|
|
|
|
|
domain = models.Domain.query.get(domain_name) or flask.abort(404)
|
|
|
|
|
return flask.jsonify(domain.name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@internal.route("/postfix/mailbox/<email>")
|
|
|
|
|
def postfix_mailbox_map(email):
|
|
|
|
|
user = models.User.query.get(email) or flask.abort(404)
|
|
|
|
|
return flask.jsonify(user.email)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@internal.route("/postfix/alias/<alias>")
|
|
|
|
|
def postfix_alias_map(alias):
|
|
|
|
|
localpart, domain = alias.split('@', 1) if '@' in alias else (None, alias)
|
|
|
|
@ -60,35 +72,25 @@ def postfix_alias_map(alias):
|
|
|
|
|
domain = alternative.domain_name
|
|
|
|
|
email = '{}@{}'.format(localpart, domain)
|
|
|
|
|
if localpart is None:
|
|
|
|
|
return domain
|
|
|
|
|
return flask.jsonify(domain)
|
|
|
|
|
else:
|
|
|
|
|
alias_obj = models.Alias.resolve(localpart, domain)
|
|
|
|
|
if alias_obj:
|
|
|
|
|
return alias_obj.destination
|
|
|
|
|
return flask.jsonify(alias_obj.destination)
|
|
|
|
|
user_obj = models.User.query.get(email)
|
|
|
|
|
if user_obj:
|
|
|
|
|
return user_obj.destination
|
|
|
|
|
flask.abort(404)
|
|
|
|
|
return flask.jsonify(user_obj.destination)
|
|
|
|
|
return flask.abort(404)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@internal.route("/postfix/alias/domain/<domain>")
|
|
|
|
|
def postfix_alias_domain(domain):
|
|
|
|
|
pass
|
|
|
|
|
@internal.route("/postfix/spoofed/<email>")
|
|
|
|
|
def postfix_spoofed(email):
|
|
|
|
|
return flask.abort(404)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@internal.route("/postfix/alias/map/<alias>")
|
|
|
|
|
def postfix_alias_map(alias):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@internal.route("/postfix/mailbox/domain/<domain>")
|
|
|
|
|
def postfix_mailbox_domain(domain):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@internal.route("/postfix/mailbox/map/<mailbox>")
|
|
|
|
|
def postfix_mailbox_map(domain):
|
|
|
|
|
pass
|
|
|
|
|
@internal.route("/postfix/transport/<email>")
|
|
|
|
|
def postfix_transport(email):
|
|
|
|
|
return flask.abort(404)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@internal.route("/dovecot/auth/passdb/<user_email>")
|
|
|
|
|