Mail sending issue

I have a script to run root commands on my server namely (alpha), If this commands run successfully I need to mail to myuser@domain.com
I need the email to be from alpha@domain.com not from root@alpha.com, Is there a way to do this while I'm running the script as a root

 
 
# cat myscript
 
if ( root command ) == 0
mail -s "Report" myuser@domain.com </tmp/msg
 

Thanks, Sara

You can try -r alpha@domain.com along with the mail command. But check in your man page as different OS would have their own meanings.

1 Like

Thanks, it is working :slight_smile: