Closed Bug 1204505 Opened 9 years ago Closed 3 years ago

Message text deleted when message format=Unknown

Categories

(Thunderbird :: Untriaged, defect)

38 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: MikeScholl, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:40.0) Gecko/20100101 Firefox/40.0
Build ID: 20150826023504

Steps to reproduce:

Addresses in my "Collected Addresses" folder seem to have message format-unknown. Sending to one of these causes the problem


Actual results:

I get a "Could not attach file ...nsemail.html" message. Clicking on OK sends the message anyway but the message text is blank.


Expected results:

The message should have gone as plain text.
OR
I should have been prompted to change the recipient's message format.
AND/OR
There should be a way to change all addresses with format-unknown to either plain text or HTML
You can set the message format in the compose window at Options->Delivery format->...

However, the problem seems to be somewhere else. What kind of message are you composing? Is there HTML formatting? nsemail.html seems to be a TB generated temporary file. You are not attaching it manually?
It is odd. I get the problem on my old laptop running XP. The workaround is to edit the contact I'm sending to and set the contact message format to html (instead of unknown) but this is a bit of a pain if a message has 20 recipients!
I can't find a file called nsemail.html on my computer.
Options->delivery format is set to Auto Detect but if I change it to html it sends the text. If I change it to plain text only it deletes the text.
And no I am not attaching the nsemail file myself.
"Problem occurs if recipient is prefers=Unknow but problem doesn't occur if recipient is prefers=HTML" indicates "problem occurs when Tb tries to send as text/plain but problem doesn't occur when Tb tries to send as text/html".
This "Tb tries to send as text/plain" case itself is alredy known issue. Read "User Story" of bug 1204379, please.

However, if the HTML mail composed by you is being sent as text/plain by Tb, it should be pretty simple format mail, so "Could not attach file  ...nsemail.html" can not occur in usual environmeny or condition.
"when Tb tries to send mail composed in HTML mode as text/plain, Could not attach file  ...nsemail.html occurs" indicates that something wrong exists in mail you composed, or something wrong in Tb's code including addon. 

(Q1) When your problem started to occur? Just after upgrade to Tb 38?
(Q2) Does your problem occur with Tb's -safe-mode? (thunderbird.exe -safe-mode)
(Q3) What is your "Send Options" setting? Ask? Send Text Plain only?
(Q4) How did you initiate the mail composition?
     Compose new mail? Edit As New? Reply? Forward? Edit Draft?
(Q5) What is your sigunature setting?

There is no need of "prefs=HTML in Address Book" to force Tb to try to send as text/html, and there is no need to actually send mail for checking message source, trying some tests.
  As written in bug 1204379, msgcompose.background_color != #FFFFFF can be used as workaround.
  "Send Later" and/or Save As Draft can always be used to check messaage source of mail composed by you.

1. msgcompose.background_color = #00CCCC to easily know "background color is changed".
2. Compose mail, as you always or usually does.
3. Send Later. If asked, choose Both HTML and Plain Text.
4. Go Outbox of Local Folders, and check message source of generated mail.
What kind of HTML is generated by Tb by your mail composition?   

5. msgcompose.background_color = #FFFFFF (default)
6. Compose mail, with same recipient, with same mail data.
7. Send Later. If asked, choose Both HTML and Plain Text.
8. Go Outbox of Local Folders, and check message source of generated mail.
What kind of HTML or text/plain data is generated by Tb by your mail composition?   

If you need to show mail data to developers, save as the mail as .eml file, Edit the .eml file by Text Editor and remove/replace private/personal/confidential data, and attach the .eml file to this bug(not paste), please.
(Q1) When your problem started to occur? Just after upgrade to Tb 38?
Yes that is what I think
(Q2) Does your problem occur with Tb's -safe-mode? (thunderbird.exe -safe-mode)
Yes
(Q3) What is your "Send Options" setting? Ask? Send Text Plain only?
When sending messages in HTML format and one or more recipients are not listed as able to receive html
both plain and html
But I tried changing it to convert to plain and the result is the same
(Q4) How did you initiate the mail composition?
     Compose new mail? Edit As New? Reply? Forward? Edit Draft?
I've only tried new mail and reply
(Q5) What is your sigunature setting?
No signature

I tried changing default background colour Tools->Options->Composition->General but that makes no difference either.

Message source (missing out most of the header)
To: Memorial Hall Contacts <Mike@buckleburymemorialhall.org.uk>
From: Mike Scholl <MikeScholl@btinternet.com>
Subject: test of background workaround
Message-ID: <56002849.2040306@btinternet.com>
Date: Mon, 21 Sep 2015 16:54:49 +0100
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101
 Thunderbird/38.2.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 150921-0, 21/09/2015), Outbound message
X-Antivirus-Status: Clean
X-Antivirus: avast! (VPS 150921-0, 21/09/2015), Inbound message
X-Antivirus-Status: Clean



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
So avast antivirus has added
This may be the answer! If I turn avast outgoing message scanning off the message is converted to plain text and sent OK
So this it an Avast issue and not a TB one?And in the nsemail.html the bit with the avast signature and logo?
(In reply to Mike Scholl from comment #4)
> I tried changing default background colour
> Tools->Options->Composition->General but that makes no difference either.

If so, your case is not Silent-Auto-Downgrade-to-Text because of less HTML formatting.
So, following code is applied.
  (a) if allHtml(all recipients prefers HTML), send as text/html,
  (b) else if allPlain(all recipients prefers Text), send as text/plain,
  (c) else apply Send Options setting.  
 
Your Send Options for (c) is;
> (Q3) What is your "Send Options" setting? Ask? Send Text Plain only?
> When sending messages in HTML format and one or more recipients are not listed as able to receive html
> both plain and html

Your check result.
  (i)   When recipient is prefs=Unkown, problem occurs           : (c) is applied, then sent as Both Text and HTML
  (ii)  When recipient is prefs=HTML,   problem doesn't occur    : (a) is applied, then sent as text/html
  (iii) When Delivery Formaat=HTML,     problem doesn't occur    : sent as text/html
  (iv)  When Delivery Formaat=Text,     "text is removed" occurs : sent as text/plain
Both Text and HTML is sent as multipart/alternative{ text/plain + text/html }
Avast! looks to fail to correctly process mail(add his message to your mail) when mail is multipart/alternative{ text/plain + text/html } and mail is text/plain.

If backgraound color is set, and if recipient's prefs=Unknown, and if Send Options=Ask, Tb asks for send format always upon Send Laater. Because you are asked, you can select send format any case in your test.
So you can do many test cases easily.

> And in the nsemail.html the bit with the avast signature and logo?

I think so.
Even if Tb's problem is involved in phenoenon of "attaching fails on nsemail.html", I believe major cause is never-well-formed inserted HTML by Avast! or excess actions on mail by Avast!, which doesn't care for multipart/alternative and text/plain case.

IIRC, Avast! has option to add his message to your mail.
If you don't need such excess action by Avast!, kill such option.
Needless to say, if you don't need outgoing messaage scan by Avast!, you can disable it.
If you heaavily need such feature, please check more cases, and please report to Avast!.

By the way, because your mail composed in HTML mode is pretty simple(text only), Tb looks to do SilentDowngradeToText on your mail.
> If I turn avast outgoing message scanning off the message is converted to plain text and sent OK.
"background color != #FFFFFF" is to force text/html format, or to force Ask by Send Options, or apply format of Send Options. See bug 1204379 for it, please.
If you prefer text/plain mail, you can use Text mode mail composition. You can toggle mail composition mode by Shift modifier. Shift+Compose Botton click == Start mail composition in opposit mode to one set in account settings.
Mike, have you tried to disable the Avast inserted signature, as comment 5 suggest?
Flags: needinfo?(MikeScholl)
Yes, I've disabled outbound Avast mail checking. And I've tried disabling all Avast mail checking. Neither make a difference. (Not sure why I thought this worked before)
  I've also changed options to "when sending message in html.." to send in html anyway.
My workaround is either to change the address book entry to html or to set the Write window option message format to html.
Both of these work.
But it is only a problem on my Win XP laptop running Thunderbird 38.3. I don't have the problem with 38.3 on Ubuntu or 38.3 on Win 8
It may well be an Avast problem. Perhaps I should use a different anti-virus
Flags: needinfo?(MikeScholl)

This is a well understood Avast issue with avast checking and locking of the term file Thunderbirdvcreates to hold the email body (nsmail.html)

Not a Thunderbird issue.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.