Yahoo as default email client

I’ve had a Yahoo account since Yahoo was best of search engines (yes quite a bit ago) – I still like it. Instead of using my ISP provided email address I’ve just used Yahoo. Yahoo Mail can be used as the default email client instead of using Evolution, Thunderbird… in Gnome. In other words links that point to “mailto:” will open in mail.yahoo.com.

I use a hidden folder at home that contains all my scripts:

gedit ~/.bin/yahoo-mailto

This nice bash script will direct Epiphany mailto links to yahoo:

#!/bin/bash
qs=`echo $1 | sed ‘s/mailto:/To=/’ | sed ‘s/\?subject=/\&Subject=/’`
epiphany –new-tab “http://compose.mail.yahoo.com/?$qs”

Here’s an alternate as the above for some doesn’t always work:

#!/bin/bash
URL=$(echo $1 | sed ‘s#mailto:##;s#?#\&#;s#\&subject=#\&Subj=#;s#(##;s#)##i;’)
epiphany –new-tab “http://us.f585.mail.yahoo.com/ym/Compose?To=$URL”

Make the script executable:

chmod +x ~/.bin/yahoo-mailto

To set it to the default application for mail in Gnome open Preferred Applications and select the script appended with a %s.

set email client

The script can also be used from the command line:

yahoo-mailto mailto:person@site.com