COMMENT migrer de mailman2 à discourse

Bonjour,

mailman2discourse is a command line tool to import a mailman2 configuration (as found in the config.pck file) into a discourse category available on PyPI. A user is created for each member of the mailing list and they are notified when a new message is posted to the category (unless their mailman2 option was to never receive any mail). The moderators of a private mailing list become members of a discourse group who can review every new post. If the archives of the mailing list are not public, the discourse category is only visible to a discourse group mimicing the mailman2 membership list.

Install

$ pipenv install mailman2discourse

Usage

Requirements:

  • API Key (from /admin/api/keys/new) with a User Level of All Users
  • An admin user (for instance admin)
  • An mbox importer container with
    • DISCOURSE_MAX_ADMIN_API_REQS_PER_KEY_PER_MINUTE: 60000000
    • DISCOURSE_MAX_REQS_PER_IP_MODE: none
    • Not including - “templates/web.ratelimited.template.yml”
  • The config.pck file of the mailman2 mailing list

To import the listname@example.com mailman2 mailing list:

    $ mailman2discourse --url http://172.19.0.2 --api-key APIKEY --api-user admin \
                      --mailman-config config.pck \
                      --list listname --domain example.com

The import is idempotent, meaning it is safe to run it multiple times, for instance if it was interrupted or when the config.pck file is updated.

The content of the archives can then be imported.

Archive import

The mailing list archives can be imported using the mbox
importer
. The .mbox and .mbox.gz must be placed in a directory that has the
same name as the category created by mailman2discourse.

Bug reports

The best place to report problems is the issue tracker but posting on this topic is also fine.

2 « J'aime »

J’ai commencé à travailler sur ce script l’année dernière (Working on a mailman2 to discourse migration script) et j’ai eu l’occasion de le tester en mai 2021 lors de la migration des listes de diffusion Spip (Les listes de diffusion évoluent : Mailman -> Discourse - SPIP Blog). Le script est encore très jeune, mais je suis désormais confiant quant à son utilité.

L’importation nécessite encore de nombreuses étapes manuelles, et j’aimerais bien disposer d’une commande du type discourse import --mailman2 config.pck mbox-archives-directory qui fonctionnerait « tout simplement ». Cependant, je n’envisage pas de l’implémenter. Je suis satisfait des scripts shell personnalisés (https://lab.enough.community/dachary/rezo-import/-/blob/master/rezo-import) et je ne vois pas comment les généraliser. En tout cas, la logique mise en œuvre par mailman2discourse (Client Challenge) constitue une pièce manquante du puzzle, et je suis heureux qu’elle existe :slight_smile:

2 « J'aime »

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.