Hi folks,
It has been a long time I don't post here. Please forgive me for being away.
Problem:
I have an old Mac in my LAN that used to work as an email server (postfix server).
We moved its domain to another server outside our company.
In order to maintain a fax receiving routine we kept the server running locally, since it receives faxes on a modem (believe me, there are still people out there who still use faxing), and unix's efax forwards the PDFs to a dozen mail accounts in our LAN. (the server can not send email outside our LAN since it has no valid IP address)
I am trying to make my Desktop computer, to use a Mail.app rule to forward me the email and attached PDF to another email account, but it can not use the very same email account it received.
Can someone be so kind to point me why the following code works ok on my MacBook air running Snow Leopard and Mail 4.1, and it does not work on my G5 computer running Leopard (10.5.8) and Mail.app 3.6?
====== code begins
using terms from application "Mail" on perform mail action with messages these_messages for rule this_rule set sourceFile to "MacBookAir HD:Users:bernardo:Desktop:forward.eml" repeat with thisMessage in these_messages tell application "Mail" set thisSource to the source of thisMessage as string set _subject to subject of thisMessage as string set _file to open for access sourceFile with write permission set eof of _file to 0 write thisSource to _file close access _file say "sending an email I received with subject " & _subject set newMessage to make new outgoing message with properties {visible:true, sender:sender_address, content:"You have this new fax..."} tell newMessage set subject to thisMessage's subject make new to recipient with properties {address:recipient_address} tell content to make new attachment with properties {file name:sourceFile as alias} at after the last paragraph end tell
set visible of newMessage to true send newMessage set found to outgoing messages say (count of found) end tell end repeat
end perform mail action with messages end using terms from
====== code ends
Thanks!
Bernardo |