Compare commits

...
4 changed files with 9 additions and 5 deletions
+3
View File
@@ -2,6 +2,9 @@
## untagged
- replace crypt with passlib, as crypt will be deprecated in Python 3.13
([#319](https://github.com/deltachat/chatmail/pull/319))
- Reject DKIM signatures that do not cover the whole message body.
([#321](https://github.com/deltachat/chatmail/pull/321))
+1
View File
@@ -12,6 +12,7 @@ dependencies = [
"deltachat-rpc-client",
"filelock",
"requests",
"passlib",
]
[tool.setuptools]
+5 -3
View File
@@ -1,4 +1,3 @@
import crypt
import json
import logging
import os
@@ -11,6 +10,8 @@ from socketserver import (
UnixStreamServer,
)
import passlib.hash
from .config import Config, read_config
from .database import Database
@@ -23,8 +24,9 @@ class UnknownCommand(ValueError):
def encrypt_password(password: str):
# https://doc.dovecot.org/configuration_manual/authentication/password_schemes/
passhash = crypt.crypt(password, crypt.METHOD_SHA512)
return "{SHA512-CRYPT}" + passhash
pw = passlib.hash.sha512_crypt.hash(password).split("$")
return "{SHA512-CRYPT}$" + pw[1] + "$" + pw[3] + "$" + pw[4]
def is_allowed_to_create(config: Config, user, cleartext_password) -> bool:
-2
View File
@@ -649,5 +649,3 @@ def deploy_chatmail(config_path: Path) -> None:
name="Ensure cron is installed",
packages=["cron"],
)