On 5/12/04 7:43 AM, Bruce Klutchko <[EMAIL PROTECTED]> wrote:

> My ISP, in its infinite wisdom, has started adding the words  *Possible Spam*
> to the subject of my email whenever it deems that I didn�t really want that
> mail. No way to opt out of the plan, no white list, and no relief in sight.
> I�ve called and emailed them twice.
> 
> Needless to say, their spam filter picks up about 50% of real spam and gets
> �only� 15% of legitimate email. Grrr.
> 
> Because they provide the cable TV and cable modem, I�m looking for
> alternatives short of switching.
> 
> Could an applescript look through the subject lines of email and remove those
> words?

Yes.

For example, my university mail server uses a spam tool that adds "[SPAM: ##
xx%]" to the beginning of the subject line of possible spam messages, where
the number of pound signs and the percentage value indicates the certainty
it is a spam message.  Attached below is code from an AppleScript script I
use to remove this type of spam tag.  I have a rule for incoming messages
that runs the script for each message having a subject line beginning with
the text "[SPAM:".

You could modify the script for the spam tag used by your ISP.  Notice that
in my case the spam tag text changes from message to message because of
changes in the certainty percentage.  If your spam tag is the constant text
"*Possible Spam*", you would not need to evaluate the subject line character
by character but could set the subject line to the text after the tag, as
in:

set subject of SelectedMessage to text from characters 17 to end �
  of subject of SelectedMessage

Once you have created your script and attached it to a rule, you can select
already received messages in a folder and run the rule manually from the
Message menu to remove the spam tag from older messages.  You can also put
the script in the "Entourage Script Menu Items" folder so that it can be run
from the Entourage script menu.

If you are using an IMAP account, be aware that the script will alter the
subject line of the local copy of messages but does not change the subject
line of messages on the server.

-Jeffrey Berman


----- Attachment follows -----

tell application "Microsoft Entourage"
  set Selected to current messages
  if Selected is {} then return
  
  repeat with SelectedMessage in Selected
    set SubjectText to subject of SelectedMessage
    
    if SubjectText begins with "[SPAM:" then
      repeat with Num from 1 to length of SubjectText
        if character Num of SubjectText is "]" then
          if length of SubjectText > Num + 1 then
            set subject of SelectedMessage to text from �
              character (Num + 2) to end of SubjectText
            -- removing spam label and following space
          else
            set subject of SelectedMessage to "<no subject>"
          end if
          
          exit repeat
        end if
      end repeat
    end if
    
  end repeat
end tell

----- End of attachment -----

--
To unsubscribe:
<mailto:[EMAIL PROTECTED]>
archives:
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to