PDA

View Full Version : HOWTO: Firefox mailto w/ Thunderbird



ming0
March 27th, 2005, 07:00 AM
Some people have problems using mailto links with Thunderbird. To fix the "choose user profile" problem, follow this howto.

Method 1:

THUNDERBIRD: Open with firefox an URL contained in an email

1.) Open Nautilus and type this in the address bar: ~/.thunderbird (if that doesn't work, try ~/.mozilla-thunderbird)

2.) Go your profile directory (with a random-generated name, like this Xbcgev.default). To be sure you're in the correct directory check if a file named prefs.js exists.

3.) File > Create Document > Empty Document highlight it and press F2 to rename the document user.js (If it already exists skip this passage).

4.) Open user.js and write this line (if the file already exists append the line at the end): user_pref("network.protocol-handler.app.http", "/usr/bin/firefox");
/usr/bin/firefox is obviously the path to execute firefox

5.) That's all

FIREFOX: open thunderbird when clicking on a "mailto:" link

1.) 1.) Open Nautilus and type this in the address bar: ~/.mozilla/firefox (if that doesn't work, try ~/.mozilla-thunderbird)

2.) Go your profile directory (with a random-generated name, like this Xbcgev.default). To be sure you're in the correct directory check if a file named prefs.js exists.

3.) File > Create Document > Empty Document highlight it and press F2 to rename the document user.js (If it already exists skip this passage).

4.) Open user.js and write this line (if the file already exists append the line at the end): user_pref("network.protocol-handler.app.mailto","/usr/bin/mozilla-thunderbird");
/usr/bin/mozilla-thunderbird is the path to execute thunderbird

5.) That's all


Method 2: (might be dangerous)

(please back your original TB copy up--some people have had problems with this hack):

1.) Type: about:config into the firefox address bar (press ctrl + T for a new tab)

2.) Right click and choose: New>String

3.) In "new string value" box type: network.protocol-handler.app.mailto click OK

4.) In "enter string value" box enter: /usr/bin/mozilla-thunderbird click OK

5.) Open a terminal and use this command: sudo cp /usr/bin/mozilla-thunderbird /usr/bin/mozilla-thunderbird.bak (this is our backup in case anything goes haywire)

6.) Now use the following command: sudo gedit /usr/bin/mozilla-thunderbird

7.) Press Ctrl + R. In the Search For box, type: Mozilla-Thunderbird. In the Replace with box type: mozilla-thunderbird. Press Alt + M, then Alt + A, then Alt + C, then Ctrl + S, then Alt + F4.

7.) Reset Firefox and try the mailto (test@test.com) link (it should work while TB is on or off)

Note: This is a dirty dirty hack--PM me if you have a more failsafe method, and I'll edit it in :)
Note 2: If you have problems w/ the script, post here, so I know what is going wrong.

Technoviking
March 27th, 2005, 07:59 AM
It does not seem to work for me? Hmmm....

ming0
March 27th, 2005, 10:53 AM
So you get everything done, and it still doesn't work? What happens? The one thing I would try is re-selecting the entire script, and making sure you didn't accidentally miss part of it--then re-copy it into the file w/ gedit. (maybe just try the entire process one more time to be sure)

I tried these steps on my laptop, and it worked just the same... I installed Warty during X-mas and immediately upgraded to Hoary. I think I'm using the firefox backport.

You might try the extension (http://www.extensionsmirror.nl/index.php?showtopic=70&hl=mozex) instead of the about:config.

Let us know what works, and how it goes.

Silwenae
March 28th, 2005, 01:25 AM
Worked perfectly for me, thank you!

Technoviking
March 28th, 2005, 01:56 AM
I rebuilt the script again with gedit, and had no luck. I switch to emacs and it worked fine. Go figure.

Mike

Xeon3D
March 31st, 2005, 04:07 AM
Worked Wonders!

5*****

ming0
March 31st, 2005, 04:40 AM
I rebuilt the script again with gedit, and had no luck. I switch to emacs and it worked fine. Go figure.
Very strange indeed?? The only thing I can really think of is that maybe there needs to be an extra space down at the bottom of the page (I think that some languages and scripts complain when a file ends with no blank space), but I don't know if bash is one of them.

Georges
April 9th, 2005, 11:01 PM
I just thought that the thunderbird scripts are braindead buggy!

I changed the following:

edit /usr/bin/mozilla-thunderbird

and replace every occurence of Mozilla-Thunderbird with mozilla-thunderbird
then it works much better, no need to create a separate script.

I have the following in about:config
network.protocol-handler.app.mailto user-set string /usr/bin/mozilla-thunderbird

Yes, that's all!

Why I did that? Because some bugzilla entries gave me the idea that the script is wrong:
https://bugzilla.mozilla.org/show_bug.cgi?id=259305
https://bugzilla.mozilla.org/show_bug.cgi?id=244060

Now how do we get that correction back into ubuntu, debian and even perhaps mozilla?

At least it's posted here, so ubuntu rules more :-)
Georges

Trickyphillips
April 9th, 2005, 11:41 PM
Works in Mozilla too. 8-)

ming0
April 10th, 2005, 01:03 AM
edit /usr/bin/mozilla-thunderbird

and replace every occurence of Mozilla-Thunderbird with mozilla-thunderbird

Good work! Thanks for sharing--I'll adjust the howto!

raid517
April 17th, 2005, 09:24 PM
Thanks, that worked - I had to reinstall Thunderbird though. But the question now is, how do I go the other way? If I click on a link in thunderbird, how do I get it to launch firefox and visit that address?

GJ

ming0
April 17th, 2005, 09:26 PM
it 'just works' for me...

is firefox your default browser? (system>preferences>prefered app)

raid517
April 17th, 2005, 09:47 PM
Well it doesn't for me. But anyway I found a solution that should help complete your guide.

THUNDERBIRD: Open with firefox an URL contained in an email

1.Go to the .thunderbird directory in your home directory (it is usually an hidden directory like /home/user/.thunderbird)
2.Go your profile directory (with a random-generated name, like this Xbcgev.default). To be sure u're in the correct directory check if a file named "prefs.js" exists.
3. Create an empty file called "user.js". (If it already exists skip this passage)
4. Open "user.js" and write this line (if the file already exists append the line at the end):
Quote:
user_pref("network.protocol-handler.app.http", "/usr/bin/firefox/firefox");


/usr/bin/firefox/firefox is obviously the path to execute firefox

5.That's all


FIREFOX: open thunderbird when clicking on a "mailto:" link

1.Go to the .mozilla directory in your home directory (it is usually a hidden directory like /home/user/.mozilla or /home/user/.mozilla/firefox)
2.Go your firefox profile directory (with a random-generated name, like this Xbcgev.default). To be sure u're in the correct directory check if a file named "prefs.js" exists.
3. Create an empty file called "user.js". (If it already exists skip this passage)
4. Open "user.js" and write this line (if the file already exists append the line at the end):

Quote:
user_pref("network.protocol-handler.app.mailto","/usr/bin/thunderbird/thunderbird");


/usr/bin/thunderird/thunderbird is the path to execute thunderbird

5.That's all

This is for those who find that the first method didn't work.

You may have to adjust the path of your executables for their real locations (e.g. Firefox for me can be found at /usr/lib/mozilla-firefox/firefox) but other than that you should be fine. Also this method should survive a firefox or thunderbird upgrade.

I hope this helps.

GJ

remmelt
April 18th, 2005, 09:59 AM
this doesn't work for me.
I have set the network.protocol-handler.app.mailto to /usr/bin/mozilla-thunderbird in FF, and sed'd the original Thunderbird to the lowercase thunderbird.

Problem is, now I can't start up thunderbird anymore! It tells me it encounters an unexpected and of file, on line 275.

After looking in to it some more, the sed didn't seem to work just right... Thank god for backups, eh? Now I sedded the backup to the original name and all is well.

(edit)
On my other machine as well, same problem. The cat|sed cut the file at 8192 KB... Weird happenings.

raid517
April 18th, 2005, 03:21 PM
That is what happend to me, which is why I posted this alternative (and apparently safer) method. If for some strange reason it doesn't work, just delete the files you created. Nonetheless it is useful to have a choice.

GJ

marsopia
May 7th, 2005, 02:39 AM
Worked for me Thanks!!

Mariano

crazybill
May 7th, 2005, 07:48 AM
Thanks for this tutorial

KillerKiwi
June 4th, 2005, 01:36 PM
A better fix (my opinion), seems like there are some typos in the mozilla-thunderbird script

edit the file


sudo gedit /usr/bin/mozilla-thunderbird

Replace all 'Mozilla-Thunderbird' with 'mozilla-thunderbird'

Save

searles
March 13th, 2006, 12:27 PM
Hi, I tried all, from prefs.js to KContol to preferred application in gnome, but the solution I did not think of is mentioned in this url: http://gnuru.org/?node_id=941.

Check what is your defaultbrowser using

"$ update-alternatives --display x-www-browser"
and change it if it points to a different browser.

"$ sudo update-alternatives --config x-www-browser"

Worked perfectly for me.

Regards

henriquemaia
May 21st, 2006, 07:03 AM
Very useful. I followed this guide since Evolution was refusing to start when I clicked a mailto link on Firefox. Now everything is working great.

Thanks.

vestgarden
May 24th, 2007, 12:00 AM
Great how to :p , what baffles me though as a newbie is why this hasn't been fixed by the Firefox / Thunderbird teams yet. It's over two years since you started this thread :( . But anyways great fix.

Thanks John

Debord
August 24th, 2007, 01:10 AM
Opera as a webrowser to open mailto (in a email writebox) in thunderbird:

In Opera, go to Tools -> Preferences -> Advanced ->
Programs, and select "Use specific e-mail client":

$PATH/thunderbird -compose mailto:"%t"

or only :
mozilla-thunderbird -compose mailto:"%t"

Mozilla- thunderbird as an email-client to open links (in a new page) in Opera:

In Mozilla-thunderbird go to Tools -> Advanced -> Configurationeditor
(you are now in about:config for mozilla-thunderbird)

find for ftp:
network.protocol-handler.app.ftp

click on it and change to:
~/.mozilla-thunderbird/opera-thunderbird.sh

find for http:
network.protocol-handler.app.http

click on it and change to:
~/.mozilla-thunderbird/opera-thunderbird.sh

find for https:
network.protocol-handler.app.https

click on it and change to:
~/.mozilla-thunderbird/opera-thunderbird.sh

Go to your home folder (have to show hidden files) and go then in to the folder:
.mozilla-thunderbird

Make a new textfile and name it:
opera-thunderbird.sh

Open the file and insert text:
#!/bin/bash
exec opera -newpage "$@"

Save the file. Change the file to bee exuteble (rightclick - > securitytab-> make file exutable box).

Done!
:guitar:

That combination rocks!

(excuse my bad english, I am from sweden)

BigDoug
November 23rd, 2007, 10:34 AM
I'm a desktop Ubuntu user, an average Joe, learning Linux, not a guru, not a qualified hacker, so perhaps someone more experienced may be kind enough to correct any errors here.

After installing Swiftweasel the browser would no longer open “mailto:” links by launching Thunderbird. Firefox developed the same problem.
It may not be from installing Swiftweasel, because various forums report this problem with Firefox and Thunderbird not working together with mailto links in websites after updates.

At some point my /usr/bin/mozilla-thunderbird was changed to /usr/bin/thunderbird (a link to a script in /usr/lib/thunderbird/thunderbird). So first check /usr/bin and if you only have thunderbird and mozilla (which links to the script /usr/local/bin/swiftweasel32 – hence my hunch that this problem developed when installing Swiftweasel)there, and not mozilla-thunderbird, this may help. The more complex solutions suggested in various forums may not be needed and did not work for me.

I run Ubuntu 7.10 Gutsy Gibbon 64-bit with 32-bit Firefox, and now, joyfully, Swiftweasel, its soooo much faster.

Here is the technique I used to make mailto links point from Swiftweasel and Firefox to Thunderbird – it is in part borrowed from fixes reported in various forums, including this one.

1) Launch Swiftweasel or Firefox and view the configuration strings using the URL
about:config

2) using the field at the top, search for
mailto

3) If you do NOT have network.protocol-handler.app.mailto (normally
you don't), create it using these steps:
a) right-click
b) choose New --> String
c) new string: network.protocol-handler.app.mailto
d) new value: /usr/bin/thunderbird

4) If you already see an entry for
network.protocol-handler.app.mailto, verify the path to the mail
client. Double click the string to set it if necessary. Also be sure
network.protocol-handler.external.mailto is set to true

5) Do the same in Firefox. Voila! website links mailto: now launch Thunderbird.

Does anyone know if this was an update problem or a byproduct of the Swiftweasel installation? Or am I way off the mark?.

tsnj
January 21st, 2008, 01:41 AM
Recently replaced 64 bit Ubuntu Feisty with 32 bit Kubuntu Gutsy. Kept the same firefox and thunderbird profiles. Mailto links stopped working in firefox, but links in thunderbird work fine.

In firefox, I opened about:config, searched for mailto: and changed the path to reflect my system. WAS: /usr/bin/mozilla-thunderbird, NOW: /usr/bin/thunderbird.

Everything works ok now.

r0g
September 11th, 2008, 07:52 PM
If anyone's wondering how to get Firefox 3 circa Hardy Heron (8.04) to recognise Thunderbird as the default mail client it's thankfully much simpler than it was back when this thread started! Just follow these 3 easy steps...

1. In Firefox go to Edit/Preferences/Applications/Mailto/Use Other
2. Enter the path to Thunderbird. For me this is /usr/bin/thunderbird
3. Profit!


Roger Heathcote - http://movingtoubuntu.technicalbloke.com

stevemds0210
January 28th, 2009, 09:30 PM
Thanks BigDoug. This is an awesome thread. I was a little hesitant to create a new config option in FF from a message more than 3 years old.

It's great that this thread has kept going to keep the info up to date.

Adding a new config option to FF in order for it to open a mail client is a little esoteric for such a common functionality.

buzzbo
April 28th, 2009, 07:14 AM
If anyone's wondering how to get Firefox 3 circa Hardy Heron (8.04) to recognise Thunderbird as the default mail client it's thankfully much simpler than it was back when this thread started! Just follow these 3 easy steps...

1. In Firefox go to Edit/Preferences/Applications/Mailto/Use Other
2. Enter the path to Thunderbird. For me this is /usr/bin/thunderbird
3. Profit!


Roger Heathcote - http://movingtoubuntu.technicalbloke.com

This worked for me. Thanks!
Buzz

eudemus
June 4th, 2009, 09:28 PM
If you've upgraded from Firefox 2 to Firefox 3, the above may not work. But if so, the following might.

Check out this thread
http://ubuntuforums.org/showthread.php?t=860010&page=2

Worked for me when nothing else did.
Basically Firefox 3 doesn't use this "network.protocol-handler.app.mailto" thing any more, but if you've upgraded from Firefox 2, you'll have a load of config data set up for it, which seems to confuse Firefox.

Anyway, that thread tells you how to sort it out.
Cheers,
Eudemus

fermulator
October 19th, 2009, 01:43 AM
CORRECTION:


FIREFOX: open thunderbird when clicking on a "mailto:" link

1.) 1.) Open Nautilus and type this in the address bar: ~/.mozilla/firefox (if that doesn't work, try ~/.mozilla-thunderbird)

Should read:


FIREFOX: open thunderbird when clicking on a "mailto:" link

1.) 1.) Open Nautilus and type this in the address bar: ~/.mozilla/firefox

i.e. firefox is always in ".mozilla/firefox", and definitely not in mozilla-thunderbird.

gimmickless
April 11th, 2010, 06:27 PM
Buzzbo's solution works for me. I run Firefox 3.5.