Closed Bug 560346 Opened 14 years ago Closed 7 years ago

PDF attachments corrupt when downloaded through IMAP

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
Windows 7
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: benwishaw, Unassigned)

Details

(Keywords: dataloss)

Attachments

(7 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.2pre) Gecko/20100302 Lanikai/3.1b1

Some PDF attachments cannot be opened from messages. This has happened on 2 separate systems (Win 7 and Win XP). Accessing the emails attachaments through a different program (squirrel Mail) allows the PDF files to be viewed correctly.

There has been one situation where one Lanikai system had a corrupt email while the same email opened on the other Lanikai system allowed the PDF to be opened.

The email server is hmailserver and the emails are downloaded via IMAP.

Reproducible: Sometimes

Steps to Reproduce:
1. Try to open an pdf attachment
Actual Results:  
Acrobat Reader opens a dialogue box stating the file is corrupt 

Expected Results:  
File opens ad allows me to read the pdf
can you share an email example ? if so goto File -> save. and come back to this web page and click on the add attachment link.
(In reply to comment #0)
> Some PDF attachments cannot be opened from messages. This has happened on 2
> separate systems (Win 7 and Win XP).
> Accessing the emails attachaments through a different program (squirrel Mail) allows the PDF files to be viewed correctly.

> Reproducible: Sometimes
> Steps to Reproduce:
> 1. Try to open an pdf attachment
> Actual Results:  
> Acrobat Reader opens a dialogue box stating the file is corrupt 

Save the pdf attachment to a file(.pdf) by both Tb and different program (squirrel Mail).
Same file size?

Tb uses RFC822.SIZE upon FETCH of mail data. And some problems of hmailserver are found by Google search for "hmailserver rfc822.size". And Tb relies on value returned to RFC822.SIZE according to RFC.
Attached image File size information
I have found the emails that I was having trouble with seem to work correctly now. While downloading the files I did notice the size reported was greater then the data downloaded. 

This must be a hmailserver issue though it never came up with earlier thunderbird that I can remember.
I have seen this behaviour with dovecot mail server, too. 
Pdf opens correctly on the first time after rebuilding index, but fails on the next time.
Attachments opens without errors by using squirrelmail.

I think, I have seen this error on Thunderbird versions 3.6.4 and 3.1 at least, but I'm not sure.

Unfortunately I cannot send a sample mail now, but I will try to find one.
> I think, I have seen this error on Thunderbird versions 3.6.4 and 3.1 at least,
My typo, meant to say versions 3.0.4 and 3.1.
These are samples of a good and bad pdf file when working with IMAP & Thunderbird 3.1.2. The bad was the saved attachment from Thunderbird, the good came directly from my mail server (in this instance a godaddy server).

Michael mentioned an issue with RFC822.SIZE and certain IMAP servers, but I don't know how to check whether the godaddy servers have this problem.
RFC822.SIZE related issues are summarized to bug 92111(MS Exchane) and bug 390795(non MS Exchange). For non-RFC822.SIZE issue, see bug 572974.
(In reply to comment #6)
 
> Michael mentioned an issue with RFC822.SIZE and certain IMAP servers, but I
> don't know how to check whether the godaddy servers have this problem.

You'll need to log protocols and then compare what you see with the bugs mentioned by Wada-San.
Produzed output by opening pdf direct from thunderbird to PdfExcange. This is the file from temp directory. 
Open this with texteditor and see that there is the message Text insige but no atteachment! 
When i do"save as" it works all ok!

I have this bug very often!
I am fairly clueless, so if this issue has been resolved elsewhere I would appreciate a link or a translation of how to get TB to work with IU's mail severs!
We have the same issue here ; when a mail comes with an attachment, users can fetch it the first time they click on it ( randomly though, sometimes they can't fetch it at all ), but the pdf ( or xlsx, or docx ) get corrupted the second time, with a dumb size.

Removing .msf files on the user profile solves the problem, but it is of course not an acceptable solution ^^

We use Cyrus as IMAP server, and with roundcube, users can fetch the attachment without any problem.

I found https://bugzilla.mozilla.org/show_bug.cgi?id=434054 which seems related ( if it helps ).
File 1: "Lieferübersicht.eml" an eml file with an atteachment, 
File 2: "Despatchoverview.0519865-2.pdf" the corrupted atteachent created by direct open and 
File 3: "Despatchoverview.0519865.pdf" the original pdf by saving to file

still the same with tb 3.1.10 (html text of the message is in the file)
I think my bug doesnt corrupt the file. In the extracted file for direct open by doubleclicking the atteachment is the message Text in HTML!!
This is an example of the file corruption on Ubuntu 11.04 and TB 3.1.10. Note the difference in size. The original file was downloaded using webmail, while the corruption happened by Thunderbird when downloaded using imap on our MS Exchange server.
Component: General → Networking: IMAP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap
The problem persist in TB 6.0.2 Mac: 95% of attachments will be corrupt when downloaded from IMAP accounts. But if you download it from webmail, everything fine.

Thanks

Andrea Moretti from Italy
is this gone, or still happen with current version?
Severity: normal → critical
Keywords: dataloss
n.b. bug 92111, so this should be tested against Tbird version 16
(In reply to Wayne Mery (:wsmwk) from comment #17)
> n.b. bug 92111, so this should be tested against Tbird version 16
Flags: needinfo?(guillaume)
Anyone else see this?
Guillaume writes it's ok know - We can close the case
Flags: needinfo?(guillaume) → needinfo?
Whiteboard: [closeme 2013-01-18]
We still have this Problem with TB 17.0.2. What we observe: Sometimes PDF-Attachments are corrupt (maybe others, too, but no obeservation about it).

What is interesting: If we drag the email to a Windows-Explorer window to drop an save it, the saved EML file can be opened and the attachment as well.
Flags: needinfo?
We have this problem too with ThunderBird 17.0.2 (windows). It is not always the case. I can provide a sample where it is KO and another where it is OK. 
The attachemnt size is not the same as the size shown in the Webmail (TB 17.0.2 size is wrong).
Whiteboard: [closeme 2013-01-18]
I confirm the problem. The Div containing the core content of the mail is saved in place of the attachment in the temp directory with the name of the pdf attachment.

Thunderbird 3.1.20
(In reply to Nicolas BOUSSIER from comment #22)
> Thunderbird 3.1.20
A bit old, isn't it? Can you check current 17.0.5 version?
It´s still on the actual version!
I currently have the same issue with Thunderbird 24.2.0 .
I have the bug on 24.3.0 on Win 7. Everything was working OK until very recently.

I ran in safe mode to remove PDF plug-ins but still when I download the PDF (without an error from Thunderbird), no file is created in the target directory. 

It appears that this only occurs with password-protected PDF files. I get these from my stockbroker. Older files still download OK - even when password-protected -  with the current version of Thunderbird. 

The last password-protected file I can find that I can still open is from 12th June 2013. I then made no more trades until 11th Feb 2014. This is the point at which I first noticed the problem.
Is this still present in latest Thunderbird version?
Flags: needinfo?(slash)
Flags: needinfo?(mke)
Flags: needinfo?(benwishaw)
Whiteboard: [closeme 2017-05-15]
Resolved per whiteboard
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(slash)
Flags: needinfo?(mke)
Flags: needinfo?(benwishaw)
Resolution: --- → INCOMPLETE
Whiteboard: [closeme 2017-05-15]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: