I have this script which runs as root, and when it fails to do something it needs to send a mail using postfix (actually the regular mail command on Centos5).
The problem is that the "from" user in the email is "root", how can I change it to another user?
Since you're using postfix, use the postfix sendmail drop-in:
You can always create a new user on the system, and run the "mail" command using that user: