Change settings via mailman shell
I am trying to find a way to set some parameters on the lists from a shell script. One specific parameter - max_message_size is not presented through the REST interface apparantly, and i found a way to set this with mailman shell command. Continuing this path i seem not to be able to set any other parameters like this: m.archive_policy = 'never' m.subject_prefix = '' m.dmarc_mitigate_action = 'munge_from' m.dmarc_mitigate_unconditionally = True commit()
However i end up with this error: sqlalchemy.exc.StatementError: (builtins.AttributeError) 'str' object has no attribute 'value' [SQL: 'UPDATE mailinglist SET archive_policy=?, dmarc_mitigate_action=?, dmarc_mitigate_unconditionally=?, subject_prefix=? WHERE mailinglist.id = ?'] [parameters: [{'dmarc_mitigate_unconditionally': 'True', 'dmarc_mitigate_action': 'munge_from', 'subject_prefix': '', 'archive_policy': 'never', 'mailinglist_id': 65}]]
Not sure what to make of it, but it seems like the fields are not there.
I then proceed to get a list of all parameters with information found here: http://docs.mailman3.org/projects/mailmanclient/en/latest/src/mailmanclient/... and the parameters seems to exist - however this list is made with the REST interface - so my question are - are there a difference in parameters in "mailman shell" command and REST interface - and how do i then get a list of parameter and possible settings in the "mailman shell" command ?
Thanks in advance
Kenneth Denmark
On 3/6/19 1:32 AM, kk@eco.cept.org wrote:
I am trying to find a way to set some parameters on the lists from a shell script. One specific parameter - max_message_size is not presented through the REST interface apparantly, and i found a way to set this with mailman shell command. Continuing this path i seem not to be able to set any other parameters like this: m.archive_policy = 'never'
You can't set archive_policy to a string. it has to be set to an attribute of mailman.interfaces.archiver.ArchivePolicy
i.e.
from mailman.interfaces.archiver import ArchivePolicy m.archive_policy = ArchivePolicy.never
See <https://mailman.readthedocs.io/en/latest/src/mailman/handlers/docs/archives.html>
m.subject_prefix = '' m.dmarc_mitigate_action = 'munge_from'
Likewise dmarc_mitigate_action is an attribute of mailman.interfaces.mailinglist.DMARCMitigateAction
See <https://mailman.readthedocs.io/en/latest/src/mailman/handlers/docs/dmarc-mitigations.html>
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
kk@eco.cept.org
-
Mark Sapiro