Author Topic: Corrupt PDFs  (Read 3516 times)

Offline Omir

  • Jr. Member
  • **
  • Posts: 26
Corrupt PDFs
« on: October 29, 2014, 10:33:00 AM »
We have recently rolled out roundcube to many thousands of users and generally it is behaving well, except for certain PDF attachments.

We have having many reports of pdfs failing to open with adobe reader saying "file is corrupt".

Have examined a few of both the working and broken ones and the difference seems to be the broken ones are missing the last few lines that contain for example:

startxref
665088
%%EOF

Any ideas why certain pdf attachments would seem to get truncated near the end?

Offline Omir

  • Jr. Member
  • **
  • Posts: 26
Re: Corrupt PDFs
« Reply #1 on: October 29, 2014, 12:45:44 PM »
Have looked at the base64 encoded mime part within the physical email file and roudncube seems to be leaving off the final line (ending Qo=). Still have no idea as to why it would do this though

QUMzNjg+PENBNzZBMEM0RTdEOTUyNEZBNUVGOEI1Q0U5OUI1N0I0Pl0vSW5mbyA5IDAgUi9MZW5n
dGggNDcvUm9vdCAxMSAwIFIvU2l6ZSAxMC9UeXBlL1hSZWYvV1sxIDIgMV0+PnN0cmVhbQ0KaN5i
YgACJsaiYwxMDIxtQIIvAsTqBRFMQInac0AWA4jNwPQfSDAyAAQYAIJWBRsNCmVuZHN0cmVhbQ1l
bmRvYmoNc3RhcnR4cmVmDQoxMTYNCiUlRU9GDQo=

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Corrupt PDFs
« Reply #2 on: October 29, 2014, 01:08:29 PM »
Does your server support BINARY extension? Anyway, there were some fixes that might be related to your issue. Try current Roundcube source from release-1.0 branch.

Offline Omir

  • Jr. Member
  • **
  • Posts: 26
Re: Corrupt PDFs
« Reply #3 on: October 29, 2014, 02:00:39 PM »
Just checked and the same happens in latest codebase

Offline Omir

  • Jr. Member
  • **
  • Posts: 26
Re: Corrupt PDFs
« Reply #4 on: October 30, 2014, 11:41:44 AM »
Hi Alec

More info, found my server does support BINARY, however if I edit rcube_imap_generic to hardcode the $binary flag to be false, then the PDFs work again.

Why did you ask about the binary extension, are there known issues with it?

Thanks

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Corrupt PDFs
« Reply #5 on: October 31, 2014, 03:02:00 AM »
Yes. To make sure it's IMAP server issue enable imap_debug in Roundcube and investigate what the server returns. If server returns invalid data we can do nothing about it other than to disable the extension.

Offline Omir

  • Jr. Member
  • **
  • Posts: 26
Re: Corrupt PDFs
« Reply #6 on: November 03, 2014, 08:05:40 AM »
Hi Alec

It did turn out to be a problem with the IMAP server so have disabled extension and all is fine now. Thanks for your responses