Setting the Default Mail Client for Firefox

Until today, every time I’ve clicked a mailto link in Firefox, the clunky old Evolution email program has started churning, and I’ve smacked myself on the forehead and cursed as I waited for that behemoth of an application to load. You see, I use the lightweight Thunderbird, which loads in an instant and is as flexible and powerful as I need it to be. So I wait for Evolution to finish loading a compose window, close that down, copy the mailto link into a Thunderbird composition window, and write my email. It’s a pain every time.

One of the RSS feeds I keep an eye on is Linux Journal’s, and an article entitled “Ten Mysteries of about:config” caught my eye there today. It’s a decent little article by Nigel McFarlane, author of Firefox Hacks, which I just received in the mail this week and which looks promising. One of the mysteries Nigel explains is how to set a default mail client in Firefox on Linux (it’s easy enough in Windows because it’s governed at the system level). It takes only three steps:

  • Open about:config in your browser.
  • Set the preference named “network.protocol-handler.external.mailto” to true; if it doesn’t exist, create it and set it to true.
  • Create a preference named “network.protocol-handler.app.mailto” and set it to the path to Thunderbird. In my case, this is /usr/local/thunderbird/thunderbird.

That’s all there is to it. When I did this and clicked a mailto link, a Thunderbird composition window shot to the foreground and I was in business.

13 Responses so far »

  1. 1

    Konrad said,

    July 15, 2007 @ 6:33 pm

    Hi all,

    Thanks for that tip!
    I still have a problem with that network.protocol-handler.app.mailto option. I want to set this on my Windows machine. My wife wants to use Outlook for mails and stupid WindowsXP cannot handle a default mail client for each user.
    Maybe something is wrong with the path. How do I have to enter the Windows path? With backslash or /?
    C:\Programme\Mozilla Thunderbird\thunderbird.exe
    I also tried quotation marks to take care of the space. No luck.
    Hope someone can help

  2. 2

    Heather said,

    July 15, 2007 @ 6:33 pm

    Thank you so much. This is just the tip that I have been looking for.

  3. 3

    Greg Heilers said,

    July 15, 2007 @ 6:33 pm

    Great tip! However, if like me, you use Sylpheed, a few additional
    steps are required to get it all working properly. See this:

    http://linux.sgms-centre.com/howto/mozilla.php

  4. 4

    Jomy said,

    July 15, 2007 @ 6:33 pm

    Perfect! I have been googling for quite some time to find out a solution for this issue! Thanks for posting this.

  5. 5

    Meme said,

    July 15, 2007 @ 6:33 pm

    Where is About:Config??? I don’t see it in 1.5

  6. 6

    justPoppingin said,

    July 15, 2007 @ 6:33 pm

    Just type:

    about:config

    in the address bar of the firefox browser. It will open automatically.

  7. 7

    Zig said,

    July 15, 2007 @ 6:33 pm

    Thank you for this tip, it works a treat.

    I have noticed though that on my system (Suse 10 64bit) that it only works for creating a new message.

    It does not work (on my machine) if I select to read mail.
    The file I’m pointing to contains the following code so I would expect it to open read mail if the correct ‘parameter’ is being passed to the file:

    function open_mail() {
    if [ ${ALREADY_RUNNING} -eq 1 ]; then
    $MOZ_CLIENT_PROGRAM $X_DISPLAY ‘xfeDoCommand(openInbox)’
    bail $?
    else
    $MOZ_PROGRAM $MOZ_LANG “$@”
    bail $?
    fi
    }

    function open_compose() {
    if [ ${ALREADY_RUNNING} -eq 1 ]; then
    MAILTO=`echo $2 | awk ‘BEGIN{FS=”:”} $1 ~ /mailto/ {print $2}’`
    $MOZ_CLIENT_PROGRAM $X_DISPLAY “mailto($MAILTO)”
    bail $?
    else
    $MOZ_PROGRAM $MOZ_LANG “$@”
    bail $?
    fi
    }

    Manually clicking on the shell file opens thunderbird at the mailbox.

    Should this work for reading mail and if not do you have a similar tip for reading mail?

    Thanks

    Zig

  8. 8

    avantgardaclue said,

    July 15, 2007 @ 6:33 pm

    I am new to linux (ubuntu) and have swapped from the rather clunky evolution to thunderbird also. Most queer, no problems at all in setting it up and using thunderbird as a stand alone application. HOWEVER when i hit an email hyperlink on a web page up pops the thunderbird profile screen asking me to choose my profile, i do, click on ’start thunderbird’ (it’s already open) and it says can’t use this profile because it’s already in use, please choose another profile or create a new one. Very very annoying…. your assistance with regard to this would be most gratefully accepted.

    Thanks… Avantgardaclue in England

  9. 9

    dave_mucha@yahoo.com said,

    July 15, 2007 @ 6:33 pm

    Hi,

    I cannot figure out how to use gmailas the default e-mail under windows XP

    can anyone offer a clue ?

    Dave

  10. 10

    simanek said,

    July 15, 2007 @ 6:33 pm

    Hello,

    I’m a Linux nube and this was a big help. However, I am using Ubuntu and the application file path you provided did not work. After some looking here is the Thunderbird path for Ubuntu 5.1:

    /usr/bin/mozilla-thunderbird

    I think this is also the general location for most of the applications for any former OSX and Windows users wondering where their Applications/Programs folder went to. Thought this might be helpful. Thanks again.

  11. 11

    George said,

    July 15, 2007 @ 6:33 pm

    To add the app.mailto pref, right click -> new -> string

  12. 12

    David Jameson said,

    July 15, 2007 @ 6:33 pm

    I realise that one can set the desired mail program explicitly but if you don’t do that, how is firefox (Linux) determining the “default” program in the first place - is there a file somewhere (perhaps in /etc) that defines default programs?

    Thanks

  13. 13

    Ballenato said,

    July 15, 2007 @ 6:33 pm

    It works perfectly when clicking on a “mailto” link or “sending” the page, but the option Tools > Read Mail doesn’t work. I’ve read that this feature is only available in Windows, is it true? I can’t believe there’s no way to enable it. There’s always a way in Linux!

Comment RSS · TrackBack URI

Say your words