Adding the "Bounce Message" feature back to OS X Mail

junk-mail-automator

One of the features I've missed from OS X Lion is the ability to "bounce" an e-mail message in the Mail app.  What exactly is bouncing, and why would we care?

E-mail offers a feature that will notify you if you've attempted to send an email to someone that doesn't exist.  While these are technically referred to as a Non-Delivery Report, it's also referred to as a "bounce" message or the more obscure "Delivery Status Notification" phrase.  While there's no standard format for how these messages should appear, they often contain error codes designed to help you figure out what, exactly, went wrong.  Think of it like a postcard that is returned to you with one of this nifty little stamps stating, "Return to Sender".  That's useful to us.

Why, you ask?  Because sometimes it's helpful in our fight against spam.  Even though it's frequently automated, some spam systems are designed to understand these bounce messages and, as a result, remove the "incorrect" email from their system.  If we can "fake our own death," so to speak, we can have our cake and eat it too.  We can possibly fool a spam system into thinking that our email address doesn't exist and keep off its radar for the time being.  While it won't help us with all spam systems, it will help us with the more intelligent ones (oddly enough).

First, we need to add the ability to bounce email back into OS X's Mail.app program.  To accomplish this:

  1. Run the Automator program, located in your /Applications folder.
  2. When prompted to choose a type for your document, select Service and click the Choose button. You'll now have a window that you can drag and drop various actions in to.
  3. Using the drop down menus at the top, make certain to indicate that the service receives no input in the Mail application.
  4. Drag Get Selected Mail Items into the workflow window.
  5. Next, drag Run AppleScript into the workflow window.
  6. Enter in some code (below) and save the workflow with a meaningful name such as, Bounce Message.

The code that you'll enter in should contain the following:

on run {input, parameters}
     tell application "Mail"
          repeat with eachMessage in input
               bounce eachMessage
               delete eachMessage
          end repeat
     end tell
end run

When you're in the Mail program, you can now simply select a message that you want to bounce and, from the Mail menu, select Services and then Bounce Message.  The simplest way to check this out is to send yourself an email and to bounce it back to yourself.

In some cases, it's been reported that the messages reappear in your Inbox shortly after running this; if so, remove the 'delete eachMessage' command from the AppleScript and, instead, manually hit the delete button after bouncing the message (yes, we dislike this workaround too.  Sadly, it seems to be what works).