:: Re: [devuan-dev] How to roll out sc…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Rick Moen
Date:  
À: jaromil
CC: devuan-dev
Sujet: Re: [devuan-dev] How to roll out scripted changes to Mailman
Last week, I wrote:

> Hi! Following our Jitsi discussion, I've documented everything you'll
> need to know, on today's meeting pad:
>
> https://pad.dyne.org/code/#/1/edit/yg+TGcFlq2nARNbOlvdz1g/VEhas7ZmiI4-0jNfigD+864d/
>
> I hope that covers everything. If not, please let me know, and I'll
> be happy to improve on that.


Probably it's useful to also provide that material via e-mail, so here's
everything:



Promised to prototype and send to Jaromil a change script for utility
/var/lib/mailman/bin/config_list[1] to roll out DMARC mitigation to
the various Dyne.org mailing lists from the command line. This will
require running as user list at the system shell prompt, i.e., wielding
the Mailman site administrator[2] role, not just listadmin authority.
My recommendation is to test the change script against mailing list
'test', then against devuan-dev, then roll out to other mailing lists
more broadly.

No time like the present, so here's the solution:


Create this two-line file as /tmp/mailmanscript, and chown it to user
'list':

dmarc_moderation_action = 1
dmarc_quarantine_moderation_action = 1

On the Mailman host as root, do su - list to become user 'list'.
(You could do this as user root, but being the Mailman user is best
practices.) Then, to alter mailing list 'test' (running the script
against it):

/var/lib/mailman/bin/config_list -i /tmp/mailmanscript test

To explain that, for setting dmarc_moderation_action, there should be
five possible settings:

Accept
Munge
From
Wrap Message
Reject
Discard

For purposes of the config_list utility, such multiple options are
always numbered as integers from zero upwards, so I believe you will
find that the current value is 0 (zero), meaning 'Accept'. You can view
an ASCII dump of a mailing list's configuration using config_list in
'output' mode, like this:

/var/lib/mailman/bin/config_list -o - | less

Before making the change I mention, do that command and scroll down to
the dmarc_moderation_action item. You should see something like this:

  dmarc_moderation_action = 0
  [...]
  # legal values are:
  #    0 = "Accept"
  #    1 = "Munge From"
  #    2 = "Wrap Message"
  #    3 = "Reject"
  #    4 = "Discard"


The second config item, dmarc_quarantine_moderation_action, is a yes/no
toggle immediately below dmarc_moderation_action. For such toggles, it's
always the case that 0 signifies No, and 1 signifies Yes.

Obviously, it would be an excellent idea to re-run config_list in output
mode after making a change, to review the effects.

To roll out a change to many Mailman lists at once, standard shell
plumbing like 'for' loops are handy, e.g.:

for list in $(/var/lib/mailman/bin/list_lists --bare); do
/var/lib/mailman/bin/config_list -i /tmp/mailmanscript $list
done



[1] https://wiki.list.org/DOC/4.81%20How%20do%20I%20change%20one%20setting%20on%20all%20lists%3F

[2] http://www.gnu.org/software/mailman/site.html