#!/usr/bin/env python

import mailparser
import subprocess
import sys

mail = mailparser.parse_from_file_obj(sys.stdin)
message_url = "message:%s" % mail.message_id
subprocess.check_call(["open", message_url])
