If you're an OS X user, you're in luck, for hiding within your Applications folder is a powerful program called Automator. This oft-overlooked gem is able to string together a drag-and-drop, step-by-step list of actions for your computer to take (called a "workflow") and save them as a double-clickable application for running at any time. So, for instance, you could generate a simple Automator application that simply puts your computer to sleep. When teamed with a one-line AppleScript that surprisingly resembles actual English ("tell application "whateveryounamedyourapplication" to run"), Apple's Mail application can, in the process of filtering your messages, launch the Applescript when a message meeting certain criteria is received (i.e., one sent from my address with the subject line "go to sleep"). You're not just limited to putting your machine to sleep, though—Automator comes with a bevy of actions spanning most of OS X's core applications, and you can download even more (including the "Sleep" action) from Apple's Automator site.