clean up spambot generated accounts

Dear all,
I'm trying to find a way to clean up hundreds of spambot generated accounts on my system. I was pointed to this script that should be capable of doing the task:
https://www.msapiro.net/scripts/clean_users.py
However, it seems outdated. First, the path to the interpreter is not what I find on my mailman3 installation. It says:
#! /opt/mailman/mm/venv/bin/python
However, the python command is located in /opt/mailman/venv/bin/python instead, no "mm"
After fixing this, the script still throws an error:
(venv) mailman@ida:~$ clean_users.py Traceback (most recent call last): File "/usr/local/bin/clean_users.py", line 55, in <module> django.setup() File "/opt/mailman/venv/lib/python3.10/site-packages/django/__init__.py", line 19, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/opt/mailman/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 102, in __getattr__ self._setup(name) File "/opt/mailman/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in _setup self._wrapped = Settings(settings_module) File "/opt/mailman/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 217, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'settings'
Can somebody explain to me, why this module is not found and what I can do to fix it, if anything?
Thanks a lot in advance!
Johannes

Sorry, I should have looked into the script more closely. I simply had to set the variable CFG_PATH to the correct value.
Johannes
Am 23.02.25 um 15:29 schrieb Johannes Rohr:
Dear all,
I'm trying to find a way to clean up hundreds of spambot generated accounts on my system. I was pointed to this script that should be capable of doing the task:
https://www.msapiro.net/scripts/clean_users.py
However, it seems outdated. First, the path to the interpreter is not what I find on my mailman3 installation. It says:
#! /opt/mailman/mm/venv/bin/python
However, the python command is located in /opt/mailman/venv/bin/python instead, no "mm"
After fixing this, the script still throws an error:
(venv) mailman@ida:~$ clean_users.py Traceback (most recent call last): File "/usr/local/bin/clean_users.py", line 55, in <module> django.setup() File "/opt/mailman/venv/lib/python3.10/site-packages/django/__init__.py", line 19, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/opt/mailman/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 102, in __getattr__ self._setup(name) File "/opt/mailman/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in _setup self._wrapped = Settings(settings_module) File "/opt/mailman/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 217, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'settings'
Can somebody explain to me, why this module is not found and what I can do to fix it, if anything?
Thanks a lot in advance!
Johannes
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to johannes@rohr.org

Johannes Rohr writes:
Sorry, I should have looked into the script more closely. I simply had to set the variable CFG_PATH to the correct value.
Don't worry about it, we've all been through the experience of having cockroaches in our systems. Just get your system sorted, and everybody happy!
However, it seems outdated. First, the path to the interpreter is not what I find on my mailman3 installation. It says:
#! /opt/mailman/mm/venv/bin/python
That's how Mark likes to set up Mailman 3 systems. Of course his scripts are going to work best on his systems! ;-)
participants (2)
-
Johannes Rohr
-
Stephen J. Turnbull