#!/usr/local/bin/perl -w use strict; use CGI qw(:standard); require hnet; my $output = new CGI; my ($sub, $nexturl, $to, $user, $referer, $remote_addr, $remote_ident); my $file = param('file'); my $num = param('num'); ##### my ($new, @message, %mes); if ($file and $num) { my $list = "revolution"; chdir "/storm/lib/logs/$list" || &end("Couldn't chdir! $!"); my $i = 0; opendir(D,"."); my @dirs = readdir(D); closedir(D); open(F, "$file") or &end("Can't open $file! $!"); LOOP: while () { if (/^\={30}/) { $new = 1; next LOOP; } elsif ($new == 0) { next LOOP; } elsif ($new == 4) { if (/^\s*From:\s+(.*)/) { $mes{'From'} = $1; } else { push(@message, $_); } next LOOP; } elsif (/^Date:\s+(.*)/ && ( $new == 1 ) ) { if ($i < $num) { $i++; $new = 0; next LOOP; } elsif ( $i > $num ) { last LOOP; } $mes{'Date'} = $1; $new = 2; $i++; } elsif ($new == 1) { $new = 0; next LOOP; # } elsif (/^Subject:\s+(.*)/) { # $mes{'Subject'} = $1; } elsif (/^From:\s+(.*)/) { $mes{'From'} = $1; } elsif (/^\s*$/) { $new = 4; next LOOP; } } close F; } ##### if (param('sub')) {$sub = param('sub'); } else { $sub = ""; } $sub =~ s/"/"/g; if (param('nexturl')) {$nexturl = param('nexturl'); } else { $nexturl = ""; } if (exists $ENV{'REMOTE_HOST'}) { $remote_addr = $ENV{'REMOTE_HOST'}; } elsif (exists $ENV{'REMOTE_ADDR'}) { $remote_addr = $ENV{'REMOTE_ADDR'}; } else { $remote_addr = ""; } if (exists $ENV{'REMOTE_IDENT'}) { $remote_ident = $ENV{'REMOTE_IDENT'}; } else { $remote_ident = ""; } if (exists $ENV{'REMOTE_USER'}) { $user = $ENV{'REMOTE_USER'}; } else { $user = $remote_ident . "\@" . $remote_addr; } if (exists $ENV{'HTTP_REFERER'}) { $referer = $ENV{'HTTP_REFERER'}; } else { $referer = ""; } if (param('to')) { $to = param('to'); } else { $to = ""; } print header; print <Thank You for Taking the Time to Respond Thank You For Taking the Time to Participate! EOP if (not param('quote') and param('ent')) { my $self = self_url; $self =~ s/&/&/g; print <You may quote the original message if you wish.

HTML } print <
To:$to
From (e-mail address required):
Subject:
Your Message:
EOP