Import mbox/mbx with attachments

I am following Gerhard’s nice thread Importing mailing lists (mbox, Listserv, Google Groups, emails, ...) on importing mbx posts.

However, it doesn’t mention attachments. How does discourse import deal with attachments?

I am importing mbx files from Eudora. In those files the attachments are referenced with text such as, Attachment Converted: “C:\Data\Email\Attachments\Imagination Mode 3.gif”.

Eudora is able to recognise those attachments, even if they are in a different configured folder.

How can I include attachments in my import?

4 Likes

The import script assumes that attachments are stored within the mbox file. You’ll need to modify the script in order to import converted attachments.

5 Likes

Thanks.

Do you mean the file, /var/www/discourse/script/import_scripts/mbox/importer.rb?

I am not familiar with ruby or the libraries/classes being called here, could you give me a clue on what needs to be modified please?

1 Like

Any suggestions on what I would need to do here?

Or could I put the attachments somewhere on the server and then link to them from the message? I can change the reference path to a URL, if necessary.

If I were you, I would try to migrate your mbx files from eudora to thunderbird mbox files. Thunderbird keeps the attachments in the mbox which is what the importer looks for.

3 Likes

Thanks. Following your suggestion I am using Aid4Mail to convert from Eudora mbx’s to standard mbox files. It includes the attachments inline. They import successfully into Thunderbird, though I don’t need them for that.

Importing into Discourse I use the regex ^From .*@.* [0-9]{4} to find the email delimiter of this sort of form, From xxx@yyy.EDU Mon Oct 18 14:49:04 1999.

The attachments display now in the Discourse posts.

3 Likes