Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Attachments (PDF) #466

Closed
albsch opened this issue Jul 26, 2022 · 11 comments
Closed

Invalid Attachments (PDF) #466

albsch opened this issue Jul 26, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@albsch
Copy link

albsch commented Jul 26, 2022

Recently attachments stopped working properly. Neither preview, nor downloading a PDF works. I can confirm that using another IMAP client the same attachment opens and downloads properly.

Here is a diff for a PDF which was once downloaded with Snappymail (error.pdf) and once with another mail client (valid.pdf). It seems that for the corrupt PDF something is missing at the end of the file.

❯ ls
error.pdf  valid.pdf
❯ xxd error.pdf > d1
❯ xxd valid.pdf > d2
❯ diff d1 d2
29184c29184,29187
< 00071ff0: 3868 0494 bdc6 dc3e 89fc                 8h.....>..
---
> 00071ff0: 3868 0494 bdc6 dc3e 89fc 0115 832c 5d0a  8h.....>.....,].
> 00072000: 656e 6473 7472 6561 6d0a 656e 646f 626a  endstream.endobj
> 00072010: 0a73 7461 7274 7872 6566 0a34 3636 3631  .startxref.46661
> 00072020: 340a 2525 454f 460a                      4.%%EOF.

Affects at least versions 2.15.x and 2.17.x.

@ner00
Copy link

ner00 commented Jul 26, 2022

This has to be very specific, it's working fine for me.

@the-djmaze
Copy link
Owner

To know why your IMAP server is not transferring the whole file, we need some debug info.
https://github.com/the-djmaze/snappymail/wiki/FAQ#how-do-i-enable-logging

Also clear the /_data_/_default_/cache folder.

@kurti500
Copy link

kurti500 commented Jul 31, 2022

I seem to have a similar issue recently: preview not working for some pdfs, downloading the pdf attachment results in a 0kb file.
But working with another web client for the same file.

the-djmaze pushed a commit that referenced this issue Oct 4, 2022
@the-djmaze
Copy link
Owner

I found the above MailSo bug at AfterLogic, maybe it solves it.

@albsch
Copy link
Author

albsch commented Oct 10, 2022

Updating from 2.17 to 2.18.5 fixed the issue, I think. I'll reopen if I encounter it again.

@albsch albsch closed this as completed Oct 10, 2022
@albsch
Copy link
Author

albsch commented Oct 14, 2022

Still happening. A recent PDF with size 185kb is downloaded as size 181kb and corrupted.

@albsch albsch reopened this Oct 14, 2022
@the-djmaze
Copy link
Owner

the-djmaze commented Oct 16, 2022

Is there a way you can place the EML here so i can take a look?

Forward to issue466@snappymail.eu is also fine

@the-djmaze the-djmaze added bug Something isn't working needs feedback Further information is requested labels Oct 16, 2022
@simonbuehler
Copy link

simonbuehler commented Oct 20, 2022

fwiw: with nextcloud i get Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf eval blockiert ("script-src"). when trying to view a pdf attachement , works with rainloop

url is like https://cloud.x.de/apps/snappymail/run/?/Raw/&q[]=/0/Download/&q[]=/b3BlbnNzbA.euPIkNeIOTvTqX9X-H-lhQ.ITRU-LTSTmriBjkHByALfQ9yZ3OT_AngUGYHEV-N2hKNoGSWu4qA6e-ul8hooe4FQi9xhwG-OjWTGMtIJbyh_5fuIX0pKUpy2uvK4K3BsySHNVfR35e9I8jK3VT9fJGkVxNCv7O-3sIUOmCC-SRyrcBkY0CS3_HCvSjxjM_KYmWrk6F5eTAim6fGonqB4kd0_1quRPehsHYpzyEuXlpPyY1FSQTR0WeL8PKie_eq1uEBvWtS31oqWsK5RdVHsQBHzvMf3drsuuUDoOO-374K-yh64-RknRlePwSXqvtfQ1A

edit: actually no attachement download works...

@the-djmaze
Copy link
Owner

@simonbuehler your comment is not related to this issue.
It's related to issue #566

@the-djmaze
Copy link
Owner

I've found a code flow that breaks attachment.
It is partially solved but i need to analyse a few more things regarding the message caching.

@the-djmaze the-djmaze removed the needs feedback Further information is requested label Dec 22, 2022
@the-djmaze
Copy link
Owner

Found it. The values in the link are encrypted with the session token.
Since the token expired all links failed (while message is fetched with 304 Not Modified)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants