The new trick with spam is to send a message with only images that have embedded links and no text that mail rules can trigger on. I’m Getting sick of this spam. I worked with rules but there is no ability to trigger on a message with “no content” or “no text”.
Can anyone point me in the direction that tells a mail message to run an applescript (I know how to do this) and check the message for no content or only images, then delete the message.
If you need clarification, I can rewrite this post.
In what form this images contain the URLs? Without providing example it is difficult to help you. It is QR code images? You can provide screenshot at least?
No any message received from you. But I created test messages and sent them to myself successfully. Then I filtered them with following rule condition:
using terms from application "Mail"
on perform mail action with messages these_messages for rule this_rule
tell application "Mail"
repeat with eachMessage in these_messages
tell aMessage's content to set |contents| to {color, font, size}
if |contents| is {missing value, missing value, 0.0} then delete (contents of eachMessage)
end repeat
end tell
end perform mail action with messages
end using terms from
I named script as CheckEmptyContent.scpt and saved it to ~/Library/Application Scripts/com.apple.mail/ folder. Then I created one rule for Every message with Run Script “CheckEmptyContent”, and it worked. The spam messages was deleted by the rule not immediatelly, but after some time.
Post #2 of other topic, indicated by other user, is for messages chosen manually. As I understand, you asked for other thing - you asked for mail rule. So, create the rule manually, attach to it my script from post #4 of current topic.
Go Mail → Preferences → Rules → Add Rule. Add following rule, confirm to apply it (not for chosen messages):