<P>
  Thanks Rick,<BR>
As u suggested sendmail works fine with -f option to send as a different user.<BR>
I need to attach a zip file and some messages in the body. I am not able to achieve this completely. I am using uuencode along with sendmail. I can receive the attachement with this command. <BR>
" uuencode file.zip file.zip | sendmail -t to-user@mycompany.com " <BR>
<BR>
But I need to add some text message in the mail so if I give this command<BR>
 " uuencode file.zip file.zip | sendmail -t to-user@mycompany.com -oi <mailtext "<BR>
<BR>
then I only receive the content of "mailtext"(file containing message body)  but not the zip file <BR>
<BR>
I appreciate if anyone can suggest me to send email with attachemnt as well as body msg thro sendmail.<BR>
<BR>
Thanks,<BR>
TG<BR>
<BR>
<BR>
<BR>
On Thu, 07 Apr 2005 Rick Stevens wrote :<BR>
>Tech Guy wrote:<BR>
>>Hello Everyone,<BR>
>><BR>
>>I have a shell script that does some functions and finally sends the report through the command "mail" in the script itself. The script has to be run as root. The script works fine and we do receive emails with the report.<BR>
>><BR>
>>But it sends the email as root. I want the mail to be sent as a different user ( might not have account on that system) say someuser@someadddress.com<BR>
>><BR>
>>I want to know if its possible to change the from address to someuser other than root<BR>
><BR>
>I'm assuming the script is a simple shell script, so "mail" invokes the<BR>
>standard "/bin/mail" program.  In that case, no, you can't spoof it,<BR>
>because mail always sets the sender address as the user who ran it.<BR>
><BR>
>If, however, you modify the script so it uses sendmail instead, you can<BR>
>spoof it--but only if the user running the script is root.  You can use<BR>
>the "-f from-user@somedomain.com" option to sendmail:<BR>
><BR>
>sendmail -f from-user@somedomain.com<BR>
><BR>
>sendmail will expect the mail content to be fed to its stdin as mail<BR>
>would.  Note that this may cause messages such as:<BR>
><BR>
>     ...root set sender to from-user@somedomain.com using -f<BR>
><BR>
>to appear in /var/log/maillog.  Just wanted to warn you.<BR>
>----------------------------------------------------------------------<BR>
>- Rick Stevens, Senior Systems Engineer     rstevens@vitalstream.com -<BR>
>- VitalStream, Inc.                       http://www.vitalstream.com -<BR>
>-                                                                    -<BR>
>-              Careful!  Ugly strikes 9 out of 10 people!            -<BR>
>----------------------------------------------------------------------<BR>

</P>
<br><br>
<A target="_blank" HREF="http://clients.rediff.com/signature/track_sig.asp"><IMG SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom" BORDER=0 VSPACE=0 HSPACE=0></a>