Author Topic: can't open some PDF files  (Read 2031 times)

Offline manub71

  • Newbie
  • *
  • Posts: 2
can't open some PDF files
« on: August 24, 2023, 01:04:21 PM »
Hello,
I'm using last stable version (1.6.2). I can't open some PDF attachment... not all, only in few mails... I don't understand why. On Thunderbird, the mail is ok and I can open or save attachment. But on roundcube, when i open the file, I see en alert box :
Quote
This attachment is suspicious because its type doesn't match the type declared in the message. If you do not trust the sender, you shouldn't open it in the browser because it may contain malicious contents.

Expected: application/pdf (.pdf); found: application/x-empty

If i click on "Show it anyway", the PDF reader open an emty file. If i click on properties, the name of the file is ok, type is application/pdf and size ~116 KB. It seems ok... but if i click on download, the file is also empty (0kb). I have complete confidence in the provenance of the file. And the file work perfectly when i open it from Thunderbird.

Any idea ?
Thanks

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: can't open some PDF files
« Reply #1 on: August 25, 2023, 02:33:51 AM »
That may happen if the IMAP server returns empty result in FETCH request or the file is malformed in some way. You can try with $config['imap_disabled_caps'] = ['BINARY'];

Offline manub71

  • Newbie
  • *
  • Posts: 2
Re: can't open some PDF files
« Reply #2 on: August 25, 2023, 02:56:18 AM »
yes, it's possible that the PDF is not perfectly formed because it's a file generated in PHP by an automatic notification service (but I do not have the possibility to control this PHP code).
Anyway, this config 'imap_disabled_caps' solved the problem nicely.
Thanks a lot.