Forcing Thunderbird to treat outgoing attachments properly

by Giles Turnbull

I've spent a comfortable few days being usefully productive, email-wise, thanks to my recent switch from Apple's Mail to Mozilla's Thunderbird.

Then today, I needed to send an attachment for the first time since the switch. I was filing an article for publication on this very web site.

My editor responded with positive vibes about the words, but a puzzled question too: "Could you send me a clean attachment, though?"

Huh? I thought I had.

It turned out that Thunderbird was sending all attachments inline, embedded in the message body, rather than as proper attached files, the behavior I'd intended.

It also turned out, after a quick flick through the preferences, that this isn't something you can toggle on and off. Off I went a-Googling.

You probably know where this is heading. The solution lies in the habit of Mozilla-based software to use something called User Profiles. Every user of Thunderbird is assigned a Profile, which is a series of files controlling how the application has been set up to behave.

There's usually a prefs.js file, in which the application stores all your preferences.

And there's an optional user.js file, which you can create in any plain text editor, where you can add your own preferences.

So, to force Thunderbird to send attachments the way I want it to, all I had to do was create a file called user.js in my user profile directory, and insert this line:

user_pref("mail.content_disposition_type", 1);

Hey presto! Now attachments are attachments once more.

I post this here purely for the benefit of future Thunderbird users who encounter the same issue and, after their own attempts a-Googling, fail to find the helpful Mozilla page that tells all.

But with any luck, a future version of Thunderbird might include a simple GUI switch to control this behavior, and users will be able to rest at ease without worrying themselves about obscure text files hidden in the darker corners of their hard drives.


2005-12-14 18:57:06
An easier alternative
An easier alternative to change advanced preferences in Thunderbird is the following:

Click on Tools > Options.
Select the Advanced pannel and then the General tab.
Click on the Config Editor button.

This will open a window where you can change pretty much all configurable options in Thunderbird, including the one that changes attachment behavior. The file you created by hand on your profile folder is created automatically by doing the edit this way.
This window is the equivalent of what you get by typing about:config on the Firefox URL bar. It holds all configuration variables for the applications, some of which have GUIs, others don't.
I think this attachment behavior is a bit advanced for most people. What should be discussed is what is the most appropriate default value. Since I don't know what the real difference is, I have no opinion on the subject. I just wanted to show you that there's an easier alternative to what you did.

2005-12-15 01:29:30
An easier alternative
Are you referring to the Windows version? On the Mac version I'm using, there is no Options item on the Tools menu.
2005-12-15 04:16:59
An easier alternative
I can't find that in version 1.0.7 (last stable) either, but if you get 1.5 RC 1 @, then you'll find it under "Thunderbird" > "Preferences" > "Advanced": "General": "Config Editor...".
2005-12-15 05:55:54
An easier alternative
Yes, sorry for the lack of full explaination. This is something that was introduced in 1.5, which is in Beta now. It will be released soon, though.
The Options window is accessed differently depending on the system. I explained how to find it on Windows. On Linux it's probably on Edit > Preferences. An for Mac, the parent post has already explained it.
2005-12-15 06:28:04
Different Behavior with 1.5 RC1?
Hmmm, I wonder if the behavior is different with 1.5 RC1. I've sent a number of attachments to folks and not had any issues (I just sent one to my wife who is using OSX Mail and it looks fine to me).

BTW, I just made the switch from OSX Mail myself and have found some extensions that make Thunderbird 1.5RC1 behave a bit more like OSX Mail. You should be able to find all these on the extensions site.

This allows you to highlight a piece of a message and have that be the only thing highlighted in the reply

OpenPGP encryption for Thunderbird. (GnuPGP installed separately)

Correct Identity
This allows you to pick from a drop down box in a new message (or reply) to select from which identity you should send an email

Allows you to have multiple IMAP folders sync whenever email arrives in them. If you don't use IMAP this probably won't be a big deal for you, but for me (who also has server based mail rules), it's a life saver.

Allows you to change the configuration of the date display in the message list pane

And just a couple I like:

Just what it says. Allows you to show HTML mail for just certain messages. Good for us email purists who think HTML email is the antichrist. ;)

Displays your mail quota in the status bar.

Sorts the list of installed extensions. Because I am that anal retentive. ;)

2006-03-08 07:30:39
How do you achieve the same trick with Apple Mail?
2006-03-10 01:17:29

Found the tip very useful, thank you. The Config Editor tool allows one to do the change from Thunderbird but is far from being easy to do. Who would guess that the "mail.content_disposition_type" affects text files attachment formats?! This is a problem I keep fighting with every time I update Thunderbird and it should really be set by default (this is probably because never before I created the user.js file and the profile.js is probably overwritten by newer versions).

2006-04-25 22:20:03
I spent a week emailing resumes with this 'feature' enabled. Great when you're supposed to be an IT guy, using a borrowed wintel box.
2006-04-26 13:10:38
Great tip, thank you! There is still a bit of a problem though with text attachments. I noticed that when I receive latex files (which are plain text files) as attachments and I open them with my favorite latex editor within Thunderbird, they acquire an additional extension .txt, i.e., they are now called filename.tex.txt instead of just plain filename.tex. Any cure for that?
2006-05-02 04:00:09
Don't work for me, keep having trouble. When I view the document source, I see before each .doc file I attach the line:
. Any ideas?

2006-05-02 04:09:29
OK, just checked the mozilla forums on this problem I posted before. See .

The solution that worked for me was to empty the "mimeTypes.rdf" file in the Thunderbird profile folder in /Users//Library/Thunderbird/Profiles//

This file was apparently corrupted - though I never tinkered with it by hand, only through TB preferences - and thought attached MS Word files are "multipart/appledouble".

Hope that helps!

2006-05-22 16:19:49
The main reasonI haven't switched to Thunderbird on my Mac is that I haven't worked out how to get it to use the macs address book. Any advice getting that to work?