From 4f0eb0ef359ba4e15638488dd79d40ab8348f5d8 Mon Sep 17 00:00:00 2001 From: Jumper78 <52802286+Jumper78@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:01:20 +0000 Subject: [PATCH] DKIM signing of alternative domains When rspamd looks up the DKIM key of the domains, also the alternative domains are queried. In case there is a match, the admin container is providing the DKIM key of the domain belonging to the alternative domain. file modified: core/admin/mailu/internal/views/rspamd.py --- core/admin/mailu/internal/views/rspamd.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/admin/mailu/internal/views/rspamd.py b/core/admin/mailu/internal/views/rspamd.py index b6ead86b..4b17297a 100644 --- a/core/admin/mailu/internal/views/rspamd.py +++ b/core/admin/mailu/internal/views/rspamd.py @@ -24,6 +24,15 @@ def rspamd_dkim_key(domain_name): 'selector': flask.current_app.config.get('DKIM_SELECTOR', 'dkim'), } ) + elif domain := models.Alternative.query.get(domain_name): + if key := domain.domain.dkim_key: + selectors.append( + { + 'domain' : domain.name, + 'key' : key.decode('utf8'), + 'selector': flask.current_app.config.get('DKIM_SELECTOR', 'dkim'), + } + ) return flask.jsonify({'data': {'selectors': selectors}}) @internal.route("/rspamd/local_domains", methods=['GET'])