Another Mail.app rule to catch image spam

ImagespamstandfirstA poster on macOSXHints has described a rule designed to block the current plague of image-bearing spam.

It’s an improvement, perhaps, on the image spam catching rule I posted three months ago.

Having read the post and the suggestion in the comments, I’ve tweaked my rule for this a bit.

It now looks like this:

Imagespam

Most of the image spam I get contains a GIF file.

I like the idea of setting the colour to a particular colour so that I can see at a glance which messages the rule has moved. It gives a warm fuzzy feeling and it helps me to scan quickly for false positives.

Tags: , , , , , , ,

Related posts

10 Responses to “Another Mail.app rule to catch image spam”

  1. Torben says:

    Thanks

    Just minutes after I set up a rule like you have i received a spam message with matced excactly.

    - It had a .gif
    - I was multipart/related (Raw source read: Content-Type: multipart/related;)
    - Was not in my address book

    …but Mail didn’t catch it. I found it was the Content-Type because as I deleted that condition Mail caught it.

    Any idea why ?

  2. Miller says:

    I don’t have an option for Content-Type in the selecting the rules. The only option I have for Content is Message Content and then whether it Contains, Does Not Contain, Begins With, Ends With, or Is Equal To. I’m running version 2.1 (752/752.2) under OS X 10.4.7. Checks for software updates reveal there are none.

  3. The Plaid Cow says:

    At the bottom of the rules drop down you can “Edit Header List…” and add it.

  4. Sigurdur Armannsson says:

    I have tried at least two other versions of similar rules to catch those boring spam messages. Then I tried for SpamSieve for two weeks and after it had cought every one of this kind of spam I bought it. I feel like a free man again. It’s even fun to get spam now and see it stashed in one folder called Spam without me hardly moving a finger.

  5. Richard5 says:

    I don’t have image spam because I use DSpam, it is learning very quickly in adapting. Together with the standard Junk rules in my mail program they train each other and are a perfect solution I’m almost 99% free of spam. The only issue might be is that you need to run your own mailserver…

  6. tobias s buckell says:

    Dude, best Christmas gift I’ve gotten yet! Thank you so much.

  7. flec says:

    I use JunkMatcher (free, PPC only) and it has now learn to effectively catch all those image spams as well.

  8. RikerJoe says:

    Torben wrote: “Just minutes after I set up a rule like you have i received a spam message with matced excactly.

    - It had a .gif
    - I was multipart/related (Raw source read: Content-Type: multipart/related;)
    - Was not in my address book

    …but Mail didn’t catch it. I found it was the Content-Type because as I deleted that condition Mail caught it.

    Any idea why ?”

    Here is my guess. You did not include a “Stop Evaluating Rules” at the end, which actually should be added to the example above. What may be happening is that a subsequent rule is overriding the actions of this rule. Hope that helps.

  9. Monster says:

    I created this rule, but now I cannot edit it nor can I edit any copies of it.

    odd huh?

    Using version 1.3.11 with mac osx 10.3.9
    I can delete it so I’m not that concerned, but it is curious.

    any ideas?

  10. Mark says:

    I just wrote an applescript and had it run whenever a message is not from someone in my address book. This way I can adjust the filter to only work emails that contain exactly one small gif image.


    (*set theOutputFolder to (choose folder) as string
    *)
    using terms from application "Mail"
    on perform mail action with messages theSelectedMessages for rule theRule
    tell application "Mail"
    repeat with eachMessage in theSelectedMessages
    set theAttachments to every mail attachment of eachMessage
    set numAttachments to length of theAttachments

    if numAttachments is equal to 1 then

    set theAttachment to item 1 of theAttachments
    set attachmentType to (MIME type of theAttachment)
    set attachmentSize to (file size of theAttachment)

    if attachmentType is equal to "image/gif" then
    if attachmentSize is less than 100000 then
    move eachMessage to mailbox "picspam"
    end if
    end if
    end if
    end repeat
    end tell
    end perform mail action with messages
    end using terms from

Leave a Reply