Roundcube Community Forum

 

Corrupt PDFs

Started by Omir, October 29, 2014, 10:33:00 AM

Previous topic - Next topic

Omir

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?

Omir

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=

alec

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.

Omir

Just checked and the same happens in latest codebase

Omir

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

alec

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.

Omir

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