Unreadable attachments after import

Issue #596 invalid
ercpe created an issue

Some attachment types are unreadable after pilerimporting them from EML files. This affects at least .doc, .docx, .xls and .xlsx files. Images seems to be fine. Tried with both; encrypt_messages and extract_attachments set to 1 and to 0.

After wiping the whole installation and importing a single mail with one attachment, i have the following files: 4000000055e5c005194f8f9400f5502822a9.m and 4000000055e5c005194f8f9400f5502822a9.a1

After unzlibing them, i have a mail in *.m1 and the multipart body of the attachment in the .a1 file.

So maybe this is just a problem in the WebUI. In attachment.php:

      header("Cache-Control: public, must-revalidate");
      header("Pragma: no-cache");
      header("Content-Type: application/octet-stream");
      header("Content-Disposition: attachment; filename=\"" . $this->data['attachment']['filename'] . "\"");
      header("Content-Transfer-Encoding: binary\n");

      print $this->data['attachment']['attachment'];

I think there should be a decode of the multi part body or something?

Comments (7)

  1. Janos SUTO repo owner

    Thanks for the diff, I'll review it soon. Can you check the demo site (http://www.mailpiler.org/wiki/demo) and type

    a: word OR excel

    and check a few docx or xlsx files if they also suffer the problem. Also make sure you double check config-site.php for trailing (or leading ) white characters.

  2. ercpe reporter

    The demo site seems to be fine but since extraneous whitespaces might break downloads for other users too, this patch should be merged anyway.

  3. Log in to comment