is there a tutorial or some examples for using the mailman shell? Is there detailed documentation on it?
Anything I try to do such as the following fails:
$ mailman shell Welcome to the GNU Mailman shell
command('mailman shell --details') Traceback (most recent call last): File "<console>", line 1, in <module> NameError: name 'command' is not defined
I execute the shell as user mailman and from within the same venv that all the programs run under.
On 6/10/19 6:21 PM, andrew.bernard@gmail.com wrote:
is there a tutorial or some examples for using the mailman shell? Is there detailed documentation on it?
What documentation there is is at <https://mailman.readthedocs.io/en/latest/src/mailman/commands/docs/shell.html>
Anything I try to do such as the following fails:
$ mailman shell Welcome to the GNU Mailman shell
command('mailman shell --details') Traceback (most recent call last): File "<console>", line 1, in <module> NameError: name 'command' is not defined
You could just do mailman shell --details
at a command prompt.
Perhaps you saw the command('mailman shell --details')
line in the
docs at
<https://mailman.readthedocs.io/en/latest/src/mailman/commands/docs/shell.html#getting-detailed-help>
in any case, that requires two things to precede it. The first is part
of the doctest infrastructure and is not evident in the docs. that step is
from mailman.testing.documentation import cli
The second step is in the docs and is
command = cli('mailman.commands.cli_withlist.shell')
If you do those two steps within mailman shell
, then the step
command('mailman shell --details')
will work, but as I said, this is just the same as doing mailman shell --details
at a command prompt.
Beyond that, actually doing stuff within mailman shell
requires some
knowledge of Mailman interfaces, methods and objects as well as Python.
Some of this is covered throughout the documentation at
<https://mailman.readthedocs.io/en/latest/> but some can only be found
in the source code itself.
That said, all the interfaces and a few other useful functions are
imported for you in mailman shell
interactive mode. do dir()
to see
what these are.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thanks Mark,
The omission of the code to make the examples work seems to need correction. Perhaps I can submit an update to the project. Had me scratching my head for a long time. Obviously I knew there were imports etc missing, but what to put?
I have this going, and it is great. But I recall seeing something called mmclient or similar which has simple commands like show user, show lists, and so on. Is that still available?
Now knowing how mailman shell works, anybody could write their own commands, but I don't want to reinvent wheels.
Andrew
-----Original Message----- From: Mark Sapiro <mark@msapiro.net> Sent: Tuesday, 11 June 2019 1:26 PM To: mailman-users@mailman3.org
Perhaps you saw the
command('mailman shell --details')
line in the docs at <https://mailman.readthedocs.io/en/latest/src/mailman/commands/docs/s hell.html#getting-detailed-help> in any case, that requires two things to precede it. The first is part of the doctest infrastructure and is not evident in the docs. that step isfrom mailman.testing.documentation import cli
The second step is in the docs and is
command = cli('mailman.commands.cli_withlist.shell')
If you do those two steps within
mailman shell
, then the stepcommand('mailman shell --details')
will work, but as I said, this is just the same as doing
mailman shell --details
at a command prompt.
On 6/11/19 6:00 PM, Andrew Bernard wrote:
I have this going, and it is great. But I recall seeing something called mmclient or similar which has simple commands like show user, show lists, and so on. Is that still available?
Are you thinking of the mailman command itself? Things like mailman lists
and mailman users
. Try running the mailman
command itself
with no arguments to see a list of sub-commands and then mailman sub-command --help
to get the details of a particular subcommand.
Now knowing how mailman shell works, anybody could write their own commands, but I don't want to reinvent wheels.
I don't know what it is you are trying to accomplish, but yes, you can
create scripts which you run via mailman shell -run ...
, but is there
something specific you are trying to do that is not currently available
via the mailman
command or the Postorius wb UI?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
I'm attempting to run some tests on a test instance of Mailman3 hosted via Docker container.
I can access the web interface, I've imported lists, etc.
I'm now trying to do some simple injection testing via command line. But I seem to be missing something.
I've tried using mailman inject with the filename option to one of the lists I've imported but still no luck.
I've also followed the tutorial here:
https://mailman.readthedocs.io/en/latest/src/mailman/commands/docs/inject.ht...
I was hoping to see my injected message to show up as held for moderation in the web interface.
Please advise!
-- Dan
On 1/15/20 11:03 AM, dancab@caltech.edu wrote:
I'm now trying to do some simple injection testing via command line. But I seem to be missing something.
I've tried using mailman inject with the filename option to one of the lists I've imported but still no luck.
What is the command you are giving? It should be something like
mailman inject -f your_file listname.example.com
You could also specify -q in
but that's the default.
What does the message in your_file look like? Does it have a complete set of headers including To:, From:, Subject:, Date: and Message-ID:, and is To: the list posting address?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Andrew Bernard
-
andrew.bernard@gmail.com
-
dancab@caltech.edu
-
Mark Sapiro