Subject: Re: mailing notifications automatically
To: Tony Hernadez <tony@cne-inc.com>
From: Todd C. Miller <Todd.Miller@courtesan.com>
List: tech-security
Date: 09/06/2000 08:46:46
  by mail.netbsd.org with SMTP; 6 Sep 2000 14:47:53 -0000
	by xerxes.courtesan.com (8.10.1/8.10.1) with ESMTP id e86EkkC30016;
	Wed, 6 Sep 2000 08:46:46 -0600 (MDT)
Message-Id: <200009061446.e86EkkC30016@xerxes.courtesan.com>
To: Tony Hernadez <tony@cne-inc.com>
cc: "'tech-security@netbsd.org'" <tech-security@netbsd.org>
Subject: Re: mailing notifications automatically 
In-reply-to: Your message of "Wed, 06 Sep 2000 09:16:20 EDT."
             <E10D54F27C6AD11196EF00600812C5CF067E9D@CNENT> 
References: <E10D54F27C6AD11196EF00600812C5CF067E9D@CNENT> 
Date: Wed, 06 Sep 2000 08:46:46 -0600
From: "Todd C. Miller" <Todd.Miller@courtesan.com>

In message <E10D54F27C6AD11196EF00600812C5CF067E9D@CNENT>
	so spake Tony Hernadez (tony):

> I'm trying to run a mail command that will email me a message
> automatically... I'm not sure how to use the mail command without manually
> typing in the message and hitting CTRL+D. anyone done something like this ?

I would suggest you _not_ run mail from any priviledged program
since it is subject to outside influence (see the recent suidperl
hole).  Sending mail via sendmail should be relatively safe and
fairly simple.  For an sh script:

sendmail -t <<EOM
From: whoever
To: someone.else
Subject: foo

message body
goes here
EOM

Or you can avoid the -t option and just specify the recepient on
the command line.

 - todd