个人工具

UbuntuHelp:ThunderbirdDefaultMailerHowto

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月24日 (四) 14:41的版本 (新页面: {{From|https://help.ubuntu.com/community/ThunderbirdDefaultMailerHowto}} {{Languages|UbuntuHelp:ThunderbirdDefaultMailerHowto}} This Howto shows how to make Thunderbird your default e-mai...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

This Howto shows how to make Thunderbird your default e-mailer in GNOME and for Firefox `mailto:` links.

Please carry out the following steps:

    • Open the menu on the panel and select System -> Preferences -> Preferred Applications.

Open the Mail Reader tab and select the Custom checkbox. In the text field next to it, enter:

`mailto %s`

Now, click the Close button.

    • Open a text editor and copy-and-paste the following shell script:
#!/bin/bash

# mailto - handle mailto: links by opening the composer in thunderbird

# Author: Christopher Arndt <chris at chrisarndt dot de>

# find thunderbird executable
for prog in thunderbird mozilla-thunderbird; do
if [ -n "$(which "$prog" 2>/dev/null)" ]; then
TB="$prog"
break
fi
done

if [ -z "$TB" ]; then
echo "Thunderbird executable not found." 2>&1
exit 1
fi

if $TB -remote "ping()" &>/dev/null; then
# strip "mailto:" prefix when using -remote
CMD="${1#mailto:}"
exec $TB -remote "mailto($CMD)" &>/dev/null
else
# suppress any output from thunderbird to stdout/stderr
# remove "&>/dev/null" if you don't like this
exec $TB "$@" &>/dev/null
fi
    • Save this shell script to a file named `mailto`.
    • Then open a terminal window, change to the directory where you saved the script and issue the following command:
sudo install mailto /usr/local/bin

This will install the shell script into `/usr/local/bin` and make it executable.

Now, when you click on a `mailto:` link in Firefox, Thunderbird will open a new composer window. When Thunderbird is already running, it will not start another instance of Thunderbird, but will just ask Thunderbird to open a new message window. This prevents Thunderbird from trying to open a new instance with a different user profile.

If the `mailto` script is started without arguments, and Thunderbird is not already running, it will just open the Thunderbird main window. If it detects a running Thunderbird, it will open a new message window with an empty `To:` address line.