rewriting Mail.app mail headers with automator

Greetings - I’m not new to programming but I’m pretty new to Automator and applescript. I have mail that is forwarded from another account and appears in my inbox to be from myself instead of the sender. The original From header is in the body of the mail. This is a result of either a lousy mail system (Groupwise) a lousy sys admin, or both. I would like to create an automator workflow that can rewrte the mail header and fix the From field. Seems to me that I need to find automator actions that allow me to search and replace text- similar to grep and sed unix tools. I also need to figure out how to edit Mail items or delete and insert new mail items. Any suggestions where to start?

Many thanks!
Mike

Mike:

I am not sure that Mail is that scriptable. I am pretty sure that AppleScript cannot alter the From or the Subject of a received message, but I believe that the Header is up for editing. I know that Microsoft has made gargantuan efforts to make Entourage extremely scriptable, and there are a lot of scripts out there for it. You may have better luck posting this in the OS X forum.