-- Downloaded From: http://c-command.com/scripts/spamsieve/rules-sample -- Last Modified: 2007-08-17 tell application "SpamSieve" -- Prune unused blocklist rules; this will be very slow if there -- are lots of rules, so you might want to use a "with timeout" block. -- It would be faster to do this using the the Blocklist window. tell blocklist delete every rule whose hits is 0 end tell -- Look up a rule by its text and enable it tell whitelist -- there may be more than one rule with this text set l to every rule whose text to match is "foo@bar.com" set r to item 1 of l set r's isEnabled to true end tell -- Makes a new blocklist rule that matches messages with zip -- attachments. tell blocklist make rule with properties {text to match:".zip", match field:any attachment name, match style:ends with style} end tell -- Easily make blocklist rules that match the From address. tell blocklist add sender rules for addresses {"foo@bar.com", "foo@baz.com"} end tell end tell