Working on a mailman2 to discourse migration script

Bonjour,

Today I start working on a python script to migrate a mailman2 mailing list (archives and config.pck) using the discourse API only. If anyone is interested, it is happening here and I’ll update this topic with progress.

Any comment on whatever people need or comments about how to better do that are very welcome, of course :slight_smile:

Cheers

2 Likes

digest_members : discarded. It is not possible to request a digest mode on a per-category basis.

Maybe “Watching first post” would be a rough equivalent, depending how often there are new threads/topics and how often in practice a digest was sent on the list.

2 Likes

A first version of the script was published at mailman2discourse · PyPI. It works for me, hopefully it will also help others. If not let me know and I’ll try to adapt the script.

1 Like

How does it deal with lists where from_is_list is set to Munge From or Wrap Message (or the equivalent DMARC-only settings are used)? Is it able to work out which user sent those messages?

It does not, I’ll take a look at what it would require.

1 Like

Thanks. If it helps, the original sender’s email address appears often (always?) appears in the “Cc:” header of the email, at least when from_is_list is Munge From.

from_is_list

from_is_list

  • This applies to all non-digest messages sent by the list. For settings that apply only to messages whose From: domain publishes a DMARC p=reject or p=quarantine policy, see the dmarc_moderation_action description in the Sender filters section.

If set to Munge From, it replaces the From: header address with the list’s posting address to mitigate issues stemming from the original From: domain’s DMARC or similar policies and puts the original From: address in a Reply-To: header.

If set to Wrap Message it wraps the original message as a MIME subpart of an outer message with From: and Reply-To: headers as above.

I don’t think Discourse provides a similar feature. I’ve not seen any site settings that would be a match. And I browsed all email related settings a few times in the past few days, in the context of an ongoing mailman2 migration.

1 Like

Maybe your question is related to how mails are imported from the archives rather than implementing the feature in Discourse?

1 Like

Discourse operates essentially in the same way as Mailman 2 with from_is_list = Munge From – with those settings every Mailman list email is “From: listname@example.com” (rather than “From: joebloggs@email.com”) – and similarly every email notification from Discourse is from the same forum email address (noreply@forum.example.com or whatever).

But I wasn’t really asking about replicating the feature in Discourse. [Edit - as you have realised - I’ve just seen your second reply!]

I was meaning: when this Mailman setting is on, would your script import these messages as being from a single Discourse user (whose email address is listname@example.com), or would it instead be able to identify the original sender?

Hope that makes sense!

1 Like

Thanks for explaining. The mailman2discourse script does not play a role in this because it does not import the messages. The import of the messages is done via the Discourse mbox importer.

I think it would set the author of all mails to listname@example.com. I do not see anything in discourse/script/import_scripts/mbox/importer.rb that would suggest otherwise. It would be a feature to add and maybe control via a use_reply_to_instead_of_from field in the settings.yml file?

2 Likes

I see now, thanks.

Unfortunately I’ve also got reply_goes_to_list set to “This list” (which changes the “Reply-To:” header) so we’d have to think of another solution. Or maybe not… I’ll post a question to the other topic. Thanks for your help.

For the record, the migration script reached a stage where it is usable and a HOWTO is available:

1 Like