From a1f0a3e23b431652eac9de816395a178636984a4 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 9 Jul 2024 18:34:40 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: link2xt --- chatmaild/src/chatmaild/config.py | 2 +- chatmaild/src/chatmaild/doveauth.py | 4 ++-- cmdeploy/src/cmdeploy/dovecot/expunge.cron.j2 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chatmaild/src/chatmaild/config.py b/chatmaild/src/chatmaild/config.py index 17ae9cd4..967a77db 100644 --- a/chatmaild/src/chatmaild/config.py +++ b/chatmaild/src/chatmaild/config.py @@ -13,7 +13,7 @@ def read_config(inipath, mail_basedir=None): class Config: - def __init__(self, inipath, params, mail_basedir): + def __init__(self, inipath, params, mail_basedir: Path): self._inipath = inipath self.mail_domain = params["mail_domain"] self.max_user_send_per_minute = int(params["max_user_send_per_minute"]) diff --git a/chatmaild/src/chatmaild/doveauth.py b/chatmaild/src/chatmaild/doveauth.py index 172e4d9a..6f32a8cf 100644 --- a/chatmaild/src/chatmaild/doveauth.py +++ b/chatmaild/src/chatmaild/doveauth.py @@ -124,7 +124,7 @@ def lookup_passdb(db, config: Config, user, cleartext_password, last_login=None) q = """INSERT INTO users (addr, password, last_login) VALUES (?, ?, ?)""" conn.execute(q, (user, encrypted_password, last_login)) - print(f"Created e-mail address: {user}", file=sys.stderr) + print(f"Created address: {user}", file=sys.stderr) return dict( home=f"/home/vmail/mail/{config.mail_domain}/{user}", uid="vmail", @@ -146,7 +146,7 @@ def iter_userdb_lastlogin_before(db, cutoff_date): """Get a list of users where last login was before cutoff_date.""" with db.read_connection() as conn: rows = conn.execute( - "SELECT addr FROM users WHERE last_login