Great Circle Associates Majordomo-Users
(October 1994)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: WWW + Majordomo (here's the InterNIC code)
From: Paul Phillips <psphilli @ sdcc8 . UCSD . EDU>
Date: Mon, 31 Oct 1994 17:06:31 -0800 (PST)
To: Majordomo-Users @ GreatCircle . COM
In-reply-to: <aadadf5a01021003bdd6@[192.9.200.100]>
Reply-to: Paul Phillips <psphilli @ sdcc8 . UCSD . EDU>


On Mon, 31 Oct 1994, Don Gray wrote:

> Can someone post this when the get the code?  I imagine a lot of people
> here would like to get a copy (or just send it to me, cause I could use
> it!).

I wasn't aware that the response for this would be so high (as I said, 
I'm not at InterNIC any more but the person that now answers guide mail 
politely informed me of an incoming deluge...)

I requested a copy for myself, I hadn't seen it in a while.  Just so 
nobody gets the wrong idea, I can tell that I didn't write 100% of this 
by a couple comments that aren't my style.  I hadn't intended this to go 
into production; I must have leveraged somebody else's work.  I did write 
the majority however.  I just performed a quick hack that should have 
made it Perl5 compatible; hopefully I didn't break it.  This was never 
designed to be general, so the listnames are hardcoded.  There, enough 
disclaimers :-)

If there is enough interest, I can see if I can find the time to put 
together a more general and comprehensive package.  It would appear that 
there is.  To see how the form in the HTML page should look, see the URL

  http://www.internic.net/internic/lists/majordomo.html

and here is the code it's passed to:

--- Cut here --
#!/usr/local/bin/perl

require '/infoguide/httpd/cgi-lib/cgi-lib.pl';

# This should match the mail program on your system.
$mailprog = '/usr/lib/sendmail';

# Your majordomo
$majordomo = 'majordomo@is.internic.net';

&ReadParse;
print &PrintHeader;

&print_error_message unless $in{'from_name'};
&print_error_message unless $in{'from_email'};

if ( ($in{'net-happenings'} EQ "none") && 
     ($in{'scout-report'} EQ "none") && 
     ($in{'net-happenings-digest'} EQ "none") ) {
	&print_error_message;
}
	
# Now send mail to $recipient

open (MAIL, "|$mailprog $majordomo") || die "Can't open $mailprog!\n";
select(MAIL);
print "Reply-to: $in{'from_email'} ($in{'from_name'})\n";
print "Subject:\n\n";

if($in{'net-happenings'} NE "none") {
	if ($in{'net-happenings'} EQ "subscribe") {
		print "subscribe net-happenings $from_email\n";
	} elsif ($in{'net-happenings'} EQ "unsubscribe") {
		print "unsubscribe net-happenings $from_email\n";
	} elsif ($in{'net-happenings'} EQ "info") {
		print "info net-happenings\n";
	}
}
	
if($in{'net-happenings-digest'} NE "none") {
	if ($in{'net-happenings-digest'} EQ "subscribe") {
		print "subscribe net-happenings-digest $from_email\n";
	} elsif ($in{'net-happenings-digest'} EQ "unsubscribe") {
		print "unsubscribe net-happenings-digest $from_email\n";
	} elsif ($in{'net-happenings-digest'} EQ "info") {
		print "info net-happenings-digest\n";
	}
}

if ($in{'scout-report'} NE "none") {
	if ($in{'scout-report'} EQ "subscribe") {
		print "subscribe scout-report $from_email\n";
	} elsif ($in{'scout-report'} EQ "unsubscribe") {
		print "unsubscribe scout-report $from_email\n";
	} elsif ($in{'scout-report'} EQ "info") {
		print "info scout-report\n";
	}
}

select(STDOUT);
close (MAIL);

&print_sent_message;
exit 0;

# ------------------------------------------------------------

# Print out a content-type for HTTP/1.0 compatibility

sub print_sent_message
{
    print "<HEAD><TITLE>Request sent.</TITLE></HEAD>\n\n";
    print "<BODY>\n\n";
    print "<H2>Your message has been been sent to majordomo.</H2>\n";
    print "You should be receiving an acknowledgement shortly.\n\n";
    print "</BODY>\n";
    exit 0;
}

sub print_error_message
{
    print "<HEAD><TITLE>Error processing your request!</TITLE></HEAD>\n\n";
    print "<BODY>\n\n<H1>Error processing your request!</H1><P>\n\n";
    print "Your message did not contain all the necessary information.<P>\n";
    print "Did you include both your name and email address?\n\n";
    print "</BODY>\n";
    exit 0;
}
-- Cut here --

 -PSP




References:
Indexed By Date Previous: List exists, but can't subscribe.
From: Marc <mrussell@willamette.edu>
Next: majordomo 1.92 - lists command doesn't work
From: "Douglas Gatchell" <dgg@lanl.gov>
Indexed By Thread Previous: Re: WWW + Majordomo (plz post the InterNIC code)
From: don@talarian.com (Don Gray)
Next: Re: WWW + Majordomo (plz post the InterNIC code)
From: "Stephen A. Brenner" <sbrenner@efn.org>

Google
 
Search Internet Search www.greatcircle.com