1. theRule is not used.
2. The variable a is not used within the repeat loop.
3. thisMessage is used but not set to anything.
using terms from application "Mail"
on perform mail action with messages messageList
tell application "Mail"
repeat with a from 1 to count of the messageList
set fromMsg to (sender of item a of messageList as string)
set subjMsg to (subject of item a of messageList as string)
set todoMsg to fromMsg & subjMsg
tell application "iCal"
tell calendar "Mail To Do"
set theDueDate to (current date)
make new todo at end with properties {summary:todoMsg, due date:theDueDate}
end tell
end tell
end repeat
end tell
end perform mail action with messages
end using terms from