One approach is to format each line command as follows: su username -c "mail -s subject [EMAIL PROTECTED] < /tmp/mailout.$$"
This assumes your system knows to append '@mydomain.com' to yield '[EMAIL PROTECTED]' and you are running in super shell. Oscar Plameras www.purl.org/net/aboutme ----- Original Message ----- From: "Jared Pritchard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 28, 2003 4:16 PM Subject: [SLUG] URGENT: Please help, Mail problem (FROM Field=NOBODY....change?) > Hi - I'm new to this group, and relatively new to linux.... > (I work in it every day and have done for the past 8-10months or so - but > it has been all in VI editing HTML & PERL scripts etc. so no specific > linux commands besides the basics) > > but now I have reached a point in the PERL scripts that it sends emails > out to a list of users... however, when they receive them, it is addressed > from 'nobody'. We REALLY REALLY need to change that!!! > > I use the command 'mail' in the form > mail -s subject [EMAIL PROTECTED] < /tmp/mailout.$$ > > I cannot find an option in the 'mail' man pages that allows me to specify > the 'from' section, and I am assuming that it is the 'user' that sends the > email that fills in that position. Maybe the user is guest, or nobody or > whatever - i don't know :/ > > How can I change the user or specify the 'from' field in the email without > using a different mailing program? I need it to be admin or something - > > If I have to change mail programs, I will opt for sendmail in the short > term, so what I would need the correct syntax to accomplish the same as > above WITH from defined as well :) (the man pages for sendmail weren't > much help in this regard) > > Any help will be muchly appreciated!!! > > Regards, > Jared Pritchard > -- SLUG - Sydney Linux User's Group - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug