LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   FireFox and mailto (https://www.linuxquestions.org/questions/mandriva-30/firefox-and-mailto-229339/)

Liakoni 09-11-2004 12:04 PM

FireFox and mailto
 
Can anyone tell me how to setup thunderbird to be the default mail client for Firefox?
Now the default is Evolution...

legolin 09-19-2004 01:01 PM

hey, your post is very old, but i'm having the same problem right now... have you solve the problem allready? how?

thankx,

leg

Liakoni 09-19-2004 02:08 PM

Unfortunatelly, i dont't have the solution to the problem yet.
But i haven't search a lot...:newbie:

z-vet 09-19-2004 02:14 PM

Here is a solution:
Create subdir in your home directory called scripts. Copy a following script and save it there,call it start-thunderbird.sh
Code:

#!/bin/bash
export tb=/path/to/thunderbird 
url="$1"
url=`echo "$url" | sed -e's/^mailto://'`
$tb -remote "mailto($url)" || exec $tb -P default -compose $1

Change a /path/to/thunderbird with yours...
In Firefox' address bar type about:config and hit enter.Create new preference of type string named network.protocol-handler.app.mailto and set it's value to full path to start-thunderbird.sh script.
Enjoy!

legolin 09-19-2004 02:57 PM

hi z-vet,

i did not understand what you where telling me. i have to write on the adressbar :config???

it didn't work... i guess i'm doing something wrong :)

how do i create a new preference? can i just edit the ~/.mozilla/firefox/whatever/prefs.js and add a new line like this:
user_pref("network.protocol-handler.app.mailto", /path/2/script);


???


thankx a lot,


leg

z-vet 09-19-2004 03:08 PM

Hi,legolin.
Type "about:config" in addressbar.It gives you a possibility to edit your prefs.js from within Firefox.

warren1715 09-19-2004 10:26 PM

I changed mine by starting 'gnome-control-center', go to 'Advanced' then 'File types and programs'
open 'Internet Services' and find mailto. If you dont have mailto then firefox will say 'not registered protocol' and you can create it. Highlight mailto and edit it. Protocol is 'mailto', Program is 'thunderbird "%s"' or whatever you want.

z-vet 09-20-2004 11:22 AM

warren1715
And when you click on mailto: link in Firefox Thunderbird opens "Compose new mail"?

warren1715 09-20-2004 06:09 PM

Mine works perfectly. Check your syntax. If thunderbird is installed in /usr/local/thunderbird/ directory for example the settings should be as follows:

Protocol mailto
Program /usr/local/thunderbird/thunderbird "%s"

It may help to delete the old mailto and create a new one.

Liakoni 09-21-2004 05:50 AM

Thanks z-vet it worked just fine...

leonya 10-06-2004 03:43 PM

The script suggested earlier in this thread doesn't work for me anymore in Thunderbird 0.8.
For some reason "thunderbird -remote" no longer works for me.

I had to create a new script as follows:
Code:

#!/bin/sh
#
export MOZILLA_TB_HOME=/path/to/thunderbird
 
#firefox sends URLs in form "mailto:author@site.com"
url=`echo "$1" | sed -e's/^mailto://'`
 
if $MOZILLA_TB_HOME/mozilla-xremote-client -a Thunderbird 'ping()'
then
# thunderbird is running
        $MOZILLA_TB_HOME/mozilla-xremote-client -a Thunderbird "mailto($url?subject=$2)"
else
# thunderbird is not running
        $MOZILLA_TB_HOME/thunderbird -P default -compose "mailto:$url?subject=$2";
fi

I also created another script to open Thunderbird, or refocus if already running:
Code:

#!/bin/sh

export MOZILLA_TB_HOME=/path/to/thunderbird

if $MOZILLA_TB_HOME/mozilla-xremote-client -a Thunderbird 'ping()'
then
 #echo "thunderbird running"
 $MOZILLA_TB_HOME/mozilla-xremote-client -a Thunderbird 'xfeDoCommand (openInbox)'
else
 #echo "thunderbird not running"
 $MOZILLA_TB_HOME/thunderbird &
fi


Riichard 10-23-2004 08:15 AM

Im trying to get Thunderbird to open a new message when clicking on a email address.
This works the best for me
Quote:

Originally posted by z-vet

Code:

#!/bin/bash
export tb=/path/to/thunderbird 
url="$1"
url=`echo "$url" | sed -e's/^mailto://'`
$tb -remote "mailto($url)" || exec $tb -P default -compose $1


but doesnt add the email address to the message I want to send it just opens a new message.
I am trying to add this script to KDE's component chooser as preffered email application:confused:

RussellEast 11-02-2004 12:55 PM

I found that, for FF v1.0PR, it is sending the following URL to the mailto script:
mailto:author@site.com?subject=...?body=...

Accordingly, I changed the script provided by leonya to the following, which works nicely for me, after making the necessary changes in FireFox's "about:config". You can see the "echo" statement I used to figure out what was going on.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#!/bin/bash
# script used by FireFox to compose a mail.
# firefox apparently sends args in form:
# mailto:author@site.com?subject=...?body=...

export MOZILLA_TB_HOME="/path/to/thunderbird"
TB=$MOZILLA_TB_HOME/thunderbird
REMOTE_TB=$MOZILLA_TB_HOME/mozilla-xremote-client

# echo "Firefox mailto: $*" >> $HOME/log.txt

MAILTO_URL="$1"
RECIPIENT=`echo "$MAILTO_URL" | /bin/sed -s 's/^mailto:\([^?]*\)?.*/\1/'`
OTHER=`echo "$MAILTO_URL" | /bin/sed -s 's/[^?]*?/?/'`

if $REMOTE_TB -a Thunderbird 'ping()' ; then
# thunderbird is running
$REMOTE_TB -a Thunderbird "mailto($RECIPIENT$OTHER)"
else
# thunderbird is not running
$TB -P default -compose "$MAILTO_URL"
fi
exit 0
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=:)

RussellEast 11-02-2004 01:25 PM

Oops, that script worked only for File/SendLink (which is what I was testing for) and not for a genuine "mailto:..." link in a web page. In any case, the script was unnecessarily complicated. Here's the script that works in both cases (for me). Note that it properly puts in the subject heading and message body when doing a File/SendLink.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#!/bin/bash
# script used by FireFox to compose a mail.

export MOZILLA_TB_HOME="/path/to/thunderbird"
TB=$MOZILLA_TB_HOME/thunderbird
REMOTE_TB=$MOZILLA_TB_HOME/mozilla-xremote-client

#echo "Firefox mailto: $*" >> $HOME/log.txt

MAILTO_URL="$1"
MAIL_DATA=`echo "$MAILTO_URL" | /bin/sed -s 's/^mailto://'`

if $REMOTE_TB -a Thunderbird 'ping()' ; then
# thunderbird is running
$REMOTE_TB -a Thunderbird "mailto($MAIL_DATA)"
else
# thunderbird is not running
$TB -P default -compose "$MAILTO_URL"
fi
exit 0
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

beanerjo 11-24-2004 04:28 PM

Thanks a lot for the tip about "about:config", z-vet! That's what I have been after so darn long.


All times are GMT -5. The time now is 04:59 PM.