Our thinking


Set Outlook as the default email app – mail2outlook as a shell script

If you are setting up new Macs, and would like (or require) the end users to use Outlook, it’s time consuming to configure this manually for each new user account.

You can’t launch Outlook and have it ask to be the default app, or even go into the preferences and set it as default.

Instead you need to launch the Apple Mail app, configure an email account and only then can you get into the preferences in Mail to set Outlook as the default.

There used to be a tool maintained by Paul Bowden at Microsoft that you could simply run and it would set Outlook as the default app, however the app is no longer maintained and has never been updated for Apple Silicon, so it still needs Rosetta.

Fortunately, Armin Briegel (scriptingosx on GitHub) has written a cleverly named command-line app called utiluti that allows you to set the default app to handle url and uti schemes.

I’ve used it to power a script that replicates the functionality of the old mail2outlook app:

#!/bin/zsh
# this script depends on utiluti
# https://github.com/scriptingosx/utiluti


utiluti="/usr/local/bin/utiluti"

# check utiluti is installed

# check if utiluti exists and is executable
if [[ ! -x "/usr/local/bin/utiluti" ]]; then
    echo "utiluti not found or not executable — exiting."
    echo "You can install utiluti from https://github.com/scriptingosx/utiluti"
    exit 1
fi

# set Microsoft Outlook as default app for mail, contacts and calendars

# default settings prior to running this are:
# 
# URLs
# mailto: com.apple.mail
# ical: com.apple.iCal
# webcal: com.apple.iCal
# 
# Types (UTIs)
# public.vcard: com.apple.AddressBook
# com.apple.mail.email: com.apple.mail
# com.apple.ical.ics: com.apple.CalendarFileHandler
# 
# Extensions
# .vcard: public.vcard
# .eml: com.apple.mail.email
# .emlx: com.apple.mail.emlx
# .ics: com.apple.ical.ics
# .vcs: com.apple.ical.vcs

$utiluti url set mailto com.microsoft.Outlook
$utiluti type set public.vcard com.microsoft.Outlook
$utiluti type set com.apple.mail.email com.microsoft.Outlook
$utiluti type set com.apple.mail.emlx com.microsoft.Outlook
$utiluti type set com.apple.ical.ics com.microsoft.Outlook
$utiluti type set com.apple.ical.vcs com.microsoft.Outlook

I have also added two more settings, that the original mail2outlook app didn’t set:

$utiluti url set ical com.microsoft.Outlook
$utiluti url set webcal com.microsoft.Outlook

You can then run this with something like Outset as a login-once script so it will be run whenever a new user logs into the Mac.

Leave a Reply