RFP: Web Mail Installation

Don Erickson derick at zeni.net
Mon Jan 27 22:35:05 CST 2003


In article <D09972985AB1D6118FBE0060970F698C0895E7 at cavern.tarcanfel.net> you write:
>Given a working web server with MySQL and PHP, how much would you bill to
>install and configure IMP or a similar web mail system?  

What distribution is the server running?  

Oh, and here's a featureless read-only pop3 to webmail server to drop into
your cgi-bin right here:  Pass it mailserver, username and password values
and you're off.  You need the CGI, Net and Carp perl modules.

-----------------------------------------------------------------

#!/usr/bin/perl -w

use CGI qw(:standard);
use Carp:fatals to browser;
my $mailserver = param("mailserver");
my $username = param("username");
my $password = param("password");

($date)=qx (date);
print<<HEAD__;
Content type: text/html

<HTML>
<HEAD>
<TITLE>$date</TITLE>
<HEAD>
<body><P>

HEAD__

        use Net::POP3; 
      	my $pop = new Net::POP3($mailserver);
      	die "Error connecting to $mailserver."
		unless (defined $pop);
	my $num_messages=$pop->login($username, $password);
	die "Error logging in." unless (defined $num_messages);
	$index=$num_messages;
	print$num_messages;
	my $message_ref = $pop->top($index);

print @$message_ref, "n";
print"<H2>$username has $num_messages messages on $mailserver</h2><hr>";

foreach my $index (1 .. $num_messages)
{
	print "<H2>Message $index</H2>n";
	my $message_ref = $pop->get($index);
	print "<pre>n", @$message_ref, "</pre><hr>n";
}
 
print <<TAIL__;
</BODY>
</HTML>
TAIL__

--------------------------------------------------------------

Regards,

-Don




More information about the Kclug mailing list