I have tried to understand the concept of pre-approved messages, but I'm spending way too much trying to figure it out. Help!
The scenario is as follows: Mailman installation with hundreds of lists. Each list's owner is only supposed to add/remove members, so approving/rejecting messages is not in the "job description".
Then we have a small group of superusers who will be the ones sending documents etc to all 800 lists. The superusers should be able to do so without being stopped by size limits etc.
How can I achieve this? ---- Thor Atle Rustad ----
On 7/5/18 6:14 AM, thor.rustad@gmail.com wrote:
I have tried to understand the concept of pre-approved messages, but I'm spending way too much trying to figure it out. Help!
There is a list attribute, moderator_password, which is not currently exposed in Postorius and therefore must be set via 'mailman shell'. Here's a sample session.
$ mailman shell -l junk@msapiro.net Welcome to the GNU Mailman shell The variable 'm' is the junk@msapiro.net mailing list
m.moderator_password from mailman.config import config m.moderator_password = config.password_context.encrypt('xxx123').encode('us-ascii') m.moderator_password b'$6$rounds=656000$SKMqTlPybIZSBjYB$wCga5qALCv8oobp4cDql2iKEg8T6qIgk8XEKYbkk9QXENeFQDHZ1M4AtmqfureYQDB5g.Az.nZPrWAr9N9g1N0' commit()
That will set the list's moderator_password to the encrypted value of 'xxx123'. Then, if a post to the list contains
Approved: xxx123
either as a header in the message (recommended if possible) or as the first non-blank line in the first text/plain part of the message, the post will be 'pre-approved'. The header can actually be any of Approve:, Approved:, X-Approve: or X-Approved: and if it is not a header, but is found in the first text/plain part of the message, it will be removed from that part and a best effort will be made to remove it from other text/* body parts in case it is also in an alternative part.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
$ mailman shell -l junk@msapiro.net Welcome to the GNU Mailman shell The variable 'm' is the junk@msapiro.net mailing list
m.moderator_password from mailman.config import config m.moderator_password = config.password_context. encrypt('xxx123').encode('us-ascii') m.moderator_password b'$6$rounds=656000$SKMqTlPybIZSBjYB$wCga5qALCv8oobp4cDql2iKEg8T6qI gk8XEKYbkk9QXENeFQDHZ1M4AtmqfureYQDB5g.Az.nZPrWAr9N9g1N0' commit()
Thank you, this worked permanently. Now, how can I loop through all 700 lists and change the list password on all of them?
Thor
2018-07-09 10:49 GMT+02:00 Thor Atle Rustad <thor.rustad@gmail.com>:
$ mailman shell -l junk@msapiro.net Welcome to the GNU Mailman shell The variable 'm' is the junk@msapiro.net mailing list
m.moderator_password from mailman.config import config m.moderator_password = config.password_context.encryp t('xxx123').encode('us-ascii') m.moderator_password b'$6$rounds=656000$SKMqTlPybIZSBjYB$wCga5qALCv8oobp4cDql2iKE g8T6qIgk8XEKYbkk9QXENeFQDHZ1M4AtmqfureYQDB5g.Az.nZPrWAr9N9g1N0' commit()
Thank you, this worked permanently. Now, how can I loop through all 700 lists and change the list password on all of them?
Thor
I think I can answer this myself. I found inspiration here:
https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/V...
and was able to do the following to change the moderator password on all lists:
'>>> from zope.component import getUtility
'>>> from mailman.interfaces.listmanager import IListManager
'>>> listmanager = getUtility(IListManager)
'>>> for mlist in listmanager.mailing_lists:
'... mlist.moderator_password = config.password_context.encrypt('secret_pa$$word').encode('us-ascii')
'... commit()
'... print(mlist.list_name)
Seems to work :-)
participants (3)
-
Mark Sapiro
-
Thor Atle Rustad
-
thor.rustad@gmail.com