Mailman3 subscribe over command line
I would be looking to be able to subscribe people to multiple lists through command line. Mailman 2.1 did have an add_members script we used but I'm not able to use this module in mailman3. Can anyone suggest a script or approach to this issue?
Thank you, Tibor
On 9/16/21 2:35 AM, tibor.molnar@waltoninstitute.ie wrote:
I would be looking to be able to subscribe people to multiple lists through command line. Mailman 2.1 did have an add_members script we used but I'm not able to use this module in mailman3. Can anyone suggest a script or approach to this issue?
See https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/commands/do...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
If I try using this command the following error occurs:
from mailman.testing.documentation import cli command = cli('mailman.commands.cli_addmembers.addmembers') Traceback (most recent call last): File "/usr/lib/python3.8/code.py", line 90, in runcode exec(code, self.locals) File "<console>", line 1, in <module> File "/usr/lib/python3/dist-packages/mailman/testing/documentation.py", line 168, in cli command = getattr(import_module(package_path), name) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'mailman.commands.cli_addmembers'
On 9/17/21 1:46 AM, tibor.molnar@waltoninstitute.ie wrote:
If I try using this command the following error occurs:
from mailman.testing.documentation import cli command = cli('mailman.commands.cli_addmembers.addmembers') Traceback (most recent call last): ... ModuleNotFoundError: No module named 'mailman.commands.cli_addmembers'
What Mailman version is this? The add_members mailman subcommand was added in 3.3.2 and didn't exist before that. In Mailman 3.3.1 and prior, you need to use the members subcommand with the -a/--add option.
Also note that mailman.testing.documentation.cli is only intended to be used for tests and not production. See https://click.palletsprojects.com/en/8.0.x/testing/#testing-click-applicatio...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
The mailman version I'm using is 3.2.2. The members subcommand is working well as you suggested. Thank you.
Tibor
participants (2)
-
Mark Sapiro
-
tibor.molnar@waltoninstitute.ie