Okay, the title of this is pretty darn long, but I’m writing for Google. 🙂
Back some time ago, I saw this AppleScript to forward spam to the FTC via Mail and liked the concept. It makes me at least feel like I’m doing something, you know? [Probably not much; I’m a government contractor, so I know what government might not do well.] I adapted it to report PayPal phishing attempts to spoof@paypal.com, and well, that was really it. My main change was in deleting the email after sending the mail on forward.
Now that Fastmail provides a spam-learning option for folders, I’m wanting to improve its spam filters. It already does a solid job—most of the spam I get goes into Junk Mail. However, I do get false positives, so I didn’t want Junk Mail to become the spam-learning folder. I then devised this concept:
- Create a folder called ConfirmedJunk and set it in Fastmail’s Web interface to be a spam-learning folder. I also set this folder to auto-purge every month to keep my quota use down.
- Rework my AppleScripts to go from deleting the junk mail to putting in ConfirmedJunk.
- There is no step 3.
Well, it took a little while banging my head on this tonight, but here’s what I came up with:
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 move thisMessage to mailbox "INBOX/ConfirmedJunk" of account "[$account]" end repeat end tell
The above is “spam_uce_gov.scpt“.
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:"spoof@paypal.com"} end tell send newMessage set read status of thisMessage to true move thisMessage to mailbox "INBOX/ConfirmedJunk" of account "[$account]" end repeat end tell
That’s “spam_paypal_com.scpt“.
Use ’em if you can. Be sure to put the name of the account in there as Mail knows it and change the folder name as appropriate. I will not know the specifics of your setup unless you mirror mine. This script is provided free of charge and is unsupported.
6 Jun 2010: The scripts shown in this post have been superseded by a more recent update.
[…] spam filtering of Fastmail is not only good, it’s actively trainable. I’ve used some AppleScript I cobbled together in 2007 to train Fastmail’s spam filtering: once or twice a day, I make a pass at the junkmail, just to make the system work better for […]
[…] today’s Fastmail blog tutorial about improving spam filtering performance reminded me of my AppleScript to handle spam reporting and filing, which still works under Snow Leopard. I don’t think I’ve mentioned this before, but I […]
[…] think I tried to do this back when I set these spam-reporting AppleScripts up originally, but I couldn’t find the right variable to set. Turns out I didn’t look hard enough. […]