Hi. I'm new to using Purify and trying to make it work.
I am using the Applescript Rules based method in Apple Mail and it works fine in the sense that it will move the offending email to Trash. But by doing so before the email hits the Inbox, my server does not appear to take note that the email has been downloaded to Mail and it keeps downloading the same spam emails over and over -- and putting them in the trash over and over. I've tried a variety of settings inside Mail to try to fix this, but it only returns to working when I uncheck the Purify Rule, let the email land in the Inbox, then move it to trash. If I do that, then Mail doesn't download more copies. So that pretty much localizes the issue to the way the Purify applescript is performing it's functions. I suppose that if Trash were emptied immediately this might solve the problem by notifying the server, but I don't want to do that in case of errors. I'd like to be able to see what's in the trash before it empties.
After some thought, I think that would be great would be to mark the offending email as Junk and let it continue to the Inbox, where Mail's Junk filter can handle it (either leaving it marked as Junk, or moving it to the Junk Mail folder). Or, alternatively, for the applescript to tag the Spam email in some way -- and then use another Mail Rule move the email to trash or Junk. The latter would work, I think, because I have other rules set up that move emails into folders as they come in and the server knows the email is delivered. It seems that by going outside Mail's rules and letting the Applescript do the moving is where the problem lies.
After doing a little research on Google, I thought I found a way to modify the Purify apple script to set status of Spam emails to Junk (see below). Unfortunately, it is not working. What seems to be happening, as far as I can tell, is that validated emails are being announced as validated, while no announcement and no Junk mail status change is happening to the emails identified as Spam by Purify. They just land in my inbox as if Purify had not processed them. I would love to have some help figuring out a solution -- of any kind -- to my problem. It is much appreciated, in advance.
[EDIT: Since posting a short time ago, I blacklisted an email account of my own and sent myself an email and this time Purify said aloud that the email was rated as "Spam, blacklisted:" and name of sender, and then said "Mail Error". I am, however, still getting other emails that are landing in my mailbox without comment by Purify, neither validated nor not validated. They are Spam emails; though I'm not sure if Purify would catch them as such]
Here was my effort at modifying the applescript:
on perform_mail_action(info)
tell application "Mail"
set theMessages to |SelectedMessages| of info
repeat with thisMessage in theMessages
try
set the_mailbox to mailbox of thisMessage
set the_account to account of the_mailbox
set the_email_addresses to email addresses of the_account
set the_full_name to full name of the_account
-- e-mail address
set the_email_address to item 1 of the_email_addresses
set the_rating to my Rate(the_full_name, the_email_address, source of thisMessage)
if the_rating contains "SPAM" then
say the_rating
set junk mail status of thisMessage to true
-- set mailbox of thisMessage to mailbox "Trash" of the_account
else if the_rating contains "IGNORE" then
say the_rating
set junk mail status of thisMessage to true
-- set mailbox of thisMessage to mailbox "Trash" of the_account
else
say "You have received validated email from " & my ExtractName(sender of thisMessage)
end if
on error
say "Mail error!"
end try
end repeat
end tell
end perform_mail_action
...
Thanks again in advance for the help.
Chris
