Closed Bug 444473 Opened 14 years ago Closed 12 years ago

Thunderbird repeatedly makes partial downloads of emails with attachments when Receiving a Folder for work offline


(MailNews Core :: Networking: IMAP, defect)

Windows XP
Not set


(Not tracked)



(Reporter:, Unassigned)



User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv: Gecko/20080623 Firefox/
Build Identifier: versão (20080421) (Portuguese)

Bug:		IMAP folder download problem

Date:		2008-07-08
OS:		Windows XP SP 2 (English)
Machine:	HP Pavilion Notebook
Thunderbird:	versão (20080421) (Portuguese)
Protocol:	IMAP
Internet:	56k dialup at 52kbps

IMAP Server:
- at local email provider in Maceió, Alagoas, Brazil
- nothing to do with gmail or Google

Summary of problem:
- Thunderbird repeatedly makes partial downloads of emails with attachments
	when Receiving a Folder for work offline
- these partial downloads remain as 'deadwood' in the folder file
- consequences: very long download time and useless data left in the folder file
- under these circumstances it is difficult to have confidence that all of a
	folder has really been downloaded

Related problems/bugs:
- the problem appears to be related to the 6 bugs listed by a Bugsilla search
	for: 'truncate attachment'

Reproducible: Sometimes

Steps to Reproduce:
Thunderbird context in which problem occurs:
- new IMAP account
- only headers for folder had been downloaded
- my intention was to download emails (and their attachments) previously
	downloaded by webmail
- attachments known to be good
- folder contains email from 2006
- folder has 191 emails
- 26 emails with attachments
- smallest attachment: 3kb
- largest attachments (over 100kb) in kb: 454, 306, 210, 176, 166
- scattered throughout folder

Action which initiates problem (translated from Portuguese; names may not be exactly those used in the English version):
- Mouse right button on Folder|Properties|Offline|Receive now
Actual Results:  
Problems encountered:
- folder took very long time to download and file grew to double expected size
- during download I took no action, but Thunderbird appeared to repeatedly
	reestablish communications with the server
- when the folder file was examined with a text editor it was found that
	several emails containing attachments had each been partially
	downloaded several times before finally being downloaded completely
- only in the final download of each email was the attachment obviously complete
- in all the other cases the attachment was obviously truncated
- the download failed on 4 emails with attachments as follows:

	mail		times
	size	att.	email
	in Kb	type	downloaded
	----	----	----
	164	jpeg	3
	56	zip	2
	306	doc	15
	33	gif	3

- after exiting Thunderbird and restarting it again offline the emails with the
	truncated attachments failed to appear in the folder header listing,
	and could not therefore be easily deleted

Expected Results:  
A rapid, complete and correct download of the folder, with no 'dead wood' in the folder file.

- the fact that this problem was only seen with emails with attachments may be
	a red herring.
- the problem may be a more generalised download problem which is more easily
	seen in email with attachments as they are larger
- it is possible that the problem could also be triggered by emails which
	simply have a large body, even if they don't have an attachment
- the one factor which suggests that this IS an attachment problem is the fact
	that I observed it with an email as small as 33kb
- this problem is probably an intermittent problem which only manifests itself
	occasionally when downloading over a dialup link which is also being
	used by other applications at the same time.
Version: unspecified → 2.0
After inspecting the contents of my offline folders in Shredder 3.0b3pre, Windows XP, I see multiple copies of the same e-mail as well with partial attachment downloads. Since this is a fairly recent testing profile, but I cannot exactly reproduce if this is still occurring in current nightly builds, leaving unconfirmed but moving to Networking: IMAP for further investigation.
Component: General → Networking: IMAP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap
Version: 2.0 → Trunk
(In reply to comment #0)

There are already known two cases:
 (A) IMAP server lies about mail data length. (Bug 92111, Bug 390795)
 (B) If error occurs during download to offline store,
     Tb won't re-download the partially downloaded data.
     (Bug 386514, Bug 405440)
Get IMAP log, and check IMAP level flow.
1. When problem occurs, disable IDLE support,
   disable automatic "Check for new message" option(s).
2. Create an IMAP folder(offline-use=OFF) at same IMAP server (say Folder-1)
3. Copy the partially downloaded mail to Folder-1.
   (because uid xxx copy "Folder-1" is used, copy is executed at server side)
4. Terminate Thunderbird.
5. Enable NSPR logging for IMAP, (see Bug 402793 Comment #1)
   and restart Thunderbird.
6. Change Folder-1 to offline-use=ON, open Folder-1, check the mail. 
7. Terminate Thunderbird, and check log content.
   See RFC 3502 for IMAP command/response.
   ( )
If timing related issue is involved, timestamp of log is usually required. See Bug 402793 Comment #6 for adding timestamp to NSPR log using DebugView on MS Win.

If and only if Tb's fault is seen in log, and if log analysis by developers is required, attach log file to this bug(never paste, please).
No longer blocks: 468595
Depends on: 468595
Bug 468595 is already fixed. (See Bug 468595 Comment #55 for checkin id)
Can you reproduce your problem with newest trunk nightly build?
> If MS Win, download build. You can test by UNZIP only.
Chris, please, could answer to comment #3? Use latest TB *3.1.x*
Whiteboard: closeme 2010-07-25
Closed as Incomplete due to lack of response to previous question.
Closed: 12 years ago
Resolution: --- → INCOMPLETE
Whiteboard: closeme 2010-07-25
You need to log in before you can comment on or make changes to this bug.