Alex headshot

AlBlue’s Blog

Macs, Modularity and More message URLs and iCal

2009, mac, tip responds to a message: URL protocol; if you specify a Message-Id (as seen by the message's headers; View->Message>Long Headers), then it will open up the message in the Mail application. For example, here's some headers from an (old) message:

X-Apple-Mail-Remote-Attachments: YES
X-Apple-Mail-Signature: SKIP_SIGNATURE
Content-Type: text/html;charset=US-ASCII
Message-Id: <>
Content-Transfer-Encoding: 7bit
X-Apple-Windows-Friendly: 1
From: Alex Blewitt <>
Subject: Test

For the purposes of this discussion, the Message-Id header (<>) is the important part. To open this message up in, regardless of which folder this mail message happens to be in, we can invoke an open command from Terminal (or any other app capable of launching a document based on a URL) that will invoke it, with message:<>. Mail will then display this message, which can be handy for replying to specific messages, or attaching to reminders. (If you run this from Terminal, due to Message IDs often including < and > characters, then you might need to wrap it in 'quotes' to avoid shell interpretation.)

This can also be hooked into iCal, although not in an obvious way. If you edit an entry (or create one), you'll see a url field. This is typically used to refer to web-based resources associated with an event. You can also use it to fire up a mail message, either by constructing the message ID yourself, or by dragging-and-dropping the message onto the URL field. For whatever reason, you can't drag-n-drop it onto the event directly; you need to open up the event info window first.