Results 1 to 10 of 10

Thread: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

  1. #1
    Join Date
    Feb 2005
    Location
    Beaverton, OR
    Beans
    60
    Distro
    Dapper Drake Testing/

    HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    After a recent software update, Firefox and Thunderbird stopped working with each other.
    If Thunderbird was already open, clicking a "mailto" link (email address) resulted in the Profile Manager popping up.
    Prior to the software update(s) this wasn't an issue.
    After a little googling, I found a fix specifically for Debian-based distros that will allow you to click on any mailto link in Firefox and have it open a new mail (including email address and subject line if it's part of the mailto URL) in Thunderbird whether it is running or not (if Thunderbird is running, you won't get the Thunderbird Profile Manager).
    Copy the code below and save it in your home directory as '.firefox-mailto-fix.sh'
    Code:
    #!/bin/bash
    # This script allows FireFox to send mailto: links
    # to Thunderbird
    
    THUNDERBIRD="/usr/bin/mozilla-thunderbird"
    THUNDERBIRD_REMOTE="/usr/lib/mozilla-thunderbird/mozilla-thunderbird-xremote-client"
    
    #echo "Firefox mailto: $*" >> $HOME/log.txt
    
    MAILTO_URL="$1"
    #Strip off the protocol as this confuses Thunderbird
    MAIL_DATA=`echo "$MAILTO_URL" | /bin/sed -s 's/^mailto://'`
    
    if $THUNDERBIRD_REMOTE 'ping()' ; then
    	$THUNDERBIRD_REMOTE "mailto( $MAIL_DATA )"
    else
    	#The mailto needs to be in the format mailto:someone@example.com
    	#eg not mailto://someone@example.com
    	$THUNDERBIRD -P default -compose "$MAILTO_URL"
    fi
    exit 0
    Make the script executable by typing in a term window: chmod 744 ~/.firefox-mailto-fix.sh
    Open the url "about:config" in Firefox.
    If you've tried any of the suggested fixes in these forums, you already have a key named 'network.protocol-handler.app.mailto'. Use the filter box to eliminate the other keys.
    If you don't have the key, right click and add it.
    Give it the value /home/[user]/.firefox-mailto-fix.sh (replace [user] with your username).
    Voila. Now Firefox and Thunderbird play nice again and should continue to play nice unless Mozilla makes drastic changes to the API.
    Last edited by lordofkhemenu; March 5th, 2005 at 09:47 AM. Reason: Typo

  2. #2
    Join Date
    Mar 2005
    Location
    Netherlands
    Beans
    10

    Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    Thanks, that helped a lot. I am only having the problem now that the focus isn't changed. I have to select the compose-window each time.

    Have you an solution for that too?

    Karel

  3. #3
    Join Date
    Feb 2005
    Location
    Beaverton, OR
    Beans
    60
    Distro
    Dapper Drake Testing/

    Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    Quote Originally Posted by quick_snack
    Thanks, that helped a lot. I am only having the problem now that the focus isn't changed. I have to select the compose-window each time.

    Have you an solution for that too?

    Karel
    It does bring it to the front for me, but didn't used to..must be a setting somewhere..
    In 'preferred applications' I have firefox set as the browser (not 'debian sensible browser') and 'thunderbird' as mail reader (not custom|mozilla-thunderbird), but after playing with those settings to see if it made a difference, they're not affecting it..the compose window comes to the front automagically.
    All I can suggest is play with focus settings (system|preferences|windows) and others to see what happens.

    [edit] It doesn't always work..sometimes the compose windows stays at the back
    It's a minor annoyance that I can live with.

  4. #4
    Join Date
    Mar 2005
    Beans
    53

    Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    I did mine differently.

    Applications/System Tools/Configuration Editor

    Look for...
    Key name: /desktop/gnome/url-handlers/mailto/command
    Key value: /usr/bin/mozilla-thunderbird %s (originally points to evolution)

    Hope it helps.

    Ammendment:
    Apparently this only works if Thunderbird is not yet running if it was then you'll be bugged with the "Choose User Profile" dialog box. If that's the case follow the origin of this thread.
    Last edited by bonifacio; March 23rd, 2005 at 09:34 PM.

  5. #5
    Join Date
    Nov 2004
    Location
    United States
    Beans
    126

    Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    Thank you Bonifacio. Your solution works perfectly for me!
    "Appear where they cannot go, head for where they least expect you. To travel hundreds of miles without fatigue, go over land where there are no people."

  6. #6
    Join Date
    May 2005
    Location
    Nice
    Beans
    24
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    edit: as pointed out in this thread, the problem in Hoary is simply that /usr/bin/mozilla-thunderbird needs to have the string "Mozilla-Thunderbird" replaced with "mozilla-thunderbird" and you will achieve exactly the same behavior as the script below.
    /edit

    I use the following script, and set it as Gnome's preferred mail reader as well as the exec target for the Thunderbird launcher(s).

    Code:
    #!/bin/bash
    # This script allows FireFox to send mailto: links
    # to Thunderbird
    # Helper script for Thunderbird that
    #   - starts Thunderbird if it's not already running, raising a window otherwise
    #   - opens a compose window if called with a mailto: argument
    #
    # USAGE:
    #   - THUNDERBIRD must point to the thunderbird executable
    #   - either:
    #       + set network.protocol-handler.app.mailto to point to this script
    #       + call this script in place of the thunderbird executable (e.g. in
    #         Gnome's Preferred Applications Mail Reader and any Thunderbird
    #         launchers)
    
    THUNDERBIRD="/usr/bin/mozilla-thunderbird"
    
    $THUNDERBIRD -remote 'ping()' || exec $THUNDERBIRD "$@" # exec thunderbird if there’s no instance running
    $THUNDERBIRD -remote "xfeDoCommand(openInbox)" # otherwise raise window,
    [ "${1%%:*}" = 'mailto' ] && $THUNDERBIRD -remote "mailto(${1#mailto:})" # and maybe send the mailto:
    Last edited by pangloss; June 29th, 2005 at 12:16 AM.

  7. #7
    Join Date
    Nov 2007
    Beans
    2

    Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    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.

    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.

    For the sake of curiosity, does anyone know if this was an update problem or a byproduct of the Swiftweasel installation? Or am I way off the mark?.

  8. #8
    Join Date
    Sep 2007
    Beans
    615
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    Quote Originally Posted by bonifacio View Post
    I did mine differently.

    Applications/System Tools/Configuration Editor

    Look for...
    Key name: /desktop/gnome/url-handlers/mailto/command
    Key value: /usr/bin/mozilla-thunderbird %s (originally points to evolution)

    Hope it helps.

    Ammendment:
    Apparently this only works if Thunderbird is not yet running if it was then you'll be bugged with the "Choose User Profile" dialog box. If that's the case follow the origin of this thread.
    I went to system>preferences>prefered applications, and set it there.

    I had to edit menus and add the configuration tool to system tools but did it out of curiosity. When I followed the path and found the key listed above it was already set.

    I don't have an entry for network.protocol-handler.mailto at all in the "about:config" in firefox and it all still works perfectly.

    It might have something to do with the fact that I have a fresh install of Gutsy and the newest updated stable releases of thunderbird and firefox from the repos, but it is perfect. Thanks for the how-to's

    yeah, I know the post is old but it helped me.

  9. #9
    Join Date
    Feb 2008
    Location
    London, United Kingdom
    Beans
    33

    Red face Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    i found that the system-wide configuration is set through "System Tools -> Config Editor" (see above). this will allow you to click e-mail addresses anywhere in the system (Tomboy, OO, etc.) and it'll take you to the e-mail editor (Thunderbird in my case)

    to fix firefox issue only, choose "Edit -> Prefs -> App tab", search for "mail" and from the drop-down use the default value or "Use other" and then choose location of Thunderbird (/usr/bin/thunderbird in my case)

    cheers bonifacio,

    Vlad.

  10. #10
    Join Date
    Mar 2010
    Beans
    3

    Re: HOWTO: The Definitive Firefox & Thunderbird "mailto" Fix

    Quote Originally Posted by pirog View Post
    i found that the system-wide configuration is set through "System Tools -> Config Editor" (see above). this will allow you to click e-mail addresses anywhere in the system (Tomboy, OO, etc.) and it'll take you to the e-mail editor (Thunderbird in my case)

    to fix firefox issue only, choose "Edit -> Prefs -> App tab", search for "mail" and from the drop-down use the default value or "Use other" and then choose location of Thunderbird (/usr/bin/thunderbird in my case)

    cheers bonifacio,

    Vlad.
    That did it for me. Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •