How to use a webmail client in Firefox 3 & 4 other than the default GMail or Yahoo! Mail

If you use your OS defined email program, GMail or Yahoo! Mail when clicking on mailto: links in Firefox 3 or 4 then this article is not for you. If you want to define a different email client then you've come to the right place.

Firefox gives you the ability to select from a limited list of handling options for mailto: links in the Edit -> Preferences -> Applications -> Content Type (mailto) -> Action (drop down). You can choose from GMail, Yahoo! Mail or a local application. But what if you want to use a webmail application like RoundCube, Squirrel Mail or Hotmail when you click on a mailto: link? This article will show you how to add a new entry to the Action drop down using web-based protocol handlers.

Step 1)
Go to your webmail and copy the URL when you compose a new email. In this case I'm using RoundCube.
EXAMPLE: http://mail.example.com?_task=mail&_action=compose&_to=%s
NOTE: the "%s" is used to pick up the email address associated with the mailto: link

Step 2)
Don't close out your webmail because you need to issue the next command while your webmail is active in the browser for security reasons. In the location box (where the URLs are entered in the browser) enter the javascript command like the following example.
EXAMPLE: javascript:navigator.registerProtocolHandler("mailto","http://mail.example.com?_task=mail&_action=compose&_to=%s","RoundCube");
NOTE 1: Paste the URL from Step 1 into the example above
NOTE 2: If your browser is not already at the domain for your webmail you can override the javascript security by toggling the "gecko.handlerService.allowRegisterFromDifferentHost" from "false" to "true" in the Firefox about:config screen. The built-in javascript security will not allow the application to be added without either being at the site or toggling the value. Don't forget to toggle it back to "false" when your done adding your new mailto: application.

Step 3)
If all went well you should see drop down notification under the location box on the left saying:
EXAMPLE: Add RoundCube (example.com) as an application for mailto links? [Add Application]
Click the [Add Application] button.

Step 4)
Go to the Edit -> Preferences -> Applications -> Content Type (mailto) -> Action (drop down) . You should see your newly added application ready for selection.

You can read up on the method used here at Web-based protocol handlers - MDC Doc Center