Open Bug 300168 Opened 19 years ago Updated 2 years ago

csv attachments opened as txt


(Thunderbird :: OS Integration, defect)

Windows XP


(Not tracked)


(Reporter: news649, Unassigned)


User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Build Identifier: 

Receive email with a attachment such as file.csv

Double click on the attachment, and, window comes up. It says You have chosen 
to open file.csv which is a text document. I change the default notepad to 
excel.exe, and, excel opens it allright, but, as a text file. It looks awful 
since the columns aren't there, it's just text. Also, the filename curiously 
comes up as file.csv.txt, which is why excel doesn't format it as a csv file. 

So, the workaround of course is to save the file, then, open in excel, which 
of course works fine, just not quite as quick or easy of course.

See thread here:

I did reproduce it with the latest nightly build, and, others seem to have the 
same issue. Also, installed Thunderbird on other pcs, and, they do the same 

Reproducible: Always

Steps to Reproduce:
1.Double click on csv attachment
2 [review].Change the application to use to excel
3.Voila, not opened as a csv file

Actual Results:  
Excel opens the file as text and it does not format it. Using outlook, it 
opens as a csv in excel.

Expected Results:  
Should not have called it a text file, and, instead, the filename that comes 
up in excel using my example should be file.csv, not, file.csv.txt
We are also having this problem. We cahnged the extension from csv to xls, it
still sees it as text.
QA Contact: general
Assignee: mscott → nobody
Component: General → OS Integration
QA Contact: general → os-integration
This problem only seems to occur with the "Open with" dialog, and now with "Save as".  It is not exclusive to xls files, any file which may be understood as plain text is affected (.cpp in my case).
Six years and sevral versions later the bug is still the same. It is not possible to open *.csv in the correct way, since thunderbird adds ".txt" to the file just as described above.
This continues to be a problem. Appending a .txt to a file that already has a valid extension, and not being able to designate what program to open a given attachment and expect it to work seems like a design flaw with a potential work around. Has there honestly been no solution? How many years has this been around?
I have converted our entire office from Outlook to Thunderbird. We are on version 45.2.0. We have this exact problem, exactly as described by the OP. Our entire internal production generates csv files. Amazing that this bug is still out there, unassigned after 11 years.

Any progress? Does someone have a workaround? We may have to revert back to Outlook if there is no solution.
I've found a work-around. As noted above, the problem is when a mail client marks the attachment as Text/Plain. Outlook handles csv attachments correctly (open in Excel) because Excel is a Microsoft product, so it presumably "just knows". To fix this for Thunderbird, the client must send the csv attachment as Content-Type: application/ Thunderbird, as a client, DOES do this (so does Outlook).

I am using mail(x). To make this work with the mailx client, the following entry must exist in /etc/mime.types:

application/        csv

That did the trick for me. Other clients (e.g. mutt), also have mime.type settings.
I have the solution.
12 years after !!!! Yeah !!!
The problem is not in Thunderbird but in Windows (surprising ????).
In the regitry (regedit DOS command), in HKEY_CLASSES_ROOT > .CSV (or .csv) add a string value named "Content Type" with value "application/" or modify it with this value if it already exists.

I hope it will help you.

I've also had this problem for ages. I've looked at various possible causes in the past, but only today have I noticed that even though the email clearly specifies the attachment name:

Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: ATTACHMENT;
Content-Description: "WHHoldingNotWeb.csv"

If you double-click the attachment, Thunderbird creates the temp file with the .txt extension.

If you save the attachment, the proposed file name is correct, and if you drag-and-drop to the desktop the filename is correct.

(Windows 10, Thunderbird 45.8.0, but the problem has persisted for years over many versions of Windows and Thunderbird)
I meant to add that, given that the filename is correctly specified in the email content, and that Thunderbird itself can get it right when it chooses to, any Windows registry hack is just a workaround to what is to me clearly a bug in Thunderbird.
Another note: when opening the exact same email in Outlook the temporary file is saved with the correct name, and interpreted correctly by Excel.  This is all exactly as the OP reported 12 years ago.  I find "Status: NEW" particularly amusing.
I am having the same problem with LibreOffice. I click to open a csv attachment and it opens Libre Calc on the attachment but there is a txt filetype on the file so Calc does not treat it as a spreadsheet. I am on Windows 7
I've just begun to see this same problem - incoming .csv files that used to open directly to Excel now open instead to Notepad. I finally discovered that which of the two (Excel or Notepad) is used depends upon the characteristics of the incoming file, and I have managed to create a minimal test "Inbox" that contains two incoming emails, each with a .csv attachment. One of the attachments causes TB to ask the user to browse for a program with which to open the file (on my real Windows 7, the action is to use Excel), whereas the other recommends Notepad. The only difference between the two attachments is that one of them is one line longer than the other.

The bug also appears only to show itself when the attachments are encoded with base64. If they are sent as plain text, then Notepad is used regardless.

My test environment is a newly-installed Windows 7 Pro, with Thunderbird.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.