help with mail.app please
help with mail.app please
- Subject: help with mail.app please
- From: Warren Pollans <email@hidden>
- Date: Wed, 22 Sep 2004 11:09:36 -0400
Hello,
I'm using 10.2.8 and would like some help/direction with what should be
basic mail.app scripting. I want a rule to send each incoming mail
message through a shell script that runs clanscan (virus checker) and
returns status - If the status is not zero, I want the mesg moved to
mailbox "Quarantine".
I'm trying to save each mail to a file and pass the file to clamscan.
My first problem is that "theMailFile" is not being written. I know
I'm getting each mesg because I can "display dialog theContent" but I'm
not sure if the "content" is what I want - I would like to be able to
get the contents, including attachments, of the mesg. My attempt at
doing this is below - I don't know what I'm doing here - obvious yes?
:-)
Could someone please direct me to some "applescripting mail.app" info.
Thanks,
Warren
+++++++++++++++++++++++++++++++
on perform_mail_action(info)
tell application "Mail"
set selectedMessages to |SelectedMessages| of info
set theMailFile to "/tmp/thismailmsg"
repeat with eachMessage in selectedMessages
set theContent to content of eachMessage
save theContent in theMailFile
set theCommand to "/usr/local/bin/clamscan --quiet " & theMailFile
set spamStatus to do shell script theCommand
if (spamStatus > 0) then
set mailbox of eachMessage to mailbox "Quarantine"
end if
end repeat
end tell
end perform_mail_action
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden