mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
run removal of inactive users daily
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
## untagged
|
||||
|
||||
- BREAKING: new required chatmail.ini value 'delete_inactive_users_after = 25'
|
||||
which removes users from database and mails after 25 days without any login.
|
||||
|
||||
- remove checking of reverse-DNS PTR records. Chatmail-servers don't
|
||||
depend on it and even in the wider e-mail system it's not common anymore.
|
||||
If it's an issue, a chatmail operator can still care to properly set reverse DNS.
|
||||
|
||||
@@ -26,6 +26,7 @@ chatmail-metadata = "chatmaild.metadata:main"
|
||||
filtermail = "chatmaild.filtermail:main"
|
||||
echobot = "chatmaild.echo:main"
|
||||
chatmail-metrics = "chatmaild.metrics:main"
|
||||
delete_inactive_users = "chatmaild.delete_inactive_users:main"
|
||||
|
||||
[project.entry-points.pytest11]
|
||||
"chatmaild.testplugin" = "chatmaild.tests.plugin"
|
||||
|
||||
@@ -4,6 +4,7 @@ import iniconfig
|
||||
|
||||
|
||||
def read_config(inipath, mail_basedir=None):
|
||||
assert Path(inipath).exists(), inipath
|
||||
cfg = iniconfig.IniConfig(inipath)
|
||||
params = cfg.sections["params"]
|
||||
if mail_basedir is None:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Remove old user accounts
|
||||
Remove inactive users
|
||||
"""
|
||||
|
||||
import shutil
|
||||
|
||||
@@ -8,7 +8,7 @@ mail_domain = {mail_domain}
|
||||
#
|
||||
|
||||
#
|
||||
# Restrictions on user addresses
|
||||
# Restrictions on user addresses
|
||||
#
|
||||
|
||||
# how many mails a user can send out per minute
|
||||
@@ -20,7 +20,7 @@ max_mailbox_size = 100M
|
||||
# days after which mails are unconditionally deleted
|
||||
delete_mails_after = 20
|
||||
|
||||
# days after which users without a login are deleted (database and mails)
|
||||
# days after which users without a login are deleted (database and mails)
|
||||
delete_inactive_users_after = 25
|
||||
|
||||
# minimum length a username must have
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from time import time as now
|
||||
|
||||
from chatmaild.doveauth import lookup_passdb
|
||||
from chatmaild.delete_inactive_users import delete_inactive_users
|
||||
from chatmaild.doveauth import lookup_passdb
|
||||
|
||||
|
||||
def test_remove_stale_users(db, example_config):
|
||||
|
||||
@@ -9,3 +9,4 @@
|
||||
2 0 * * * vmail find /home/vmail/mail/{{ config.mail_domain }} -path '*/tmp/*' -mtime +{{ config.delete_mails_after }} -type f -delete
|
||||
2 0 * * * vmail find /home/vmail/mail/{{ config.mail_domain }} -path '*/.*/tmp/*' -mtime +{{ config.delete_mails_after }} -type f -delete
|
||||
3 0 * * * vmail find /home/vmail/mail/{{ config.mail_domain }} -name 'maildirsize' -type f -delete
|
||||
4 0 * * * vmail /usr/local/lib/chatmaild/venv/bin/delete_inactive_users /home/vmail/passdb.lite /usr/local/lib/chatmaild/chatmail.ini
|
||||
|
||||
Reference in New Issue
Block a user