*This message was transferred with a trial version of CommuniGate(tm) Pro*
I wrote this script to work with SpamSieve.

====
--Remove Listed Attachments by Andy Fragen <[EMAIL PROTECTED]>
--v.1.1

property badAttachment : {"winmail.dat", ".exe", "signature.asc",
"IMSTP", "smime.p7s", "PGP.sig"}
property spamAttachment : {".gif", ".jpg", ".jpeg", ".pif", ".scr", ".zip"}
property spamlabel : 7

tell application "PowerMail"
        set theMessages to current messages
        repeat with msg in theMessages
                if exists (attachments of msg) then
                        my stripAttachment(badAttachment, msg)
                        --if (name of storage of msg as string = "Spam") or 
(label of msg is
spamlabel) then
                        if label of msg is spamlabel then
                                my stripAttachment(spamAttachment, msg)
                        end if
                end if
        end repeat
end tell

on stripAttachment(propList, msg)
        tell application "PowerMail"
                repeat with attach in every attachment of msg
                        repeat with i from 1 to the number of items of propList
                                ignoring case
                                        --if (name of attach begins with item i 
of propList) or (name of
attach ends with item i of propList) then
                                        if (name of attach contains item i of 
propList) then
                                                --display dialog ("Found match: 
" & name of attach & ":" & id of msg)
                                                set f to file of attach
                                                tell application "Finder"
                                                        try
                                                                move f to trash
                                                        end try
                                                end tell
                                        end if
                                end ignoring
                        end repeat
                end repeat
        end tell
end stripAttachment
====

I call it in a filter after SpamSieve has labeled the message as Junk
-- 
Andy Fragen

On Tue, Mar 30, 2004, Jakob Riis said:

>
>I want to set up a Mail Filter that reacts to the filename of
>attachments. To be more specific I am trying to delete any message that
>contains a .pif file attachment. Does anybody know if that is possible
>somehow?
>
>Jakob Riis
>
>


Reply via email to