mirror of
https://github.com/optim-enterprises-bv/Mailu.git
synced 2025-11-01 18:47:52 +00:00
Allow specific users to send email from any address
This commit is contained in:
@@ -133,10 +133,13 @@ def postfix_sender_map(sender):
|
||||
|
||||
@internal.route("/postfix/sender/login/<path:sender>")
|
||||
def postfix_sender_login(sender):
|
||||
has_wildcard_senders = bool(flask.current_app.config["WILDCARD_SENDERS"])
|
||||
wildcard_senders = flask.current_app.config["WILDCARD_SENDERS"].lower().split(',') if has_wildcard_senders else []
|
||||
localpart, domain_name = models.Email.resolve_domain(sender)
|
||||
if localpart is None:
|
||||
return flask.abort(404)
|
||||
return flask.jsonify(",".join(wildcard_senders)) if has_wildcard_senders else flask.abort(404)
|
||||
destination = models.Email.resolve_destination(localpart, domain_name, True)
|
||||
destination = [*destination, *wildcard_senders] if destination else [*wildcard_senders]
|
||||
return flask.jsonify(",".join(destination)) if destination else flask.abort(404)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user