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.$$
You're better off using the Perl module Mail::Sendmail to send mail (and no, this doesn't use the sendmail program undeneath).
%mail = ( from => '[EMAIL PROTECTED]', to => '[EMAIL PROTECTED]', subject => 'Hello world', );
$mail{body} = <<EOF; Some silliness EOF
sendmail(%mail)
You need to be running a SMTP server on the local machine (like sendmail). You might need to alter the configuration of this to - let you send mail off the box - be looser about checking 'From' addresses
Usually if you find yourself calling an external program in production code then it's a hint to go looking for a suitable module.
Cheers, Glen
-- SLUG - Sydney Linux User's Group - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug