MozillaZine

mailto: wrong handling in gnome and workaround...

Discussion of bugs in Mozilla Thunderbird
Mozillator
 
Posts: 6
Joined: July 31st, 2004, 4:06 am
July 31st, 2004, 4:37 am

Post Posted July 31st, 2004, 4:37 am

Hi there,
I'm using Thunderbird 0.7.2 on Linux Slackware 10 with Gnome 2.6 and a part from the usual HASSLE of writing my own script to prevent the Profile Manager from appearing each time I launch a "thunderbird" command when I already have another instance running I noticed a strange behavior (BUG?) of Thunderbird itself when it comes to hanle a mailto: protocol.

If you run "thunderbird -compose mailto:bg@ms.com" the "mailto:" part automagically disappears and a new compose window is opened correctly, but if another instance of Thunderbird has already been fired you gotta issue thunderbird -remote "mailto(mailto:bg@ms.com)" and it doesn't work because this time you'll have a new compose windows with a To: field in which "mailto:bg@ms.com" appears. It's so boring...

So I wrote this simple script to allow my gnome mailto: handler to work correctly with thunderbird, but I guess this shouldn't be necessary the day this BUG is fixed...

Greetz,
Mozillator

8<---
#!/bin/sh
#
# Script name: /usr/local/bin/thunderbird
# Launches thunderbird and handles mailto correctly
#
# Tested on thunderbird 0.7.2 using Slackware 10.0
#

MOZ_BIN=/usr/bin/thunderbird

if [ "`$MOZ_BIN -remote 'ping()' 2>&1`" == "" ]; then
# echo "Thunderbird running..."
if [ "$1" = "-compose" ]; then
$MOZ_BIN -remote "mailto(`echo $2 | cut -d ":" -f 2`)" &
fi
exit 0
else
# echo "Thunderbird not running..."
if [ "$1" = "-compose" ]; then
$MOZ_BIN -compose "$2" &
exit 1
fi
$MOZ_BIN $1 &
fi
8<---

P.S. Why isn't a standard linux script included in both Firefox and Thunderbird to prevent the the horible ProfileManager from appearing? A whole lot of newbies and users would greatly appreciate it! Thanks a lot ;O)

Old Unghost
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm
Location: Moscow, Russia
July 31st, 2004, 8:09 am

Post Posted July 31st, 2004, 8:09 am

It seems that interaction with Gnome will be changed in 0.8. See Bug 252056 - Thunderbird should set itself as default mail/news client on GNOME for details.
Have you tried last night build?
Joined: 21 Jun 2003

Mozillator
 
Posts: 6
Joined: July 31st, 2004, 4:06 am
July 31st, 2004, 2:08 pm

Post Posted July 31st, 2004, 2:08 pm

Hey,
I just tried the nightly build, and played a little with its startup script, but it's even worse than 0.7.2, at least for now.
It doesn't even handle correctly the command "thunderbird -remote ping()" always returning "no running window".

We hope the best for the final 0.8 release...

Cheerz

Jeroen p

User avatar
 
Posts: 3763
Joined: January 29th, 2004, 7:17 am
Location: The Netherlands
July 31st, 2004, 3:54 pm

Post Posted July 31st, 2004, 3:54 pm

Try "thunderbird -a thunderbird -remote ping()"
Extensions for Thunderbird: <a href="http://jpeters.no-ip.com/extensions/?page=tb_cs">Contacts Sidebar</a>, <a href="http://jpeters.no-ip.com/extensions/?page=tb_ts">Timestamp</a> and <a href="http://jpeters.no-ip.com/extensions/?page=tb_aes">Allow Empty Subject</a>

Mozillator
 
Posts: 6
Joined: July 31st, 2004, 4:06 am
July 31st, 2004, 6:03 pm

Post Posted July 31st, 2004, 6:03 pm

No way buddy,
TB 20040730 still displays "Error: No running window found". So who cares about the malfunctioning of the -remote argument, let's do it with ps! :O)

OK, OK, I know it's not advisable on remote session and the likes, but again, who cares? I really hope these developers will find a common solution SOON, or better disable this damn useless ProfileManager...
Hope you'll find this script useful. Enjoy!

Mozillator

8<--- Thunderbird 0.7+, A.K.A. 0.8cvs MAILTO workaround ---
#!/bin/sh
#
# Tested on thunderbird 0.7+ using Slackware 10.0
#
# Call this script thunderbird or as you wish and "chmod u+x thisscript"
# Set your default mailto: handler as "thunderbird -compose %s" in
# Gnome and everything should work as expected...

THUNDERBIRD_PATH=/usr/lib/thunderbird
MOZ_BIN=${THUNDERBIRD_PATH}/thunderbird #change accordingly
MOZ_RUN="`ps x | grep \"[0-9] ${THUNDERBIRD_PATH}/thunderbird-bin\"`"
if [ ! "$MOZ_RUN" = "" ]; then
# echo "Thunderbird running..."
if [ "$1" = "-compose" ]; then
rm ~/.thunderbird/`ls ~/.thunderbird | grep default`/lock
$MOZ_BIN -compose "$2" &
fi
exit 0
else
# echo "Thunderbird not running..."
if [ "$1" = "-compose" ]; then
$MOZ_BIN -compose "$2" &
exit 1
fi
$MOZ_BIN $1 &
fi
8<--- Thunderbird 0.7+, A.K.A. 0.8cvs MAILTO workaround ---

Return to Thunderbird Bugs


Who is online

Users browsing this forum: No registered users and 1 guest