Closed Bug 1038836 Opened 11 years ago Closed 11 years ago

[email/backend] Mailing list text/plain footers added (with a multipart/mixed container) to text/html parts are detected as unnamed attachments

Categories

(Firefox OS Graveyard :: Gaia::E-Mail, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: asuth, Assigned: awissmann)

References

Details

Attachments

(1 file)

In some fallout from bug 851963 that demonstrates even I have trouble getting through my really long comments (https://bugzilla.mozilla.org/show_bug.cgi?id=851963#c5), the logic I suggested went too generic and is improperly treating a text part as an attachment because of the presence of an explicit disposition of inline. The glodebug tree looks like this: 1 Container (34029 bytes): multipart/mixed 1 Container (33888 bytes): multipart/alternative 1 Body: text/plain (948 bytes) 2 Body: text/html (32940 bytes) 2 Body: text/plain (141 bytes) The footer part headers looks like this: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline The good news is that things like this because much more obvious when you have test cases, and now we have a test case to add! The simplest/most obvious change is to weaken the 'id' requirement if (partInfo.id) { to only happen for non-text parts. Like: // Displaying text-parts inline is not a problem for us, but we need a // content id for other embedded content. (Currently only images are // supported, but that is enforced in a subsequent check.) if (partInfo.type === 'text' || partInfo.id) It's probably worth skimming https://bugzilla.mozilla.org/show_bug.cgi?id=851963#c5 again when fixing to make sure there's not anything else obvious I missed. And certainly if any real-world test cases can be inferred, it'd be good to add them too.
(In reply to Andrew Sutherland [:asuth] from comment #0) > The good news is that things like this because much more obvious when you > have test cases, and now we have a test case to add! Rather, things like this *become* much more obvious. Brain got ahead of my fingers and their memory doesn't have ECC.
Assignee: nobody → awissmann
Attachment #8456482 - Flags: review?(bugmail)
Comment on attachment 8456482 [details] [review] asuth's fix with test case Test pass clean locally after rebasing to master. r=asuth, will merge and propagate to gaia now.
Attachment #8456482 - Flags: review?(bugmail) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: