Export own messages to MBOX format?

AI-generated summary

The discussion revolves around exporting user messages from Discourse to MBOX format. mnalis inquires whether the user_archive.csv file, generated via the ‘Export your data’ feature, can be converted to MBOX, noting its utility for archiving various message types. pfaffman questions the relevance of MBOX since the messages aren’t emails and suggests generating fake email addresses. mnalis counters that MBOX is a standard for message exchange and expresses a strong preference for it, even if fake addresses are needed. They also mention that while MBOX is ideal, any easy way to read messages offline would be acceptable. mnalis concludes by sharing a Perl script they created to convert the archive to MBOX format.

In user preferences, there is an option to “Export your data” which contains “Request archive” button. When completed, user gets .zip archive which contains (among other things) user_archive.csv which seems to contain user posts and private messages.

Can that user_archive.csv be converted to some standard MBOX format? Are there tools already existing for that?

Since these aren’t email messages (and you don’t have any email addresses) an MBOX doesn’t really make much sense, as it would be a contrivance (you’ll at least need to generate bogus email addresses).

you’re just looking for an easy way to be able to read your messages?

Well, those messages did get sent via e-mail to other people watching the thread, so it was apparently possible to convert them to e-mail format just fine? I’d just like so I myself can have a copy of them too (and not just everybody else except me).

an MBOX doesn’t really make much sense,

Well, I beg to differ. MBOX is an well-supported industry standard for exchanging such “messages”, regardless of their origin.

I get very usable e-mails for RSS post, for various web forum posts (including Discourse!), for Usenet posts, for GitHub issues, for Fediverse posts etc. and I can archive them all in MBOX.

None of those are originally “e-mail” formats, but they all could be / were converted to it, and having them in such format does make sense and is very useful (at least for me, YMMV of course). You can see related post for list of reasons how/why it is very useful.

as it would be a contrivance (you’ll at least need to generate bogus email addresses).

Why would it need bogus email address? As I understand it, user_archive.csv contains my posts, and my email address (as well as my name) is available in preferences.json from that same archive.

But if for some reason it cannot use real email address (e.g. if it might contain other posts than just my own? PM maybe?), I’m fine with with bogus email addresses being used (e.g. claiming to be from Discourse username <noreply@localhost> or whatever).

No, I’d really prefer MBOX format (or Maildir, which I can easily convert to MBOX).

But if that does not exist, then yes – at the very least an easy way read those messages (especially offline, on Debian GNU/Linux system) would be nice too. Do you have any suggestions?

Anyway, since user export was useless to me otherwise, I’ve written a perl script to convert user_archive.csv to MBOX format: GitHub - mnalis/discourse_archive_to_mbox: Converts to Discourse user_archive.csv to Mailbox file · GitHub