diff -u add_listuser.html.orig add_listuser.html --- add_listuser.html.orig 2003-04-13 04:48:02.239997000 -0400 +++ add_listuser.html 2003-04-13 05:36:19.850005000 -0400 @@ -23,11 +23,12 @@
for example:Forward: joe@domain.comLocal Name: salesAll mail sent to sales will be forwarded to joe@domain.com 011 Add List Moderator 012 Add Moderator to mailing list -013 Email Address: -014 Add Subscriber to mailing list +013 Email Address(es): +014 Add Subscriber(s) to mailing list 015 Add Mailing List 016 Mailing List Name: 017 List owner email address: diff -u confirmnewsubscriber.pl.orig confirmnewsubscriber.pl --- confirmnewsubscriber.pl.orig 2003-04-13 06:39:28.000000000 -0400 +++ confirmnewsubscriber.pl 2003-04-13 06:05:37.739994000 -0400 @@ -0,0 +1,55 @@ +#!/usr/local/bin/perl + +# Author: Jeremy Kister - http://jeremy.kister.net./ +# Make sure over zealous list admins dont add people to their [spam] list w/o consent +# coded outside of qmailadmin because of the authors [lack of] knowledge of C +# v.2 - initial version + tiny mods + +use CGI qw(:standard); +use Net::SMTP; + +my $q = new CGI; +print $q->header(), $q->start_html(); + +if( (my @subs=split /[\s\n]+/, $q->param('newu')) && (my $dstaddr=$q->param('modu')) && + (my $dstdomain=$q->param('dom')) && (my $user=$q->param('user')) && (my $time=$q->param('time')) ){ + + my $smtp = Net::SMTP->new('localhost'); + my $to = $dstaddr . "-subscribe\@" . $dstdomain; + my $number=0; + foreach my $sub (@subs){ + $number++; + # make sure what we have inside $sub is a valid looking email address + if( $sub =~ /^[a-z0-9_\.\+\-\=\?\^\#]{1,64}\@([a-z0-9\-]{1,251}\.){1,252}[a-z0-9]{2,4}$/i){ + # good email address - make sure it isnt a dupe + if( $hash{$sub} == 1 ){ + print "Error (address $number): ", + "you already asked me to subscribe $sub (skipping) \n"; + next; + }else{ + $hash{$sub} = 1; + # good email address - not a dupe - generate confirmation email + + $smtp->mail($sub); + $smtp->recipient($to); + $smtp->data(); + $smtp->datasend(' '); + $smtp->dataend(); + $smtp->reset(); + } + }else{ + # not a valid email addr + print "Error (address $number): ", + "$sub doesnt seem to be a valid email addr (skipping) \n"; + } + } + $smtp->quit; +}else{ + print 'coudnt find info.. click here to go back', "\n", + $q->end_html; + exit; +} + +print 'done... click here to return to the Mailing Lists page.', "\n", + $q->end_html();