diff --git a/core/admin/mailu/internal/views/rspamd.py b/core/admin/mailu/internal/views/rspamd.py index 458dbb81..3d3f8719 100644 --- a/core/admin/mailu/internal/views/rspamd.py +++ b/core/admin/mailu/internal/views/rspamd.py @@ -25,3 +25,8 @@ def rspamd_dkim_key(domain_name): } ) return flask.jsonify({'data': {'selectors': selectors}}) + +@internal.route("/rspamd/local_domains", methods=['GET']) +def rspamd_local_domains(): + domains = set(models.Domain.query.all() + models.Alternative.query.all()) + return '\n'.join(domains) diff --git a/core/rspamd/conf/whitelist.conf b/core/rspamd/conf/whitelist.conf new file mode 100644 index 00000000..fcde167a --- /dev/null +++ b/core/rspamd/conf/whitelist.conf @@ -0,0 +1,8 @@ +rules { + BLACKLIST_ANTISPOOF = { + valid_dmarc = true; + blacklist = true; + domains = "http://{{ ADMIN_ADDRESS }}/internal/rspamd/local_domains"; + score = 15.0; + } +}