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 thoughts on “Setting the Default Mail Client for Firefox

  1. 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!

  2. 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

  3. 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.

  4. Hi,

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

    can anyone offer a clue ?

    Dave

  5. 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

  6. 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

  7. 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s