FREE · OPEN SOURCE · MACOS

set-default-mail.sh

Switch your default macOS mail client—without opening Mail.app.

On macOS, changing your default email client normally means opening Apple Mail, navigating to Preferences, and selecting your app from a dropdown. If you’ve already uninstalled Mail.app or just don’t want to launch it, you’re stuck.

Oh, want to get to preferences? Cool, just set up a mail account first. What?

This script changes your default mailto: handler directly via CoreServices—no GUI required.

Run it once. Done.

$ bash set-default-mail.sh

=== Default Mail Client Switcher ===

Current default: com.apple.mail

Scanning /Applications for mail clients...

Found mail clients:

1) Apple Mail (current)
2) Microsoft Outlook
3) Mimestream
4) ProtonMail

Select a mail client [1-4]: 3

Setting default mail client to: Mimestream
Done! Mimestream is now your default mail client._
THE PROBLEM

macOS makes you open Mail.app just to stop using it.

Apple only lets you change the default mail client from within Mail.app’s preferences. That means if you’ve switched to Outlook, Mimestream, ProtonMail, or any other client, you still have to launch the app you’re trying to get away from just to update a system setting.

And if you’ve deleted Mail.app or are managing Macs remotely? You’re completely stuck.

This script solves it in one line.

HOW IT WORKS

Three steps. Five seconds.

01

Scan

The script scans /Applications using Spotlight and plist inspection to find every installed mail client, including ones it doesn’t already know about.

02

Choose

Pick your preferred client from a numbered list. The current default is marked so you can see what’s active before you change it.

03

Done

The script calls LSSetDefaultHandlerForURLScheme via Swift to set the mailto: handler instantly. No restart, no logout, no GUI.

FEATURES

Small script. Smart detection.

27+ Known Clients

Ships with a built-in list of popular mail clients—Outlook, Spark, Airmail, Thunderbird, Mimestream, ProtonMail, Hey, Fastmail, and more—matched by bundle ID via Spotlight.

Auto-Discovery

Also scans /Applications and reads Info.plist files to find any app that registers for mailto:—even ones that aren’t in the built-in list. Filters out false positives like browsers and Zoom.

No Mail.app Required

Changes the mailto: handler directly via LSSetDefaultHandlerForURLScheme. Works even if Apple Mail has been deleted. No GUI, no preferences pane, no restart.

SUPPORTED CLIENTS

Works with every major mail client—and finds the rest.

Apple Mail
Microsoft Outlook
Spark
Airmail
Mimestream
Thunderbird
ProtonMail
Canary Mail
Postbox
Fastmail
MailMate
Hey
Edison Mail
Spike
Missive
Gmail
Yahoo Mail
+ any app with mailto: support
UNDER THE HOOD

Two detection methods. One Swift call.

The script uses two complementary methods to find every mail client on your system:

Method 1: Spotlight Index — Queries mdfind with kMDItemCFBundleIdentifier for each of 27 known mail client bundle IDs. Fast and reliable.

Method 2: Plist Scan — Walks /Applications and reads each app’s Info.plist to find any that register for mailto: URLs. Catches clients that aren’t in the built-in list. Filters out false positives like Chrome, Firefox, Safari, iTerm, and Zoom.

The actual default change is a single Swift invocation of LSSetDefaultHandlerForURLScheme—the same CoreServices API that Mail.app uses internally.

Pure bash + inline Swift

No compiled dependencies, no Homebrew packages

False positive filtering

Skips Chrome, Firefox, Safari, iTerm, and Zoom automatically

Shows current default

Reads the active mailto: handler before you change it

Instant effect

No logout, no restart—mailto: links work immediately

Sysadmin friendly

Works over SSH for remote Mac management

Stop opening Mail.app to close Mail.app.

Download the script, run it, pick your client. That’s it.

Built by Metahuman Network · Supporting the people behind the technology.