mirror of
				https://github.com/optim-enterprises-bv/Mailu.git
				synced 2025-10-30 17:47:55 +00:00 
			
		
		
		
	added idna function to perform puny encoding on IDN domains
This commit is contained in:
		| @@ -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'), | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jumper78
					Jumper78