How to turn off Emergency Moderation for imported MM2 lists?
I recently imported a number of MM2 lists into MM3. Unfortunately, the person had emergency moderation turned on for these lists. Since EM is not exposed to Postorius what can be done to reverse this?
Thanks, Brian
On 7/27/20 3:38 PM, Brian Carpenter wrote:
I recently imported a number of MM2 lists into MM3. Unfortunately, the person had emergency moderation turned on for these lists. Since EM is not exposed to Postorius what can be done to reverse this?
To do one list:
mailman shell -l <list-id> m.emergency = False commit()
To do several lists:
mailman shell from mailman.models.mailinglist import MailingList mlist = MailingList('first.list.id') mlist.emergency = False commit() mlist = MailingList('second.list.id') mlist.emergency = False commit()
And so on for more lists.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 7/27/20 6:22 PM, Mark Sapiro wrote:
To do several lists:
mailman shell from mailman.models.mailinglist import MailingList mlist = MailingList('first.list.id') mlist.emergency = False commit() mlist = MailingList('second.list.id') mlist.emergency = False commit()
And so on for more lists.
Ooops... The above is not correct. The correct import is
from mailman.model.mailinglist import MailingList
i.e. model, not models and the arguments to MailingList are the list posting address, not the list-id. I.e.
mlist = MailingList('list@example.com')
and not
mlist = MailingList('list.example.com')
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Ok, I see the other thread concerning this was deleted, along with my reply. Here it is again.
Mark, following your instructions did not work. I did the following:
Get into a venv as user mailman
#mailman shell
from mailman.model.mailinglist import MailingList mlist = MailingList('listname@listdomain.org') mlist.emergency = False commit() ctrl-d (just to be on the safe side)
Did I not follow your instructions correctly?
Brian
On 7/28/20 5:40 AM, Brian Carpenter wrote:
Ok, I see the other thread concerning this was deleted, along with my reply. Here it is again.
It wasn't deleted. It's on another list - mailman-users@python.org.
Here's my reply to your post
On 7/27/20 7:13 PM, Brian Carpenter wrote:
This is the client that I asking about in my post. She said what I
did, did not work. This is what I did:
Get into a venv as user mailman
#mailman shell
from mailman.model.mailinglist import MailingList mlist = MailingList('listname@listdomain.org') mlist.emergency = False commit() ctrl-d (just to be on the safe side)
Did I not follow your instructions correctly?
That should work. I don't know why the result would be any different from what Johanna did.
On 7/27/20 8:58 PM, Johanna Amann wrote:
As a small followup for anyone encountering the same problem in the future - I ended up just changing the value in the database directly.
So - an “update mailinglist set emergency = FALSE;” (or the equivalent in the dialect of the database one uses) removes the emergency flag from all mailing lists.
That is another approach which is valid, but why the mailman shell
method I suggested wouldn't do the same thing, I don't know. Of course,
if you're doing multiple lists, this method is easier because just one
simple query does them all.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro wrote:
On 7/28/20 5:40 AM, Brian Carpenter wrote:
This is the client that I asking about in my post. She said what I did, did not work. This is what I did:
Get into a venv as user mailman
#mailman shell from mailman.model.mailinglist import MailingList mlist = MailingList('listname@listdomain.org') mlist.emergency = False commit() ctrl-d (just to be on the safe side)
I half understand why this didn't work. Instantiating the list via
from mailman.model.mailinglist import MailingList
mlist = MailingList('listname@listdomain.org')
for some reason (that's the half I don't understand) does not get the actual list object so changes you make to it don't affect the actual list. In mailman shell
you need to do
mlist = getUtility(IListManager).get('listname@listdomain.org')
getUtility
and IListManager
are in the namespace in mailman shell
, but outside of that, e.g. just in python
in your virtualenv, you also need
from mailman.interfaces.listmanager import IListManager
from zope.component import getUtility
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Thu, Aug 6, 2020, at 6:12 PM, Mark Sapiro wrote:
Mark Sapiro wrote:
On 7/28/20 5:40 AM, Brian Carpenter wrote:
This is the client that I asking about in my post. She said what I did, did not work. This is what I did:
Get into a venv as user mailman
#mailman shell from mailman.model.mailinglist import MailingList mlist = MailingList('listname@listdomain.org') mlist.emergency = False commit() ctrl-d (just to be on the safe side)
I half understand why this didn't work. Instantiating the list via
from mailman.model.mailinglist import MailingList mlist = MailingList('listname@listdomain.org')
for some reason (that's the half I don't understand) does not get the actual list object so changes you make to it don't affect the actual list.
It is because when you simply instantiate that class, it will create
a new model instance, that you would need to persist by adding
to database using store.add(mlist)
.
If you instead want to read that instance from database, you have
to do store.query()
, which is what the .get()
method of IListManager
does.
In
mailman shell
you need to domlist = getUtility(IListManager).get('listname@listdomain.org')
getUtility
andIListManager
are in the namespace inmailman shell
, but outside of that, e.g. just inpython
in your virtualenv, you also needfrom mailman.interfaces.listmanager import IListManager from zope.component import getUtility
-- 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, Abhilash Raj (maxking)
participants (3)
-
Abhilash Raj
-
Brian Carpenter
-
Mark Sapiro