-- Adresse an die die Spam weitergelietet werden soll
set spamcopAddress to "spam@derda.de"
-- Ob die markierten eMail auch in Mail.app als Junk markiert werden sollen
set markAsJunk to false
-- Ob vor dem versenden noch mal nachgefragt werden soll.
set sendImmediately to true
tell application "Mail"
-- Nur für den Fall das die eMail auch in Mail.app markiert werden soll
set junkBox to junk mailbox
-- Iteration über alle ausgewählten eMails in Mail.app
set selectedMessages to the selection
repeat with thisMessage in selectedMessages
set thisSubject to the subject of thisMessage
set thisSource to the source of thisMessage
-- eMail auch in Mail.app als Jumk markieren
if markAsJunk then
-- set is junk mail of thisMessage to true
set junk mail status of thisMessage to true
set the mailbox of thisMessage to junkBox
end if
-- Eine neue email erstellen
set newMessage to make new outgoing message with properties ¬
{subject:"SPAM-FWD: " & thisSubject, content:thisSource & return}
tell newMessage
-- Damit man sieht was passiert.
set visible to true
make new to recipient at end of to recipients with properties ¬
{name:"Spam Reporting", address:spamcopAddress}
end tell
-- ungefragt senden oder noch mal nachfragen
if sendImmediately then
send newMessage
else
activate
set theResult to display dialog "Send message?" buttons ¬
{"Yes", "No"} default button 1
set sendNow to button returned of theResult
if sendNow is equal to "Yes" then
send newMessage
else
delete newMessage
end if
end if
end repeat
end tell