Default Mail Applications (mailto reprised)

Posted in PowerTips - Admins by John Holder on the November 28th, 2007

We’ve had some great responses to my blog post yesterday about changing the default mailto links using Firefox. There’s a couple of problems with my method: 1) It’s not really scalable for an admin [ie no auto install] 2) Not really applicable for Safari and Internet Explorer.


I found that there are many different ways to change the default mail handler in windows.

I decided to set out on a journey that would last me most of the night, and this morning testing most of the different methods in Parallels.

As I said, the largest problem with yesterday’s tutorial was that it isn’t easily scalable. Most admins don’t to walk around to each PC, and install Firefox, then install the Firefox extension we talked about yesterday. The most dominent browser and operating system is is Internet Explorer and Windows, and we really do have to play by their rules. The most obvious solution for Windows users is to have a registry file that you can import.

Since Firefox, IE, and Safari all handle the mailto URI call based upon what’s in the registry, we need to go that route. However, it does cause one small usability problem (we’ll cover that later).

For all of you administrators running a Microsoft Windows NT-based Domain, I’m sure you’re familiar with the technique of executing login scripts for your users. If not, I strongly suggest you read this tutorial. It’s a little off topic, but as an admin, I found it very valuable.

The cool thing about this registry hack, as paradiag points out, is that you can set up a script to silently import this registry file upon login. This allows you to modify most, if not all, of you clients on a single login. Simply run:

regedit /s zimbra.reg

Here’s the registry file. Make sure you save it, and not run it quite yet. You’re gonna need to modify these keys to fit your enviroment:

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Zimbra Web Client\DefaultIcon]
@="c:\\windows\\zimbra.ico"

[HKEY_CURRENT_USER\Software\Classes\mailto\DefaultIcon]
@="c:\\windows\\zimbra.ico"

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Zimbra Web Client\shell\open\command]
@="rundll32.exe url.dll,FileProtocolHandler https://mail.server.com/h/"

[HKEY_CURRENT_USER\Software\Classes\mailto\shell\open\command]
@="rundll32.exe url.dll,FileProtocolHandler https://mail.server.com/h/search?action=compose&to=%1"

Make sure you change the URL to direct the users to your mail server. Next, you have two options: You can direct them to the Ajax Client or the Standard Client. Because the Standard Client is much faster, I have that URL scheme already in the registry file. If you want to use the AJAX client, then use:

https://mail.server.com/zimbra?app=mail&view=compose&to=%1

I created a cool icon for you. Download the reg file and ICO file in this zip. It’s already in ICO format which is supported by Windows 2000+. In your login script, you’ll need to copy that icon to a location on the local user’s hard drive. Where ever you place that file, make sure you reflect that location in the above registry keys.

This is cool, but I found one problem with it. The %1 in the URL is a variable for what ever string the browser passes to your application. In this case, it will pass mailto:username@domain.com

This is a problem because the URL ends up being:

https://mail.server.com/zimbra?app=mail&view=compose&to=mailto:username@domain.com

This causes the URL to pass mailto: into the prepopulated to: field. And if you take off &to, it doesn’t work at all. Does any one have any idea how we can remove mailto: from being passed to the %1 variable?

Other than that, it works great :)

On Mac, you may want to try out http://belkadan.com/webmailer/

I didn’t install it, but from what I hear it works great.


5 Responses to 'Default Mail Applications (mailto reprised)'

Subscribe to comments with RSS or TrackBack to 'Default Mail Applications (mailto reprised)'.


  1. on November 28th, 2007 at 2:51 pm

    It’s also a problem when the mail link contains a Subject field, I’m afraid.

    In Ubuntu/Gnome, just put this url in ‘Preferred Applications’ with the %s parameter instead of %1.

  2. H said,

    on November 29th, 2007 at 1:36 am

    How about a way to use Zimbra for the MS office “Send to > Mail recipient” problem?

  3. Rich Graves said,

    on November 29th, 2007 at 9:49 am

    The Zimbra Toaster will parse out the various mailto: arguments. You don’t need to launch it at startup; many people find the popups annoying. and If you don’t launch it at startup, it doesn’t need to be configured with the user’s password.

    But it’s silly to require a binary on every client when a registry hack and a little server-side parsing of the mailto: arguments will do. We really want something server-side like squirrelmail.org/docs/phpdoc/squirrelmail/_src—mailto.php.html

    Make sure you don’t open up an attack path; google for “mailto ie7 vulnerability”

  4. Mark said,

    on December 20th, 2007 at 2:45 pm

    Are these cool tips and tricks going into the Wiki? Great for future reference.

  5. jasman said,

    on May 29th, 2008 at 5:41 pm

    What about attachments, is there a way to click on the apps email document and have it attach to zimbra?

Leave a Reply

|  Blog Home

Subscribe

Zimbra RSS Feed

Subscribe by Email



Categories


Archives