Leopard has problems with rules in Mail.app that call AppleScripts that, in turn, generate a new Mail message. The scripts won't run from the rule, even though they work fine in Script Editor. Here's a workaround...
Have your rule in Mail run an AppleScript that calls a shell script, like this:
Then have that shell script run the main AppleScript. Here's an example of what the shell script (shell_script.sh in this case) might look like:
do shell script "/Users/murphymac/shell_script.sh"
Design the main AppleScript so it targets certain messages, like a Mail rule would. Here's a simple example for selecting messages based on subject:
Here's a working example of a script that checks the inbox and acts on certain messages.
tell application "Mail" activate delay 1 tell (first message of inbox whose subject is "macosxhints") ¬ to if exists then -- insert actions to be taken here end if end tell
Mac OS X Hints