1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-03-03 14:52:36 +02:00
3758: added idna function to perform puny encoding on IDN domains r=mergify[bot] a=Jumper78

## What type of PR?

bug-fix

## What does this PR do?

### Related issue(s)
- fixes issue where DKIM signatures from domains with IDN are not accepted by some mail servers: closes #3743

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Jumper78 <52802286+Jumper78@users.noreply.github.com>
This commit is contained in:
bors-mailu[bot] 2025-02-15 16:10:43 +00:00 committed by GitHub
commit 9223472520
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

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'),
}

View File

@ -0,0 +1 @@
domain name of an IDN domain in the DKIM signature needs to follow RFC6376; puny encoding the domain name when rspamd accesses the vault;