MailMate and Alfred

I use MailMate for my email, since it is very fast, customizable, and integrates with many other programs, and supports Markdown natively. It isn’t pretty, its documentation has gaps, and it isn’t for everyone—but it’s power cannot be matched. I’m a big believer in minimizing the amount of time it takes to do common tasks. I can work faster and more easily keep my mental context. Here are a few Alfred integrations I’ve created to make my work faster and keep my hands on the keyboard.

I created an Alfred keyword (“m”) to search MailMate messages using its search syntax, using it’s mlmt: URI scheme.

MailMate Alfred workflow screenshot

The bash script is simple:

query=$1
open "mlmt:quicksearch?string=$query"

So I can do the following:

Example of mailmate search in Alfred

In other words, look for messages from Sam that have “project rhino” in the subject.

I like searching this way because the syntax is powerful, but I can immediately search for what I need, from anywhere, as soon as I need to, in a single action.

Open inbox and go to first unread message

Alfred’s AppleScript Dictionary is rudimentary but contains one powerful command: perform. This allows you to perform any MailMate action that you can do with custom key bindings, which is a lot.

I created an inbox keyword that opens up the inbox, and immediately scrolls to the first unread message and opens it. When I see a notification for an incoming message that I care about, I can simply type “inbox” into Alfred and jump immediately to it.

Example of MailMate inbox workflows

on alfred_script(q)
	tell application "MailMate"
		perform {"goToMailbox:", "INBOX"}
		perform {"nextUnreadMessage:"}
	end tell
end alfred_script

I also have a pinbox keyword that jumps to a “personal” smart mailbox that has only inbox messages addressed directly to me from people who I have emailed in the past (the UUID uniquely identifies the smart mailbox):

on alfred_script(q)
	tell application "MailMate"
		perform {"goToMailbox:", "5E738709-814A-4DFA-93E5-85BB6FECD3F8"}
		perform {"nextUnreadMessage:"}
	end tell
end alfred_script