The following perl script looks very promising, however i get an error
that cgi-lib.pl returns an invalid value ... how should this be used??
When I run it (the perl script) I get ...
cgi-lib.pl did not return a true value at ./majordomo.scr line 3.
that script is as follows ...
-----------------------------------------
#!/usr/bin/perl
require "cgi-lib.pl";
print &PrintHeader;
-----------------------------------------
the entire script is also included below
I run Linux 1.2.5 and perl 4.036
Can anyone tell me what is wrong?
Best Regards
sm
--------------------------------------------------------------------
Steve MacLeod Microcomputer Specialist (902)539-5300x625
Computer Centre University College of Cape Breton
Sydney, N.S. Fax (902)562-0119 Canada B1P 5S2
> >Date: Mon, 31 Oct 1994 22:30:19 -0800 (PST)
> >From: Paul Phillips <paulp@primus.COM>
> >Subject: Initial release of www-majordomo
> >To: majordomo-users@greatcircle.com, majordomo-workers@greatcircle.com
> >Sender: majordomo-users-owner@GreatCircle.COM
> >Precedence: bulk
> >Content-Length: 4813
> >X-Status:
> >
> >The interest in the WWW interface to majordomo has inspired me to take a
> >crack at a more general package. This is tested and works, but I would
> >appreciate feedback on what features you would like added or changed; I
> >waffled on whether to include such commands as "get" and "index".
> >Suggestions on what language to use for the commands that is both
> >succinct and easily understood are also desired.
> >
> > -Paul Phillips
> > Primus Consulting
> >
> >
> >#!/usr/local/bin/perl
> >#
> ># WWW-Majordomo v0.1beta :-)
> ># Copyright 1994, Paul Phillips (paulp@primus.com)
> >#
> ># Required software:
> >#
> ># majordomo, by Brent Chapman and John Rouillard
> ># ftp://ftp.greatcircle.com/pub/majordomo/majordomo-1.92.tar.Z
> >#
> ># cgi-lib.pl, by Steven E. Brenner
> ># ftp://ftp.ncsa.uiuc.edu/Web/httpd/Unix/ncsa_httpd/cgi/cgi-lib.pl.Z
> >#
> ># Be aware that this software is potentially abusable. The current
> ># lack of security in smtp and http makes this situation unavoidable.
> ># It does not make possible anything that was not already, but it
> ># does make net foolishness easier. Neither I nor Primus take any
> ># responsibility for any problems that arise due to the misuse of this
> ># software. Caveat webmaster.
> >#
> ># Standard disclaimers apply.
> >
> ># Tune these for your system
> >
> ># Location of cgi-lib; this is required
> >$cgilib = '/usr/local/etc/httpd/lib/cgi-lib.pl';
> >
> ># Location of your delivery agent; usually /usr/lib/sendmail
> >$mailprog = '/usr/lib/sendmail';
> >
> ># Full hostname of machine majordomo runs on
> >$whereami = 'primus.com';
> >
> ># URL of this script
> >$this_url = 'http://www.primus.com/htbin/www-majordomo';
> >
> ># The mailing lists you want interfaces for should be listed here.
> ># Follow each majordomo mailing list name with the name you would like
> ># presented on the WWW page. Make sure to separate each entry by
> ># commas, but do not trail the last one with a comma.
> >
> >%lists = (
> > "foo-list",
> > "Foo List (for discussion of Foo!)"
> > );
> >
> ># You should not have to change anything below this line unless you
> ># enjoy Perl hacking.
> >
> >require $cgilib;
> >
> >&ReadParse;
> >print &PrintHeader;
> >
> >if($in{'from_email'}) {
> > &majordomo_mail;
> >} else {
> > &majordomo_html;
> >}
> >
> >exit 0;
> >
> >sub majordomo_mail {
> >
> > open (MAIL, "|$mailprog majordomo\@$whereami") ||
> > die "Can't open $mailprog!\n";
> > select(MAIL);
> >
> > print "Reply-to: $in{'from_email'}";
> > if($in{'from_name'}) {
> > print " ($in{'from_name'})\n";
> > } else {
> > print "\n";
> > }
> > print "Subject:\n\n";
> >
> > if($in{'which'} EQ "true") {
> > print "which $from_email\n";
> > }
> >
> > if($in{'lists'} EQ "true") {
> > print "lists\n";
> > }
> >
> > if($in{'help'} EQ "true") {
> > print "help\n";
> > }
> >
> > foreach(keys(%lists)) {
> > if($in{$_} EQ "subscribe") {
> > print "subscribe $_ $from_email\n";
> > } elsif($in{$_} EQ "unsubscribe") {
> > print "unsubscribe $_ $from_email\n";
> > } elsif($in{$_} EQ "index") {
> > print "index $_\n";
> > } elsif($in{$_} EQ "which") {
> > print "which $from_email\n";
> > } elsif($in{$_} EQ "who") {
> > print "who $_\n";
> > } elsif($in{$_} EQ "info") {
> > print "info $_\n";
> > }
> > }
> >
> >select(STDOUT);
> >close(MAIL);
> >
> >&print_sent_message;
> >return;
> >}
> >
> >sub majordomo_html {
> > print <<"EOM";
> ><HEAD>
> ><TITLE>WWW Majordomo for $whereami</TITLE>
> ></HEAD>
> >
> ><BODY>
> >
> ><H2>WWW Majordomo: $whereami</H2>
> >
> >You can perform majordomo mailing list commands for any of the available
> >lists by using the pulldown menus. The default action for each
> >list is to do nothing ("No Action"), but you can also subscribe,
> >unsubscribe, send information to yourself, obtain a list of available
> >files related to the list, or see who is subscribed to the list. The
> >results will be sent to your email address, which you must supply in the
> >"Email Address" input field.<P>
> >
> ><FORM ACTION="$this_url" METHOD="post">
> >Your Name (Optional):<BR>
> ><INPUT NAME="from_name"><P>
> >
> >Your E-Mail Address <STRONG>(Required!)</STRONG>:<BR>
> ><INPUT NAME="from_email"><P>
> >
> ><UL>
> ><LI><INPUT TYPE="checkbox" NAME="which" VALUE="true"> Which lists am I on?
> ><LI><INPUT TYPE="checkbox" NAME="lists" VALUE="true"> Catalog of available
> lists
> ><LI><INPUT TYPE="checkbox" NAME="help" VALUE="true"> Help!
> ></UL>
> >
> >EOM
> >
> > foreach(keys(%lists)) {
> > print <<"EOM";
> ><H2><EM>$lists{$_}</EM></H2>
> ><SELECT NAME="$_">
> ><OPTION VALUE="none" SELECTED>No Action
> ><OPTION VALUE="subscribe">Subscribe
> ><OPTION VALUE="unsubscribe">Unsubscribe
> ><OPTION VALUE="info">Send Information
> ><OPTION VALUE="index">Available files
> ><OPTION VALUE="who">Subscriber list
> ></SELECT>
> >
> >EOM
> > }
> >
> >print <<"EOM";
> ><P>
> ><INPUT TYPE="submit" VALUE="Send mail to majordomo">
> ><INPUT TYPE="reset" VALUE="Clear all fields">
> ></FORM>
> >
> ></BODY>
> >
> >EOM
> >
> > return;
> >}
> >
> >sub print_sent_message
> >{
> > print <<"EOM";
> >
> ><HEAD>
> ><TITLE>Request sent.</TITLE>
> ></HEAD>
> >
> ><BODY>
> >
> >Your message has been been sent to majordomo\@$whereami.<P>
> >You should be receiving an acknowledgement shortly.<P>
> >
> >Return to <A HREF="$this_url">WWW majordomo</A>.<P>
> >
> ></BODY>
> >
> >EOM
> >
> > return;
> >}
> >
> >
> >
> >
>
> ----------------------------------------------------------------------------
> ------------------------------------------------------------
> Steve MacLeod Microcomputer Specialist
> Computer Centre
> University College of Cape Breton Sydney, N.S. Canada
> 902-539-5300 x625
>
>
|
|