On Sat, Feb 1, 2020, at 5:27 AM, Shashikanth Komandoor wrote:
Hello Mark,
Thanks for helping me for moving ahead in my project. Troubling you again, I would like to put another request at you. As per your suggestion, I am trying to configure my list
configuration through REST API for specially the parameter like max_days_to_hold as it is not available through interface and I am following the official links of mailman 3 i.e https://mailman.readthedocs.io/en/latest/src/mailman/rest/docs/listconf.html
But I am getting "name is not defined" sort of errors as below:
*>>> dump_json('http://localhost:9001/3.0/lists/ <http://localhost:9001/3.0/lists/>','ant@example.com/config <http://ant@example.com/config>',dict(display_name='My List'),'PATCH')Traceback (most recent call last): File "<stdin>", line 1, in <module>NameError: name 'dump_json' is not defined>>>*
Actually I am new to REST API but hope this is the only issue that
is preventing me to go ahead.
Could you please help me by saying how should I handle this so that
I should be able to configure *max_days_to_hold* of a list or multiple ?
dump_json is basically a Python function which sends the request to the URL you add as the first parameter (GET, if any data isn't specified and uses POST if data is specified or explicitly define the PATCH or method like you have above) and prints the json response.
You can easily do the same using curl with the right authorization headers, with something like:
$ curl -u restadmin:restpass -X PATCH
http://localhost:8001/3.1/lists/somelist.example.com/config -d display_name='Patched Name'
Note that "restadmin:restpass" is the username password that you have set in your mailman.cfg.
If you do want to use Python, you can just use a regular PATCH request using requests or standard library urllib3.
Finally, dump_json is documented here: https://mailman.readthedocs.io/en/latest/src/mailman/docs/documentation.html...
On Wed, Jan 29, 2020 at 11:20 PM Mark Sapiro <mark@msapiro.net> wrote:
On 1/28/20 8:42 PM, Shashikanth Komandoor wrote:
But I could see that parameter value configurable on MM2 GUI
interface in General Options but I don't see the same on the MM3 GUI interface.
There are many core settings not (yet) exposed in Postorius. max_days_to_hold. is one of them. It can be set via
mailman shell
or via the REST API < https://mailman.readthedocs.io/en/latest/src/mailman/rest/docs/rest.html#res....
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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/
-- Thanks & Regards, Shashi Kanth.K 9052671936
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/
-- thanks, Abhilash Raj (maxking)