You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-08-10 22:31:47 +02:00
Fix config-import. Config with dkim key could not be imported.
This commit is contained in:
@@ -574,8 +574,8 @@ class DkimKeyField(fields.String):
|
||||
if value.lower() == '-generate-':
|
||||
return dkim.gen_key()
|
||||
|
||||
# no key?
|
||||
if not value:
|
||||
# no key or key is <hidden>?
|
||||
if not value or str(value) == '<hidden>':
|
||||
return None
|
||||
|
||||
# remember part of value for ValidationError
|
||||
@@ -610,7 +610,7 @@ class DkimKeyField(fields.String):
|
||||
|
||||
# check key validity
|
||||
try:
|
||||
serialization.load_pem_private_key(bytes(value, "ascii"), password=None)
|
||||
serialization.load_pem_private_key(value, password=None)
|
||||
except (UnicodeEncodeError, ValueError) as exc:
|
||||
raise ValidationError(f'invalid dkim key {bad_key!r}') from exc
|
||||
else:
|
||||
|
2
towncrier/newsfragments/2747.bugfix
Normal file
2
towncrier/newsfragments/2747.bugfix
Normal file
@@ -0,0 +1,2 @@
|
||||
Fix breaking bug in config-import command line command.
|
||||
Import yml's containing dkim keys (the element 'dkim_key:') failed to import using `config-import`.
|
Reference in New Issue
Block a user