Re: [SLUG] URGENT: Please help, Mail problem (FROMField=NOBODY....change?)

2003-08-29 Thread Glen Turner

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


Re: [SLUG] URGENT: Please help, Mail problem (FROMField=NOBODY....change?)

2003-08-29 Thread Scott Ragen
[EMAIL PROTECTED] wrote on 29-08-2003 04:38:24 PM:

 
  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).
 
If this is not possible to install the module, use the sendmail command
`sendmail -f [EMAIL PROTECTED] [EMAIL PROTECTED]  /tmp/mailout.$$`

(Remember, you will need to have Subject: Your subject here on the first 
line of of /tmp/mailout.$$)
Also note, that sendmail is not normally in a users path.

Cheers,

Scott
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug


Re: [SLUG] URGENT: Please help, Mail problem (FROMField=NOBODY....change?)

2003-08-28 Thread Norman Gaywood
On Thu, Aug 28, 2003 at 04:16:58PM -0700, Jared Pritchard wrote:
 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!!!

Have a read of:

perldoc -q mail

and look for the section How do I send mail?

Cheers.
-- 
Norman Gaywood, Systems Administrator
School of Mathematics, Statistics and Computer Science
University of New England, Armidale, NSW 2351, Australia

[EMAIL PROTECTED]Phone: +61 (0)2 6773 2412
http://turing.une.edu.au/~normFax:   +61 (0)2 6773 3312

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug


Re: [SLUG] URGENT: Please help, Mail problem (FROMField=NOBODY....change?)

2003-08-28 Thread Oscar Plameras

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=NOBODYchange?)


 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