Closed
Bug 231474
Opened 21 years ago
Closed 21 years ago
attachments mix contents
Categories
(MailNews Core :: Attachments, defect)
MailNews Core
Attachments
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: Vladimir.Muller, Assigned: bugzilla)
Details
Attachments
(1 file, 3 obsolete files)
1.60 KB,
patch
|
sspitzer
:
review+
Bienvenu
:
superreview+
chofmann
:
approval1.7b+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; cs-CZ; rv:1.5) Gecko/20031007
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; cs-CZ; rv:1.5) Gecko/20031007
If I get a lot of attachments (30 for example) with only one short line then the content of this file is damaged. Example: File name OP700176.txt, content of this file: 700148022004 113012004.
Mozilla and thunderbird all version. Another mail clients (webmail, outlook, outlook express) work OK.
Reproducible: Always
Steps to Reproduce:
1. Create 30 files *.txt with only one short line.
2. Send all fhis files as attachment in one mail.
3. Read this mail by mozilla or thunderbird mail client.
Actual Results:
Demage content of this attached files.
Expected Results:
The same content of files as origin.
Comment 1•21 years ago
|
||
This bug is independent on the host operating system. I have reproduced it on
SuSE Linux 9.0.
Comment 2•21 years ago
|
||
This bug ocurs only for saved attachments and attachments opened via extertal
viewer. Inline view is OK.
First and second files is damaged in all test cases.
It is repeatable also on mozilla (at least 1.4). Repeatable over both IMAP and POP3.
How to repeat:
for (( i=0 ; i < 30 ; i++ )) ; do echo "This is attachment $i." >file$i.txt ; done
str= ; for (( i=0 ; i < 30 ; i++ )) ; do str="$str -a file$i.txt" ; done
echo "This is a body." | mutt$str -s "Test mail" my@email.address
Now open this mail in Mozilla or Thinderbird and click to attachment file0.txt.
This file contains:
This is attachment 0.
This is attachment 18 [details].
This is attachment 19 [details].
This is attachment 20 [details].
This is attachment 21 [details].
This is attachment 22 [details].
This is attachment 23 [details].
This is attachment 24 [details].
This is attachment 25 [details].
This is attachment 26 [details].
This is attachment 27 [details].
Comment 3•21 years ago
|
||
This code is obsolete for two reasons:
It nearly duplicates code few lines above. Since result is assigned to
Boolean, there is no reason to re-compare the same again.
Comparison using strncmp() limited to strlen(part_to_load) is invalid.
For many MIME parts (>19), comparing part_to_load=1.2 and current
id=1.20, the original (correct) result "unmatches" is changed to invalid
"matches".
Comment 4•21 years ago
|
||
I am attaching another versions of patch. First is only code fix. This one
fixes code formatting around this fix.
Comment 5•21 years ago
|
||
Confirming with TB build 20031217 on Linux and Seamonkey 2004012509 on Windows
XP. The first attachment in the received mail contains data from the following
attachments.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Comment 6•21 years ago
|
||
Comment on attachment 139725 [details] [diff] [review]
mozilla-many-attachments-with-formatting.diff
I'm not the patch author. I was just asked in #mozilla.de to help out using
bugzilla.
But I have tested the patch and it fixes the bug for me.
Attachment #139725 -
Flags: review?(bienvenu)
Comment 7•21 years ago
|
||
Can I get a non-whitespace diff, -uw, so I can be sure of what's being changed? thx.
Comment 8•21 years ago
|
||
See first attached patch -
http://bugzilla.mozilla.org/attachment.cgi?id=139724&action=view - it contains
only code change.
Both patches are identical except formatting.
You can use first one and them reformat manually.
Comment 9•21 years ago
|
||
Comment on attachment 139724 [details] [diff] [review]
mozilla-many-attachments.diff
asking JF for a review. But one comment - if this is the right thing to do,
can't you remove the whole else if clause since there's no code left in it?
Attachment #139724 -
Flags: review?(mozilla)
Comment 10•21 years ago
|
||
Oops. My patch is bad! You are true. Either remove whole else clause, or fill
braces by right code.
Assignee | ||
Comment 11•21 years ago
|
||
Comment on attachment 139725 [details] [diff] [review]
mozilla-many-attachments-with-formatting.diff
I don't have a build environment to test this patch but it does not seems right
to me! The else clause is missing its code!
Now if you totally suppress the else clause, I am pretty sure we wont be able
to display an attached message in a stand alone window (tried to double click
on a forwarded (as attachment) message which itself contains some attachment.
I am worry also about apple double attachment.
Attachment #139725 -
Flags: review?(bienvenu) → review-
Comment 12•21 years ago
|
||
There is another, really minimalistic patch, which fixes the problem for me (it
includes terminal NUL to comparison, so 2<NUL> and 20<NUL> are recognized as
different). But, please review the code around this line.
Attachment #139724 -
Attachment is obsolete: true
Attachment #139725 -
Attachment is obsolete: true
Comment 13•21 years ago
|
||
Can somebody review and commit this new patch (eventually original code around)?
This fixes this bug, too, and shouldn't break anything. Thanks.
Updated•21 years ago
|
Attachment #140956 -
Flags: review?(mozilla)
Assignee | ||
Comment 14•21 years ago
|
||
Comment on attachment 140956 [details] [diff] [review]
mozilla-mix-attachments.diff
Sure this fix solves your problem but it introduces a regresion as well: You
want be able to process multipart attachment such as forwarded message (as
attachment) and appledouble.
The goal of the test is to set output_p to true for the part we are processing
as well all it's sub-part: part=1.3, subpart = 1.3.1, 1.3.2, 1.3.2.1, etc...
Attachment #140956 -
Flags: review?(mozilla) → review-
Assignee | ||
Comment 15•21 years ago
|
||
This path takes care of the problem. It correctly detect subpart of the part we
are processing.
BTW, The trunk build get sometime confuse when opening an attachment and
display the whole message instead of just the selected part. Saving the
attachement however works fine. This is not a regression cause by that fix
Attachment #140956 -
Attachment is obsolete: true
Assignee | ||
Comment 16•21 years ago
|
||
Reassigning the bug to myself...
Stanislav, can you test the patch and make sure it fix correctly your problem?
Assignee: sspitzer → mozilla
Comment 17•21 years ago
|
||
Yes, it fixes my problem correctly.
Assignee | ||
Updated•21 years ago
|
Attachment #143309 -
Flags: superreview?(bienvenu)
Attachment #143309 -
Flags: review?(sspitzer)
Comment 18•21 years ago
|
||
Comment on attachment 143309 [details] [diff] [review]
Proposed fix, v4
sr=bienvenu, but do you really need the cast to const char * when calling
strncmp? the params are already char *
Attachment #143309 -
Flags: superreview?(bienvenu) → superreview+
Assignee | ||
Comment 19•21 years ago
|
||
you are correct, don't need those (const char *) left from the original code.
I'll supress them before check in...
Status: NEW → ASSIGNED
Comment 20•21 years ago
|
||
Comment on attachment 143309 [details] [diff] [review]
Proposed fix, v4
r=sspitzer
Attachment #143309 -
Flags: review?(sspitzer) → review+
Comment 22•21 years ago
|
||
Comment on attachment 143309 [details] [diff] [review]
Proposed fix, v4
requesting 1.7b approval
Attachment #143309 -
Flags: approval1.7b?
Comment 24•21 years ago
|
||
Comment on attachment 143309 [details] [diff] [review]
Proposed fix, v4
a=chofmann for 1.7b
Attachment #143309 -
Flags: approval1.7b? → approval1.7b+
Assignee | ||
Comment 25•21 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: MailNews → Core
Updated•20 years ago
|
Attachment #139724 -
Flags: review?(ducarroz)
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•