1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-03-03 14:52:36 +02:00

added idna function to perform puny encoding on IDN domains

This commit is contained in:
Jumper78 2025-02-14 16:19:20 +00:00
parent 5f4d428b2a
commit 35ffcb070d

View File

@ -2,6 +2,7 @@ from mailu import models
from mailu.internal import internal
import flask
import idna
def vault_error(*messages, status=404):
return flask.make_response(flask.jsonify({'errors':messages}), status)
@ -19,7 +20,7 @@ def rspamd_dkim_key(domain_name):
if key := domain.dkim_key:
selectors.append(
{
'domain' : domain.name,
'domain' : idna.encode(domain.name.lower()).decode('ascii'),
'key' : key.decode('utf8'),
'selector': flask.current_app.config.get('DKIM_SELECTOR', 'dkim'),
}
@ -28,7 +29,7 @@ def rspamd_dkim_key(domain_name):
if key := domain.domain.dkim_key:
selectors.append(
{
'domain' : domain.name,
'domain' : idna.encode(domain.name.lower()).decode('ascii'),
'key' : key.decode('utf8'),
'selector': flask.current_app.config.get('DKIM_SELECTOR', 'dkim'),
}