I am not exactly sure where to put this so I'll put it here...

#!/usr/bin/perl -w ############################################################### # Very, Very basic Pop3 mail reader written by # David Middleton dmm@isp9.net # 10/19/00 # # I wrote this because all the pop3 perl programs are # either too lame for me to use or are too complex for # me to understand... All I want to do is make a simple # web based e-mail program. Is this too much to ask? # # Feel free to use, modify, distribute, laugh at... # # P.S. This requires the Pop3 perl module. # If you don't have it, go to www.cpan.org use Mail::POP3Client; ################################################################ # Grab user name, password and pop3 server from the command line # and log onto the mail server. $user = $ARGV[0]; $pass = $ARGV[1]; $srvr = $ARGV[2]; $mail = new Mail::POP3Client($user, $pass, $srvr); ##################################################### # Make sure that everything is ok with the connection $MailState = $mail->State; if($MailState eq 'AUTHORIZATION') { die "\n\nBad user name or password!\n" } elsif($MailState eq 'DEAD') { die "\n\nMail server unreachable or unavailable!\n" } #################################### # Print the # of messages then pause print "You have ", $mail->Count, " new message(s).\n\n"; print "Press any key to continue...\n\n"; $anykey = ; chomp $anykey; ######################################## # Read mail headers and get usefull info for ($m = 1; $m<=$mail->Count; $m++) { $Headers = $mail->Head($m); if($Headers =~ /(\bReturn-Path.*)/g){ $RTNP = $1}else{ $RTNP = 'Return-Path:'} if($Headers =~ /(\bDate.*)/g){ $Date = $1}else{ $Date = 'Date:'} if($Headers =~ /(\bFrom.*)/g){ $From = $1}else{$From = 'From:'} if($Headers =~ /(\bTo.*)/g){ $To = $1}else{ $To = 'To:'} if($Headers =~ /(\bSubject.*)/g){ $Subj = $1}else{ $Subj = 'Subject:'} ############### # Now Print it print "Message: ", $m, "\n", $Date,"\n", $To,"\n", $From,"\n", $RTNP, "\n", $Subj,"\n\n" } ########################## # Now look at a message... print "What message to you want to view? "; $i = ; chomp $i; $Headers = $mail->Head($i); @_ = split(/\n/, $Headers); $Body = $mail->Body($i); print "\n\nMessage: ", $i, "\n\n"; print $Body;

Edit: 2001-03-03 by [neshura]