An AppleScript to forward spam to the FTC via Mail

Feb 23, '06 06:31:00AM

Contributed by: TigerKR

The following appears on the FTC's Spam page:

Do you receive lots of junk email messages from people you don't know? It's no surprise if you do. As more people use email, marketers are increasingly using email messages to pitch their products and services. Some consumers find unsolicited commercial email - also known as "spam" - annoying and time consuming; others have lost money to bogus offers that arrived in their email in-box.

This website has information about the Federal Trade Commission's recent law enforcement actions against deceptive commercial email and spammers' responsibilities under the CAN-SPAM law. In the "For Consumers" section, you'll find tips on how to reduce the amount of spam email in your in-box.

If you get spam email that you think is deceptive, forward it to spam@uce.gov. The FTC uses the spam stored in this database to pursue law enforcement actions against people who send deceptive email.
If you'd like to help them out by forwarding them a selection of deceptive spam, read on for an AppleScript to do just that...

Here's the AppleScript; open up Script Editor (in /Applications/AppleScript), and paste in this code:

tell application "Mail"
  set theMessages to the selection
  repeat with thisMessage in theMessages
    set newMessage to make new outgoing message at end of outgoing messages
    tell newMessage
      set content to thisMessage's source
      set subject to thisMessage's subject
      make new to recipient with properties {address:"spam@uce.gov"}
    end tell
    send newMessage
    set read status of thisMessage to true
  end repeat
end tell
Then save the script to your user's Library -> Scripts -> Applications -> Mail folder (create the last one if necessary), and call it spam_uce_gov.scpt. Next, if you haven't done so yet, open up AppleScript Utility (in the same directory as Script Editor). Check 'Show Script Menu in menu bar' and 'Show Library scripts' and 'top.'

Now open up Mail.app, and navigate to your junk mail folder. Highlight every piece of deceptive junk that you want to report to the FTC, and then go to the AppleScript menu bar icon, and select spam_uce_gov.scpt. Off they go!

[robg adds: This worked for me, though I had to first hit Command-Option-U to display the raw source, since I have Mail set to force plain text, which makes most HTML-base spam look basically empty.]

Comments (40)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060219014940761