PerlPop3 v1.0.2
================

	INSTALLATION


PREREQUISITES:

Perlpop3 is a Perl script. You must have Perl 5.x installed. 
First of all, check the location of your perl executable. You can do this by 
typing the following command:

which perl

By default, this script uses '/usr/bin/perl'. Modify the first line in the
ppop.pl file to reflect the correct path.

No modules are needed for a default install, but some modules may be needed 
for some options:

- Popauth:
	DB_File

- Database Support:
	DBI
	DBD::Pg or DBD::mysql
		
- APOP:
	Digest::MD5
	

To install these optional modules, you can use the CPAN module:

	perl -MCPAN -e 'install DB_File'
	perl -MCPAN -e 'install DBI'
	perl -MCPAN -e 'install DBD::Pg'
	perl -MCPAN -e 'install DBD::mysql'
	perl -MCPAN -e 'install Digest::MD5'
	
	

CONFIGURATION:

By default the file does not need any modification, but it is recommended to
edit at least the 'servername' field.

Edit the file ppop.pl with a text editor (vi, joe, pico, emacs, etc) and be 
sure to adjust the following fields:

- Enter your domain name, or in domain-less server, the server hostname:

$servername = "example.com";

- The default spool directory is where spoolfiles reside. It may vary on your
system:

$default_spool = "/var/mail";

- If you plan to use a database for users, set useDatabase to 1, and be sure
to select a uid to set on the spoolfiles. (See the DATABASE section in the 
DOC file) Please note: APOP is only available when the database option is 
enabled.

$useDatabase = 1;
$default_uid = 1;

- To use 'popauth' or 'relaydomain' SMTP authentication, set either to 1:
(See the POP AUTH in the DOC file)

$use_popauth = 0;
$update_relaydomains = 0;

- Timeout is set in seconds. 120 (2 min) should be enough for most cases
(Timeout is while waiting for user commands):

$timeout = 120;

- Logfile is where activities are registered. Also, debugging output is sent 
here if debugging is enabled:

$logfile = '/var/log/poplog';

- Sometimes, you may want to see more data in the logfile, to debug a new
email client, or a new email-sending application. Set debug to 1.

$debug = 1;


INSTALLATION

PerlPop3 uses inetd as it tcp server. Further versions may be modified  
to be a stand-alone server.

Copy the ppop.pl file to /usr/local/bin/ or you preferred location. 
Be sure it has execute permisions: chmod 744 /usr/local/bin/ppop.pl

Edit your inetd.conf and modify the pop3 line: (or add it if it is 
missing)

pop32 stream tcp nowait root /usr/local/bin/ppop.pl ppop.pl

Send a HUP signal to your inetd:

kill -HUP `cat /var/run/inetd.pid`

To try it out you may telnet to the pop3 port, you must receive a greeting 
that begins with "+OK": (type QUIT to exit)

	#telnet localhost 110
	Trying 127.0.0.1...
	Connected to localhost.
	Escape character is '^]'.
	+OK <27911.1158944286@example.com>
	QUIT
	+OK Bye.

Configure your favorite email pop3 client and you're set.

See the DOC file for more information.