Change Default Mail Application in OS X without opening Mail.app

Why this is not a setting in System Preferences I will never understand. But this is how OS X is. In order to set the default mail application you have to use Mail.app. My issue here is that anytime there is a mailto link from any application, clicking on said link opens Mail.app instead of Outlook. I have been looking for a way to alter this behavior this from the command-line and as far as I can tell there is no way to do this with a vanilla OS X install. Not unless you want to manually edit plist files.

I have found a thread on the Jamf support forums that lead me to Duti, a command-line tool for setting default applications on OS X. I was not able to build it on my Mac (OS X 10.10.5 with Xcode 7) but was able to install it via brew.

To set the defaults you need to know what the bundle identifier of the target application is. If you do not know what the bundle identifier is you can find it for your application using the mlds  utility.

This will return something like

Now you can run the following to make Outlook the default handler for mailto links:

I do not know if this is a permanent fix or if this needs to be executed on each login. If it is the later then you could easily add it to your bash_rc.

Anyways, super annoying that this is even a thing. The real solution here is to move the setting out of Mail.app and into System Preferences.

Leave a Reply

Your email address will not be published. Required fields are marked *