Subscribe to
Posts
Comments
NSLog(); Header Image

Deleting Future Spam

A lot of the spam I receive comes from the future. I presume that this is because most people sort their email by date, and by sending email from 2016, spammers believe they'll stay higher in a person's list.

SpamSieve grabs all of my email and shoves it into folder I've named "* Shit" (to sort it where I'd like it), but mail from 2016 hinders my ability to scan the last 100 messages for false positives. So, I wrote an AppleScript and I now run it once an hour. Here's the script:

on run
  tell application "Microsoft Entourage"
    set msgList to (every incoming message of ¬
      folder "* Shit" whose time sent > ¬
      ( (current date) + 6 * hours) )
    repeat with theMsg in msgList
      --  if theMsg is not flagged then
      move theMsg to deleted mail folder
      delete theMsg
      --   end if
    end repeat
  end tell
end run

There you have it. Now I don't even have to look at spam from the future.

3 Responses to "Deleting Future Spam"

  1. Why not just delete anything that's after today or tomorrow's date? Even anything that's from now()+6m would do I'd think.

  2. Keep in mind that you also run the risk of matching mail from people who simply have their computer's clock set incorrectly. Also, I don't know how Entourage handles mail from other time zones but that could be an issue if they're more than 6 time zones away.


Comments RSS

Leave a Reply


Warning: Undefined variable $user_ID in /var/www/vhosts/nslog.com/httpsdocs/wp-content/themes/nslog/comments.php on line 96

Please abide by the comment policy. Valid HTML includes: <blockquote><p>, <em>, <strong>, <ul>, <ol>, and <a href>. Please use the "Quote Me" functionality to quote comments.