Closed Bug 131834 Opened 23 years ago Closed 2 years ago

We should not fetch part we cannot display with mime_parts_on_demand

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bugzilla, Unassigned)

References

Details

(Keywords: perf, testcase, Whiteboard: [wontfix?])

Attachments

(1 file)

This has been extracted from bug 128888. I have a message which the body is a
PDF documment. When I click on the message, it takes a long before we display
the (empty) message. We should not fetch the PDF data during a message display.
The fix is the following:

Index: src/nsIMAPBodyShell.cpp
===================================================================
RCS file: /cvsroot/mozilla/mailnews/imap/src/nsIMAPBodyShell.cpp,v
retrieving revision 1.32
diff -u -2 -w -r1.32 nsIMAPBodyShell.cpp
--- src/nsIMAPBodyShell.cpp	15 Jan 2002 00:43:07 -0000	1.32
+++ src/nsIMAPBodyShell.cpp	16 Mar 2002 01:51:56 -0000
@@ -928,6 +928,12 @@
 
	// message), and that message should be inline, then its body
 
	// should inherit the inline characteristics of that message
+    // but only it's a text part
 
	if (m_parentPart->GetType() == IMAP_BODY_MESSAGE_RFC822)
+    {
+
		if (!PL_strcasecmp(m_bodyType, "text"))
 
		return m_parentPart->ShouldFetchInline();
+      else
+        return PR_FALSE;
+    }

but that will cause a regression as in the response parser, we will not
correctly detecting we are generating a message and not just fetching headers.
This because the actual code expect we always have to fetch message body which
is not true anymore.

We need to reset fDownloadingHeaders after calling msg_fetch_headers.
Status: NEW → ASSIGNED
Keywords: perf
Target Milestone: --- → mozilla1.1
Attached file Test case
Keywords: patch, review
QA Contact: huang → stephend
Product: MailNews → Core
Product: Core → MailNews Core
Assignee: ducarroz → nobody
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
QA Contact: stephend → networking.imap
Status: ASSIGNED → NEW
Summary: We sould not fetch part we cannot display → We should not fetch part we cannot display
Target Milestone: mozilla1.1alpha → ---
is this still reproducible?
Severity: normal → minor
Keywords: testcase
It's difficult to tell. The 36KB test message is just above the 30k threshold given in mail.imap.mime_parts_on_demand_threshold which I'd assume applies in this case, but it's too small to figure if the whole message is downloaded.

I'll try with a similarly structured message, but of a few MB, which should be conclusive. It needs to be hand-crafted though as Thunderbird/SeaMonkey itself can't produce something like this.
Yes, this is still reproducible on current trunk nightlies with the structure provided in attachment 74816 [details], but not with multipart/mixed message.

Test conditions:
 - indexing and offline synchronization are not active
 - disk cache is disabled, memory cache is enabled
 - mail.biff.show_alert and mail.biff.alert.show_* are "false"
 - mail.server.default.mime_parts_on_demand is "true"
 - mail.imap.mime_parts_on_demand_threshold is default 30000
 - message is smaller than size of memory cache

Test cases:
(1) multi-part structure:
  multipart/mixed
    text/plain
    application/pdf

(2) single-part structure"
  application/pdf

Case (1) shows the desired behavior, only the short text part is loaded and displayed, whereas the PDF is only downloaded when opened or the message is copied. This is regardless of the View > Display Attachments Inline setting.

Case (2) shows the behavior mentioned in the bug description, the entire message is downloaded on initial opening, then the attachment shown in the
pane as the only content.

So, this bug is still valid though I don't know how frequently a stand-alone attachment is met in real life. Most if not all e-mail clients will introduce just an empty text/plain MIME part before the actual attachment.
Summary: We should not fetch part we cannot display → We should not fetch part we cannot display with mime_parts_on_demand

Is there value in changing how this works?

Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(gds)

I've never seen an email with a binary attachment as the top level body. However, from what I can tell, it is supported here:
https://searchfox.org/comm-central/rev/1480d9f14070fee52641c2698fc9a104b02ceddb/mailnews/mime/src/mimemoz2.cpp#124
(I assume "friends to the north" == microsoft.)

When I open the attached email, the whole thing is fetched and stored to cache. I guess the reporter would prefer to have only the header fetched and then the pdf body fetched when the attachment link is clicked.
However, per Kai's recent comment here (bug 1675914 comment 8) it looks likely that fetching a single part of a message is a lost cause anyhow. So don't see any reason to address this issue.

Flags: needinfo?(gds)
See Also: → 1675914
Whiteboard: [wontfix?]

I think we can mark this wontfix.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(mkmelin+mozilla)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: