The solution is literally in the post above yours.
We should fix the script. Maybe you can create a PR that resolves the issue for everyone?
The solution is literally in the post above yours.
We should fix the script. Maybe you can create a PR that resolves the issue for everyone?
Thanks, that fixed it, sorry about that. In penance for my inability to read I opened Added duplication to name to prevent modification of frozen string exception by adam-skalicky · Pull Request #30325 · discourse/discourse · GitHub to save anyone else the shame of asking a dumb question.
Does this import script make Discourse replicate Mailman 2 email threading in any way (eg using the little Discourse arrow to signify "In-Reply-To) or is it purely chronological (for each thread based on Message-ID, In-Reply-To and References)?
Yes, it does
Cool. Quite a few of my mailing list emails haven’t got the In-Reply-To and References headers that they should have, so might be imported as new topics rather than just replies. From memory, the script uses those headers or subject headers (not both).
I think I might have asked this in the distant past, but are there any non-manual ways of adding these headers to the MBOX file and/or otherwise rearranging the emails before or after importing to Discourse?
It’s possible now to merge topics and keep chronological order so maybe that’s the answer. They’d just be missing the little Discourse arrow to signify who the message was in reply to.
The mbox import script has two phases. The first one is indexing and outputs a SQLite database. You could either modify the data in the SQLite before the import, or you modify the Ruby script.
All the magic of sorting/grouping by subject or headers happens here:
You could add your own logic of grouping if you know how you want to group emails.
It’ll be a while before I even consider something so complex!
At https://bazaar.launchpad.net/~mailman-coders/mailman/2.1/view/head:/Mailman/Archiver/pipermail.py#L669 Mailman 2’s Pipermail seems to look for the following in order of preference:
That combination of approaches seems ideal. In the third case, it might make sense for Discourse not to use the “in reply to” arrow.
From memory, Mailman 3’s Hyperkitty didn’t consider subject at all, which was not as good.