mirror of
https://github.com/Mailu/Mailu.git
synced 2025-03-03 14:52:36 +02:00
Merge #3758
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:
commit
9223472520
@ -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'),
|
||||
}
|
||||
|
1
towncrier/newsfragments/3758.bugfix
Normal file
1
towncrier/newsfragments/3758.bugfix
Normal 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;
|
Loading…
x
Reference in New Issue
Block a user