3 # Preapproves the person and gets his/her message posted via processApproved
6 # get the directory where robomod is residing
7 $MNG_ROOT = $ENV{'MNG_ROOT'} || die "Root dir for moderation not specified";
10 require "$MNG_ROOT/bin/robomod.pl";
12 $GoodGuys = "$MNG_ROOT/data/good.guys.list";
14 $Argv = join( ' ', @ARGV );
17 open( PROCESS_APPROVED, "|processApproved $Argv" );
20 $From = $_ if( /^From: / );
22 print PROCESS_APPROVED;
28 while( <STDIN> ) { # Body
29 print PROCESS_APPROVED;
32 close PROCESS_APPROVED;
34 $From =~ s/^From: //g;
35 if( $From =~ m/([\w-\.]*)\@([\w-\.]+)/ ) {
38 print STDERR "From line `$From' is incorrect\n";
42 if( !&nameIsInList( $From, "good.guys.list" ) ) { # need to preapprove
43 &logAction( "Action: processPreapproved $From\n" );
44 open( GOOD_GUYS, ">>$GoodGuys" );
45 print GOOD_GUYS "$From\n";
48 print STDERR "$From already preapproved\n";