Apr 23, '04 09:41:00AM • Contributed by: Anonymous
(*
Script to delete (move to trash) each message with DELETED0.TXT
Christian Pagé
*)
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with eachMessage in theMessages
set theSource to source of eachMessage
set theAccount to account of mailbox of eachMessage
try
if theSource contains "DELETED0.TXT" or ¬
theSource contains "deleted0.txt" then
set read status of eachMessage to true
delete eachMessage
end if
end try
end repeat
end tell
end perform mail action with messages
end using terms from
[robg adds: Although not much detail was provided in the hint on setting up the rule, I think it's relatively straightforward: Create the new rule above your Junk Mail rule, set the "If" pop-up to "Any" and "Every message," and set the "Perform" pop-up to "Run AppleScript," and point it at the script you just creatd. You could easily use an edited version of the script to delete any sort of email based on the name of the attachment. I don't get many of the DELETED0.TXT spams, for instance, but I get tons of .PIF attachment spams.]
