mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
ruff again :)
This commit is contained in:
@@ -106,7 +106,8 @@ def lookup_passdb(db, config: Config, user, cleartext_password):
|
|||||||
if userdata:
|
if userdata:
|
||||||
# Update last login time.
|
# Update last login time.
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"UPDATE users SET last_login=? WHERE addr=?", (round(int(time.time()) // 86400), user)
|
"UPDATE users SET last_login=? WHERE addr=?",
|
||||||
|
(round(int(time.time()) // 86400), user),
|
||||||
)
|
)
|
||||||
|
|
||||||
userdata["home"] = f"/home/vmail/mail/{config.mail_domain}/{user}"
|
userdata["home"] = f"/home/vmail/mail/{config.mail_domain}/{user}"
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ def remove_users(db: Database, cutoff_date: int):
|
|||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
|
||||||
def remove_user_data(db: Database, cutoff_date: int, dir: Path):
|
def remove_user_data(db: Database, cutoff_date: int, dir: Path):
|
||||||
"""Collects all users where last_login < cutoff_date and deletes corresponding directories."""
|
"""Collects all users where last_login < cutoff_date and deletes corresponding directories."""
|
||||||
db.connect()
|
db.connect()
|
||||||
|
|||||||
Reference in New Issue
Block a user