Setting up Outlook 2011 as your default mail client

Callahan
New Contributor

So, today I've been fine tuning some of my policies that I've rolled out to the user base (all running Mountain Lion). One of the things that I'd been putting off is the issue my users are complaining about whereby when they click a link in either Firefox, Chrome or Safari, Apple Mail tries to launch. I've prevented Apple Mail from launching as I don't want my users attempting to configure a mail client that I didn't set up. It therefore produces an error message meaning that the users have to copy/paste the email address.
So, today I've been trying to set up default programs for all the macs. I used this as a starting point:
https://jamfnation.jamfsoftware.com/discussion.html?id=31
I expended on that with the below:

<dict>
            <key>LSHandlerRoleAll</key>
            <string>com.microsoft.outlook</string>
            <key>LSHandlerURLScheme</key>
            <string>mailto</string>
        </dict>
        <dict>
            <key>LSHandlerContentType</key>
            <string>com.apple.mail.email</string>
            <key>LSHandlerRoleAll</key>
            <string>com.microsoft.outlook</string>
        </dict>
        <dict>
            <key>LSHandlerContentType</key>
            <string>com.microsoft.outlook14.email-message</string>
            <key>LSHandlerRoleAll</key>
            <string>com.microsoft.outlook</string>
        </dict>
        <dict>
            <key>LSHandlerContentType</key>
            <string>com.apple.ical.ics</string>
            <key>LSHandlerRoleAll</key>
            <string>com.microsoft.outlook</string>
        </dict>
        <dict>
            <key>LSHandlerContentType</key>
            <string>com.microsoft.outlook14.icalendar</string>
            <key>LSHandlerRoleAll</key>
            <string>com.microsoft.outlook</string>
        </dict>
        <dict>
            <key>LSHandlerContentType</key>
            <string>public.vcard</string>
            <key>LSHandlerRoleAll</key>
            <string>com.microsoft.outlook</string>
        </dict>

After hours of head scratching as to why this applied to the client macs but didn't do as I was expecting I discovered that this does in fact work, but only in Safari. Firefox and Chrome still try to launch Mail as the default mail app.
Going on from this, I found that if you open Outlook 2011 Preferences and under the General applet, tick the box marked "Make Outlook the default application for email, contacts, and calendar", it fixes the issue. Both Chrome and Firefox (by looking in the Preferences of each) have had their default mail client for handling mailto: links changed to Outlook.
So, this tick box in Outlook is clearly changing a global setting in a plist somewhere but I can't find out where.

Has anyone come across this before or has any bright ideas as to the plist Outlook might be altering? It can't be it's own like com.microsoft.office or com.microsoft.outlook as Firefox and Chrome know nothing about them.

Thanks for any help you can provide!

18 REPLIES 18

scottb
Honored Contributor

Changing the default in Mail.app (Preferences/General) updates the "com.apple.LaunchServices.plist" in ~/Library/Preferences. I changed this from Mail to Outlook (and back) and all apps I tested used the new app as the default.
Firefox 21.0
Chromium Version 29.0.1514.0 (201294)
Safari Version 6.0.x

Scott

mscottblake
Valued Contributor

That setting is located in ~Library/Preferences/com.apple.LaunchServices.plist. Make sure it contains this:

<dict>
 <key>LSHandlers</key>
  <array>
   <dict>
    <key>LSHandlerRoleAll</key>
    <string>com.microsoft.Outlook</string>
    <key>LSHandlerURLScheme</key>
    <string>mailto</string>
   </dict>
  </array>
</dict>

tkimpton
Valued Contributor II

rcorbin
Contributor II

Has anyone tried building a configuration profile that just makes the modification to com.apple.LaunchServices.plist ?

We use FirstClass in our district for mail. It would be great if we could easily set FirstClass to be the default mail app for all users.

Is it possible to do some sort of a defaults write command to ~Library/Preferences/com.apple.LaunchServices.plist ?

bentoms
Release Candidate Programs Tester

@rcorbin, I'd really recommend: http://duti.org/

rcorbin
Contributor II

Perhaps I'm not getting this. I've looked at duti and I see how you use it to set your default app for opening PDF's or something like that. Can you get it to set your default mail app ? So if a user clicks on a "mail to" link on a web page it will the open FirstClass instead of Mail ?

bentoms
Release Candidate Programs Tester

@rcorbin, yes you can.

We only use duti to send Outlook & Safari as defaults.

I'm in the office tomorrow, I'll post what we do then (if I remember).

rcorbin
Contributor II

Great thanks...

franton
Valued Contributor III

I'm very interested in this as well. I can see large amounts of scripting in my future ...

gknacks
New Contributor III

This is what we used...

https://jamfnation.jamfsoftware.com/discussion.html?id=6845

ssmurphy
New Contributor III

bentoms,

any chance you can share how you use Duti to set Outlook as the default email client please.

Thanks,

lg-jbarclay
New Contributor II

@ssmurphy][/url

This should work for setting Outlook as the default mail client with duti.

  1. Create a PKG with Composer that lays the following plist in /Library/SomeDirectory/duti_settings.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE  plist  PUBLIC  "-//Apple  Computer//DTD  PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>DUTISettings</key>
 <array>
      <dict>
       <key>DUTIBundleIdentifier</key>
       <string>com.microsoft.Outlook</string>
       <key>DUTIURLScheme</key>
       <string>mailto</string>
      </dict>
 </array>
</dict>
</plist>
  1. Add the following postinstall script to the PKG.
#!/bin/sh

duti="/usr/local/bin/duti"
duti_conf="/Library/SomeDirectory/duti_settings.plist"

if [ -f "$duti" ] && [ -f "$duti_conf" ]; then
    $duti "$duti_conf"
else
    echo "duti is not installed or $duti_conf doesn't exist."
    exit 1
fi

exit $?

Hope this helps.

bentoms
Release Candidate Programs Tester

@ssmurphy][/url, with duti installed i have a launch agent that contains the below & therefore sets the default email client & internet browser @ login:

#!/bin/sh

duti -s com.microsoft.outlook mailto
echo "Default Mail client set to Microsoft Outlook..."

duti -s com.apple.Safari public.html
echo "Default Web client set to Safari..."

ssmurphy
New Contributor III

Thanks for getting back to me (and this thread) with that info.

Will try it out to see if it will work for our clients.

Thanks again for taking time to answer the question.

Steve.

ssmurphy
New Contributor III

@bentoms Hello,

tried your settings and it did work for links in webpages but not for mail messages stored outside of Microsoft Outlook 2011.

Not sure how to use DUTI to set the .eml extension to use Outlook over Apple Mail.

Thanks

andyinindy
Contributor II

Guys:

Duti is not working for me for setting the default email client on our Mavericks build. I use a package to place the duti binary onto the filesystem, and then I use a script to grab the system owner from our database and then run duti as that user, like so:

sudo -u $OWNER /path/to/duti -s com.microsoft.outlook mailto all

This seems to work, as evidenced by duti:

acunning-mn4:~ acunning$ /path/to/duti -x mailto
Microsoft Outlook
/Applications/Microsoft Office 2011/Microsoft Outlook.app
com.microsoft.Outlook

However, mailto links still open in Mail.app. Is there something that I am missing? I can verify that the ~/Library/Preferences/com.apple.LaunchServices.plist is being updated with the proper LSHandler; I wonder why the OS isn't honoring my setting?

--Andy

iweiss
New Contributor III

Our environment is mostly 10.9. We tried MCX, Config Profiles, Defaults write, Bash scripts, editing the LaunchServices db and Duti, but they were either too complex or not reliable. It was hard for me to believe that there was no easy way to set this. Finally I ran across the AppleScript listed below on the Google MacEnterprise forum. It is simple and appears to work well in testing. At first this script only worked when I ran it from the AppleScript Editor. I had tried pasting it into the JSS, but it appeared to do nothing when run. Then I tried saving as text(.applescript), uploading via Casper Admin and now it seems to work great. Not sure if it needs the quit signal at the end. Hope this helps others.

tell application "Microsoft Outlook"
    set system default everything application to yes
end tell
tell application "Microsoft Outlook" to quit
end

esantiago
New Contributor

@genian

I uploaded the text apple script with casper admin. But i can't run it as a policy.
Or in self service.