Article View: news.software.nntp
Article #23166SUMMARY: innmail?
From: Ernie Oporto
Date: Tue, 11 Nov 1997 00:00
Date: Tue, 11 Nov 1997 00:00
66 lines
2313 bytes
2313 bytes
Ernie Oporto wrote in message <64aogf$4st@sdl.Warren.MENTORG.COM>...
>Inn 1.7 says that the included innmail is better to use than regular mail.
>Since I didn't see innmail anywhere in the distribution, I have to wonder
>where I can get such a beast. Anyone know?
>
>-Ernie
>
>
>
Here it is...
#!/usr/bin/perl5
#
# Author: James Brister <brister@vix.com> -- berkeley-unix --
# Start Date: Fri, 25 Apr 1997 14:11:23 +0200
# Project: INN
# File: innmail.pl
# RCSId: $Id: innmail,v 1.2 1997/07/23 14:13:28 brister Exp $
# Description: A simple replacement for UCB Mail to avoid nasty security
# problems.
#
$0 =~ s!.*/!! ;
require 5.001 ;
require 'getopts.pl' ;
# =()<require "@<_PATH_PERL_SHELLVARS>@" ;>()=
require "/news/lib/innshellvars.pl" ;
$sm = $inn::sendmail ;
die "Sendmail path is not absolute\n" unless ($sm =~ m!^/!) ;
$usage = "usage: $0 -s subject addresses\n\n" .
"Reads stdin for message body\n" ;
&Getopts ("s:h") || die $usage ;
die $usage if $opt_h ;
if ( !$opt_s ) {
warn "No subject given. Hope that's ok\n" ;
$opt_s = "NO SUBJECT" ;
}
# fix up any addresses.
foreach ( @ARGV ) {
s![^-a-zA-Z0-9+_.@%]!!g ;
push (@addrs,$_) if ($_ ne "") ;
}
die "No addresses specified\n\n$usage" unless @addrs ;
# startup sendmail without using the shell
$pid = open (SENDMAIL,"|-") ;
if ($pid == 0) {
exec ($sm,@addrs) || die "exec of $sm failed: $!\n" ;
} elsif ($pid < 0) {
die "Fork failed: $!\n" ;
}
print SENDMAIL "To:\t", join (",\n\t",@addrs), "\n" ;
print SENDMAIL "Subject: $opt_s\n" ;
print SENDMAIL "\n" ;
while (<STDIN>) {
print SENDMAIL $_ ;
}
close (SENDMAIL) ;
exit ;
Technical Details
Message-ID:
<64b6t9$7uf@sdl.Warren.MENTORG.COM>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<64aogf$4st@sdl.Warren.MENTORG.COM>Show Full Headers
Complete Article Headers
Message-ID: <64b6t9$7uf@sdl.Warren.MENTORG.COM> Subject: SUMMARY: innmail? Date: Tue, 11 Nov 1997 00:00:00 +0000 From: "Ernie Oporto" <ernie_oporto@mentorg.com> References: <64aogf$4st@sdl.Warren.MENTORG.COM> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 289550192 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: Mentor Graphics Newsgroups: news.software.nntp