Posted on 06-04-2013 11:31 AM
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!
Posted on 06-04-2013 12:43 PM
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
Posted on 06-04-2013 12:46 PM
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>
Posted on 06-10-2013 08:55 PM
duti guys
Posted on 11-29-2013 10:57 AM
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 ?
Posted on 11-29-2013 11:06 AM
@rcorbin, I'd really recommend: http://duti.org/
Posted on 11-29-2013 12:09 PM
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 ?
Posted on 11-29-2013 12:54 PM
@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).
Posted on 11-29-2013 01:06 PM
Great thanks...
Posted on 11-30-2013 04:57 AM
I'm very interested in this as well. I can see large amounts of scripting in my future ...
Posted on 12-04-2013 06:37 AM
This is what we used...
https://jamfnation.jamfsoftware.com/discussion.html?id=6845
Posted on 12-12-2013 10:39 AM
bentoms,
any chance you can share how you use Duti to set Outlook as the default email client please.
Thanks,
Posted on 12-13-2013 11:53 AM
This should work for setting Outlook as the default mail client with duti.
<?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>
#!/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.
Posted on 12-13-2013 01:18 PM
@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..."
Posted on 12-13-2013 01:22 PM
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.
Posted on 01-14-2014 06:11 AM
@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
Posted on 02-03-2014 09:47 AM
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
Posted on 04-01-2015 03:55 PM
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
Posted on 05-11-2015 02:21 PM
I uploaded the text apple script with casper admin. But i can't run it as a policy.
Or in self service.