diff --git a/service/lists.md b/service/lists.md index 3706dc908ba9fb236108c2899d2660fdba5b9e6d..4b5ca9c554a165ea515f4a256d4e5f2fb7df7439 100644 --- a/service/lists.md +++ b/service/lists.md @@ -695,7 +695,44 @@ details. To migrate a list, the following was used: fab mailman.migrate-mm2-mm3 tor-relays The above assumes a `tpa.mm2_mm3_migration_cleanup` module in the -Python path, currently deployed in Puppet. +Python path, currently deployed in Puppet. Here's a backup copy: + +```python +from __future__ import print_function + +def check_bounce_info(mlist): + print(mlist.bounce_info) + +def check_pending_reqs(mlist): + if mlist.NumRequestsPending() > 0: + print("list", mlist.internal_name(), "has", mlist.NumRequestsPending(), "pending requests") + if mlist.GetSubscriptionIds(): + print("subscriptions:", len(mlist.GetSubscriptionIds())) + if mlist.GetUnsubscriptionIds(): + print("unsubscriptions:", len(mlist.GetUnsubscriptionIds())) + if mlist.GetHeldMessageIds(): + print("held:", len(mlist.GetHeldMessageIds())) + +def list_pending_reqs_owners(mlist): + if mlist.NumRequestsPending() > 0: + print(mlist.internal_name() + "-owner@lists.torproject.org") + +def flush_digest_mbox(mlist): + mlist.send_digest_now() +``` + +It also assumes a `mm3_tweaks` on the Mailman 3 server, also in +Python, here's a copy: + +```python +from mailman.interfaces.mailinglist import DMARCMitigateAction, ReplyToMunging + + +def mitigate_dmarc(mlist): + mlist.dmarc_mitigate_action = DMARCMitigateAction.munge_from + mlist.dmarc_mitigate_unconditionally = True + mlist.reply_goes_to_list = ReplyToMunging.no_munging +``` The list owners to contact about issues with pending requests was generated with: @@ -724,23 +761,10 @@ The following procedure was used for the first test list, to figure out how to do this and help establish the Fabric job. It's kept only for historical purposes. -To check for anomalies in the mailing lists migrations, the following -script was used: - -``` -def check_bounce_info(mlist): - print(mlist.bounce_info) - -def check_pending_reqs(mlist): - print(mlist.NumRequestsPending()) - -def flush_digest_mbox(mlist): - mlist.send_digest_now() -``` - -and called with for example: +To check for anomalies in the mailing lists migrations, with the above +`mm2_mm3_migration_cleanup` script, called with, for example: - sudo -u list /var/lib/mailman/bin/withlist -l -a -r check_list_mm3.check_pending_reqs + sudo -u list /var/lib/mailman/bin/withlist -l -a -r mm2_mm3_migration_cleanup.check_pending_reqs The `bounce_info` check was done because of a comment found in [this post](https://docs.debops.org/en/stable-2.1/ansible/roles/mailman/mailman2-migration.html) saying the conversion script had problem with those, that