Open Bug 548507 Opened 14 years ago Updated 11 months ago

Malformed attachment is missing when forwarding (Excess part under malformed multipart/related, which is invalid ATTACHMENT, is not attached by Forward Inline of Tb)

Categories

(Thunderbird :: Message Compose Window, defect)

x86
Windows XP
defect

Tracking

(Not tracked)

People

(Reporter: yohan14, Unassigned)

References

()

Details

(Keywords: testcase, Whiteboard: [gs])

Attachments

(3 files)

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.4; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Build Identifier: 3.0.2

only body message of forwarded email, but not the attachment..

Reproducible: Always

Steps to Reproduce:
1. open email with attachment
2 [review]. klik "forward"

Actual Results:  
Attachment not attached

Expected Results:  
Attachment included
Works for me on Vista (Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.8) Gecko/20100216 Lightning/1.0b1 Thunderbird/3.0.2 ID:20100216161403) using inline forwarding.

Does this problem occur also in Safe Mode (see instructions at https://support.mozillamessaging.com/en-US/kb/Safe+Mode)? Do you see any errors on the Error Console?
Component: General → Message Compose Window
QA Contact: general → message-compose
I just found that the problem occurs when I want to forward a PDF Document. it also happens in safe mode..
Using Mozilla/5.0 (Windows; U; Windows NT 6.0; nl; rv:1.9.1.8) Gecko/20100216 Lightning/1.0b1 Thunderbird/3.0.2 I have no problems
Attached file forward PDF fail
you are right I see the problem only to this spesific email..

1. I download the PDF document from that email to local folder
2. I send an email with the PDF document to my email address. 
3. After I get it, I forward it to my email address again and I don't get the problem. But if I directly forward the original email from the sender, I get the problem.

to give you a clear picture.. I give you two screenshots in DOC document (I edit some unnecessary information on the screenshot which are not related to the problem such as email address)..

1. first one, the message with PDF document
2. second one, after I click forward button..you see the PDF document is not attached...
Please attach these two screenshots as separate pictures (using for example Paint to copy, paste, and save); proprietary and malware-ridden formats like .DOC are generally discouraged.

What is likely to be more helpful is if you can attach the email itself that causes this problem. (Or any email that can cause this problem, for that matter.)
To add to this bug report...

Using Thunderbird 3.04 on Win7 OS all software updated per Secunia.

I received an email from a friend 2 days ago with a small jpg type file attached.  The attached file opened with no problem.  I forwarded the email (with attachment as I do often) to a number of friends and received notices back from them that there was no attachment... check my Sent box and sure enough there was no attachment.

Revisited the orig. email and proceeded to forward again but before sending it I check to make sure that the normal attachment window (upper right) was present...nope, no window.

I saved the attached file to disc, created a new email and attached the file and the attachment window (upper right again) was present.  I sent it to myself just to check... the email with attachment was received... I then tested further and forwarded that email that I just received (from me) and the attachment also displayed in that window... so all was good.

In summary... attachment received from friend would not forward but once the attachment was saved and then re-attached to a new email it worked.

Also, running Thunderbird is safe mode presented the same original problem of no attachment "attached".
Can we get the original email that doesn't forward attached to this bug ?
The original email was very basic... that is, it has the sender's address, subject and my email...plus the attachment.

I can send you the email but of course the attachment won't be there because it won't attach...is there a specific email address you want me to send it to.

Also, in both normal mode and safe-mode I get a lot of warnings about...

Warning: Unknown property 'panose-1'.  Declaration dropped.
Source File: about:blank
Line: 11

when I open up emails...any email...
File -> save (choose .eml)

come back here and press the add an attachment link (and if you don't want to do that send *me* the eml file, Would also be very nice if you do that that you give me the bug number in the email - attaching to the bug is prefered though).
Attached file jpg attachment
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100515 Iceowl/1.0b1 Icedove/3.0.4

I have similar problems where forwarding some emails doesn't forward the attachment.  Two example emails I see have 2 attachments: a forwarded email attached and a media file attached (JPEG and WMV files).  When the new outbound email is created, the email attachment gets transferred but the media attachment is left out.
I can confirm here with email testcase attached by yohan14.

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9pre) Gecko/20100815 Lightning/1.0b2 Lanikai/3.1.3pre ID:20100815002816
Severity: major → critical
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: dataloss, testcase
Summary: attachment not attached when forwarding → Attachment is missing when forwarding (Content-Transfer-Encoding: base64)
Yes I am using Ubuntu 8.04 with Thunderbird 3.07 and have been getting the same exact problem but only with very specific emails. The rule seems to be the original email must be text with an attachment, the same problem doesn't occur with forwarded HTML emails at all only "sometimes" with text based emails. My preferred formatting is html in all my replies so there may be a bug in the text->html translation phase.
Hi,

I have a problem with forwarding too. I was in safe mode. I have a filter to auto-forward some mails.
Yesterday, I forwarded a mail containing a .doc attachment, to my gmail account. Gmail received the attachment, but it is only 27 bytes (it is 92 160 bytes in my thunderbird box). I'll see if i can send it to you as attachment.

Here is my build ID : Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6

Thanks for all
See my comment in the comment list.
Today, I received 5 attachment : 3 PDF, 1 odt, 1 xlsx --> All of them were 27 bytes. This is very anoying, I can't get attachments when I'm not at my work station.
(In reply to comment #22)
> I received 5 attachment : 3 PDF, 1 odt, 1 xlsx --> All of them were 27 bytes.

lapsus63@gmail.com, you are looking bug 570914 insted of this bug, aren't you?
> Bug 570914 When working with IMAP attachments are sometimes corrupt
> (if base64 encoded part, data of "This body part will be downloaded on demand."
> is base64 decoded upon save and 27 bytes file is created.
> offline-use=on, auto-sync is paused by new mail click)
View message source, or save as .EML file, and check mail source.
Ooops very sorry about that. I thought I found a similar problem like this bug, but you're right, I'll forward my comments to #570914, which seems to be more appropriated.
Thank you very much for your suggestion.
This bug occurs in one user of several (in our network).

The user is working on two PC (with windows xp and windows 7)
Thunderbird is configured for IMAP mailbox.
Forward any messages with attachments (doc, xls, pdf, one or many) gives the effect described above -- attachments do not appear to forward mail.

Install version 2.0.0.24 3.0.11 3.1.7 bug does not heal.
Creating a clean user profile bug does not heal.

At the same time 5 other users with any version of Thunderbird, any version of windows and Linux, this problem is not observed.
I have this same issue for years now. I get an email a month I want to forward. I
have created a filter to do so. The mail is always forwarded correctly, but the PDF-attachment is always replaced by a 27-byte file.
Forwarding it manually to the same address works fine.
Whiteboard: [gs]
This bug still happens in TB 12. I have noticed for me that it only happens on some attachments. What I have found is that the attachments that do not forward show up as "unknown size". Thunderbird does not seem to know what the size of the attachments are and therefore does not include them when forwarding.
(In reply to dfoulkes from comment #10)
> Created attachment 441004 [details]
> jpg attachment

Where can we see ATTACHMENT in the multipart/related mail?
  multipart/related
    multipart/alternative
      text/plain
      text/html
    image/jpeg
If image/jpeg part is ATTACHMENT, it should be sent in following structure.
  multipart/MIXED
    multipart/alternative
      text/plain
      text/html
    image/jpeg
Definition of multipart/mixed, multipart/related, multipart/alternative is pretty clear.

For convenience of user, Tb shows the image/jpeg part under multipart/related as if "Attachement in multipart/mixed" when the image/jpeg part is wrongly placed under multipart/related, in order to provide a way to "Save As File" to user.
Such quirks for such malformed mail is not implemented in Forward, because "forwarding malformation" is not good behavior as mailer.
If you need to forward malformed mail, use "Forward As Attachment" for such mail, please.
Removing "base64" from bug summary to avoid confusion.
Summary: Attachment is missing when forwarding (Content-Transfer-Encoding: base64) → Attachment is missing when forwarding (Excess part under malformed multipart/related, which is never valid ATTACHMENT, is not attached by Forward Inline of Tb)
Why can this bug be "Severity=critical"?
Even if this bug is "VALID", it should be "Severity=Enhancement", isn't it?
Hi, so I am far from tech savvy and may not be reading these comments correctly and totally missed it, but what is the resolution to this issue?

I have a filter set up to forward emails with a certain subject line, these emails come from another email account with pdf attachments. The emails forward properly but the attachments come in as a page with a single line of random characters. 

If I bypass the automatic forward (remove the filter) and manually forward the messages the pdfs come in properly.

Any thoughts?

Thanks,
ale
It's July 2014 and even after almost 4 and half years this is not yet fixed. Very unpleasant.

Same problem using Thunderbird 24.5.0 (!) on Ubuntu 12.04 LTS. Forwarded message should contain the attachements from the original message without the need of first saving them manualy from original message and then attaching them manualy to the forwarded one.

You do not need to hurry fixing it, I am using Thunderbird only in work. It may stay unfixed for next 4 and half years, I don't care.
Joe, Joshua, any thoughts on this point? ...

(In reply to WADA from comment #30)
> Why can this bug be "Severity=critical"?
> Even if this bug is "VALID", it should be "Severity=Enhancement", isn't it?
Flags: needinfo?(jsabash)
Flags: needinfo?(Pidgeot18)
I suspect that the severity was set to critical on the basis that this a dataloss bug. Honestly, though, in my opinion, arguing about severity levels is pointless noise since I stopped caring about them years ago.
Flags: needinfo?(Pidgeot18)
The relevant questions are better stated as...

Is really a "bug", i.e. broken per spec, i.e. valid bug?
And if not, should it still be fixed, i.e. taken as an enhancemnt.
Should be critical to the mailer that is responsible for sending malformed mail. I don't think this is a very common problem though.
Flags: needinfo?(jsabash)
(In reply to Joe Sabash from comment #36)
> Should be critical to the mailer that is responsible for sending malformed
> mail. I don't think this is a very common problem though.

It still turns up in Support, and Microsoft Outlook apparently is the usual source of the mail,  so I think frequency is relative as Outlook has some huge percentage of the desktop client market.
I'm now seeing this bug in Thunderbird v31.2.0, it was OK prior to this update.
Same problem here... Thunderbird v31.2.0
Same problem here. Icedove 31.3.0 on Debian.
One of our customers is having the same problem with Thunderbird 31.5.0...
(In reply to Luca Nonato from comment #41)
> One of our customers is having the same problem with Thunderbird 31.5.0...

I am starting to think it's a security enhancement rather then a bug.
Is it?
(In reply to Elico from comment #42)
> I am starting to think it's a security enhancement rather then a bug.

Yes, this is enhancement request, never "security enhaancement" though.
multipart/relative can not contain ATTACHMENT. "Sub part which can be called ATTACHMENT" can be contianed in multipart/mixed only.

Current problem is:
  Tb has quirks for "non used sub part under multipart/related".
       Show the "non used sub part under multipart/related" as if attachement file, in order to provide a way to save the subpart as file.
  So, the "non used sub part under multipart/related" looks for user ATTACHMENT under mutipart/mixed.
  Then, bug like this is opened repeatedly.
Another problem.
   Because of malformed mail, correction of it should be requested to mail sender.
   However, anyone can open BUG at bugzilla.mozilla.org, so user opens BUG at  bugzilla.mozilla.org instead of rquesting to sender.
Reason of Severity=critical.
   Someone set keyword=dataloss. keyword=dataloss usually implies "critical", so some other one set Severity=critical.
   Actually dataloss? Data still exists in a mail which user holds, and user can save it as file any time.
.
(In reply to WADA from comment #43)
<<SNIP>>
>    Because of malformed mail, correction of it should be requested to mail
> sender.
>    However, anyone can open BUG at bugzilla.mozilla.org, so user opens BUG
> at  bugzilla.mozilla.org instead of rquesting to sender.
> Reason of Severity=critical.
>    Someone set keyword=dataloss. keyword=dataloss usually implies
> "critical", so some other one set Severity=critical.
>    Actually dataloss? Data still exists in a mail which user holds, and user
> can save it as file any time.
> .

So the main issue is complexity and not something else...
There are many mail clients which allows and implements this requested feature as needed for any business use.
Indeed there is always the option to right click on the mail and then in the "Forward As" menu check that "Attachment" option.

Instead of over-complexing the issue, can the default action of the Forward button be tunable?? or atleast can be added to the "Forward" menu as another option of the button?
(In reply to Elico from comment #44)
IIRC, Tools/Options(if Win), Composition/General, Forward messages : Inline , As attacment, is inherited from Nescape Messenger by Mozilla MailNews, Mozilla AppSuite Mailnews, SeaMonkey Mailnews, and Thunderbird, although panel name, option name etc. depends of product.
This option is "Thunderbird option", not "per account" nor "per identty option".
same problem here... Thunderbird 31.7.0 on mac osx
Can confirm this bug on 38.3.0 on Windows and expecting some sort of resolution or even a quick fix-up.
I have been reading through this discussion and other similar ones. This problem has been around now for years. Isn't it about time someone solved it? It is definitely a widespread problem with people finding the same issue on various platforms. Surely this must be solveable.
Thunderbird is basically a good piece of software but these annoying bugs that are not dealt with can drive you crazy!
Same problem with one of my client... my observation:  this happens with uppercase extension... forwarding .pdf is not a problem... forwarding email with .PDF attachments, attachments are not sent.
I can confirm this issue with TB 45.2.0. While forwarding E-Mails including an attachment works for me in general, it does not work when I try to forward malware E-Mails I receive (including locky-style .zip files).

Of course one could argue that I should not forward malware to other users anyways, but there still is a use case: Check an E-Mail by forwarding it to virustotal.com (to scan@virustotal.com with subject SCAN). Personally, I do that in the hope that virustotal spreads the sample to anti virus software manufacturers.

While I notice that locky-style malware is the only sort of attachments where forwarding does not work (for me), I guess that this is exactly the intent of the attackers. Meaning that the cost of being detected via virustotal and similar services seems to be rated higher than the benefit of infecting another ordinary reciever (victim).

I just tried out some old samples (from 2016-08-25) which I forwarded to virustotal earlier (including attachment, so this once worked). Now I tried the same with the same old sample and it does not work any more. Looks like a regression or some new protection mechanism to me.
I regularly experience errors in forwarding attachments when the forward is part of a message filter on my inbox.  My untested hypothesis had been the attachment was not fully downloaded before the forward occurred.  I am running Thunderbird 45.4.0 on Linux Debian.

I do not experience any problem when sending a message using the normal forward command from the inbox.
I too experience errors when forwarding using a message filter. The attachments are truncated and the recipient only receives 287 bytes. This seems to occur with PDFs with upper case extensions only. Manually forwarding works without issue.
My environment is Windows 7, Thunderbird 45.4.0 using IMAP account on Exchange
Two off topic posts.  I was ignoring it, but having another just makes it harder.  Sorry for the noise here folks.

TO Lee and Marc.  What you are complaining of is not this bug,  but a timing issue with the receipt of the mail to the filter forwarding it.  Change the execution of the filter to "after Classification"  should largely or entirely eliminate the issue. Using after classification means the message needs to already be downloaded for the spam filter to execute on it.

I would encourage you to take the discussion to bug 669573 which I think accurately reflect your issue.
Have been loosing clients and therefore work because of this. 
Can´t believe nobody fixed this in 6 years. 
Thunderbird 45.4.0 on Windows 10. 
Love Open Source but regretably have to say bye bye thunderbird, hello Outlook.
(In reply to ichwillkeinspam from comment #54)
> Have been loosing clients and therefore work because of this. 
> Can´t believe nobody fixed this in 6 years. 
> Thunderbird 45.4.0 on Windows 10. 
> Love Open Source but regretably have to say bye bye thunderbird, hello
> Outlook.

Would you prefer Thunderbird did what it should and simply never displayed the incoming defective attachment at all?  So you could right to those sending you garbage formatted emails, ask for them again and then send a third request ad nauseam.  Probably not.

You click reply or forward.  No attachment.  So are you saying you do not check that the mail has an attachment before you click send? Or are you seeing some other bug?
(this doesn't qualify as what we normally consider to be dataloss)

bugs with similar behavior seen in bug 558128 and bug 753215
Severity: critical → normal
Keywords: dataloss
Summary: Attachment is missing when forwarding (Excess part under malformed multipart/related, which is never valid ATTACHMENT, is not attached by Forward Inline of Tb) → Malformed attachment is missing when forwarding (Excess part under malformed multipart/related, which is invalid ATTACHMENT, is not attached by Forward Inline of Tb)
> Would you prefer Thunderbird did what it should and simply never displayed
> the incoming defective attachment at all?  So you could right to those
> sending you garbage formatted emails, ask for them again and then send a
> third request ad nauseam.

My use case was to forward attachment to virustotal.com to check for malware.

Now that Thunderbird shows me the attachment, expected behaviour would be that I also can forward the payload.

For my use case, I could theoretically ask the attacker to send me the malware again in a well-formatted E-Mail (while formatting is not necessarily the reason and needs to be reproduced first).

In practise, the sender might have used a faked address. And even if not, the attacker might not want to help me to expose the payload to virustotal.com and thereby to the security companies.
Besides that, I have a strong indication that this issue is a regression in Thunderbird (see my previous comment at https://bugzilla.mozilla.org/show_bug.cgi?id=548507#c50). That even holds true for E-Mail attachments which I could forward with previous versions of Thunderbird.
(In reply to Matt from comment #53)
> Two off topic posts.  I was ignoring it, but having another just makes it
> harder.  Sorry for the noise here folks.
> 
> TO Lee and Marc.  What you are complaining of is not this bug,  but a timing
> issue with the receipt of the mail to the filter forwarding it.  Change the
> execution of the filter to "after Classification"  should largely or
> entirely eliminate the issue. Using after classification means the message
> needs to already be downloaded for the spam filter to execute on it.
> 
> I would encourage you to take the discussion to bug 669573 which I think
> accurately reflect your issue.

Matt, I apologize posting in the wrong place.  Your diagnosis is correct and the recommended fix does solve the problem.  The phrase "after Classification" appears to be different than I anticipated; I thought it would move my message to a junk category before running the rules, rather than just calculate the junk score as it now appears.  Many thanks!  Lee
(In reply to Thomas Mayer from comment #57)
> My use case was to forward attachment to virustotal.com to check for malware.

Why you use "Forward as Inline" even though purpose of your forwarding is "malware report"?
If such purpose, use ForwardAsAttachment(Message->Forward as->Attachment), instead of ForwardAsInline(Message->Forward as->Inline) or "Forward with option setting of forward:Inline".

In usual environment, Options->Composition->General,Forward messages:Inline is set by default, so default forwarding is usually "forward as inline".
Because this is "Thunderbird wide setting", it's not convenient for ad hoc "forward as attachment".
In old days, "Shift+Forward" was used for "Forward as opposite mode to Forward messages: setting".
In a Thunderbird release, sorting out of "Shift in message composition" was made, and "Shift in message composition" is changed to now consistent in Thunderbird, and "Shift in message composition" is now "Compose a mail in opposite mode to composition mode setting(HTML or Text) in prefs".
And, "Message->Forward as" was imported from SeaMonkey by great efforts of volunteer developers. It's independent from "Options->Composition->General,Forward messages:" setting.
"Show non-displayable part in malformed mail as-if attachment in Attachment Pane" is a quirks to provide a way to save such malformed part as a file on HDD, which was also implemented by great efforts of volunteer developers.
There is still no way to distinguish "malformed non-displayable part in malformed mail" and "actual attachment part in properly formatted mail" at Attachment Pane of Thunderbird.

Even if any user can post any comment to any *BUG* of B.M.O, B.M.O is for developers(majority is volunteers) to implement software, to fix bugs of Mozilla family software.
B.M.O is never support forum nor Customer Support Desk.
Please don't post comment for merely complaint.
Please post comment which helps to resolve actual bug(flaw in code which is different from design, flaw in design which is wrong) by volunteer developers.
If new feature/new functionality request, please add comment only for helping implementation of the new feature/new functionality request.
I think following request is reasonable,
  "different icon" at Attachment Pane for :
  (a) malformed non-displayable part in malformed mail,
      which is shown as-if attachment at Attachment Pane by Thunderbird
  (b) actual attachment part in properly formatted mail
because phenomenon of this bug is pretty confusing for user,
if user received malformed mail,
and if user did "forward as inline" on the malformed mail,
and if the malfirmed mail contains "malformed non-displayable part".
IIRC, this is requested by other bug, although I'm not sure.
New feature of "Kill Forward As Inline if malformed mail" may be better.
If such feature, 'option to Kill "kill Forward As Inline if malformed mail"' will surely be requested by some users.
Severity: normal → S3

I understand that this issue is based on malformed e-mail and as such should be resolved at the sender's software. To notify the sender of this issue, it would be helpful to have clear documentation that states that multipart/related mail must not contain an attachment or vice-versa, to send an e-mail including an attachment, e.g., a PDF file, the content-type multipart/mixed should be used. Where can I find the "clear definition" mentioned in comment #28? Is there anything except RFC2387?

NB: This issue has also been discussed on SO and that posting includes python code to generate "malformed" email with attachment.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: