
Installation Instructions for POP3 server (21 Jun 1997) !!INETD MODE!!
======================================================================

General:
The POP3 server is a TCP/IP server. It accepts one line commands,
and responds with one or more ASCII text lines. For a complete
description of the POP3 syntax, please refer to STD 53.
The POP3 server is similar to the FTP and SMTP servers; it should
be installed like ftpd and smtpd.

UNIX installation:
-----------------

- Compile the in.pop3d program by running "make" in the pop3 source
  directory.
- Run "make install"  - this will copy the in.pop3d program to the install
  direcotry - /usr/sbin usually on Linux; the binary should be owned by
  root and should have permissions 700.  Once installed, its directory
  listing should look something like this:

     -rwx------  1 root        30720 Aug 10  1990 /usr/sbin/in.pop3d

  "make install" will also create the POP working directory when POPWORK
  is defined in Makefile.  This is /usr/tmp/.pop by default.  A copy of
  the mail spool file is made here while the mail is being downloaded by
  the client.  Once created, it should look like:

     drwxrwxr-t   2 root     root   1024 Jun 21 11:45 /usr/tmp/.pop

- Add an entry for pop3 in the file /etc/services - it should look
  like this:

     pop3		110/tcp		postoffice


*** You must decide to run pop3d from inetd or standalone.
******* FOR INETD INSTALLATIONS:
**  - Add an entry for   pop3d   in the file /etc/inetd.conf
**    it should look like this:
**  
**       pop3	stream	tcp	nowait	root	/usr/sbin/in.pop3d   in.pop3d
**  
**    or if you use tcpwrappers:
**  
**       pop3	stream	tcp	nowait	root	/usr/sbin/tcpd	/usr/sbin/in.pop3d
**  
**  - Restart the   inetd   program so that  inetd  will connect incoming TCP/IP
**    traffic for the POP3 server to the   pop3d   program. Get the PID
**    number for   inetd   with the   ps   command; then restart  inetd:
**  
**       aggie: 9> ps -fax | grep inetd
**          92 ?  I     3:19 /usr/sbin/inetd
**       14470 p0 S     0:00 grep inetd
**       aggie: 10> kill -HUP 92
**       aggie: 11> 
**
************

******* FOR STANDALONE INSTALLATIONS:
**  - Be sure that inetd isn't listening for pop3 connections already:
**	- If the pop3 line exists in the /etc/inetd.conf file:
**	  1. comment out pop3 line in the /etc/inetd.conf file
**	  2. HUP the inetd server to cause it to stop listening on port 110
**
**  - Then start the daemon running now by hand:
**	/usr/sbin/in.pop3d -b
**
**  - Added the daemon to a startup script such as /etc/rc.d/rc.local.
**    Use the same command as given above:  /usr/sbin/in.pop3d -b
**
************

- in.pop3d  is now installed


****************************************************************************
*** Please not that I have not modifed the text below from the original
*** since I have no way at the moment to use SunOS.   Derric Scott
****************************************************************************

Sun OS installation:
-------------------

- copy and compile the   pop3d   program

- copy the  pop3d  program to the   /usr/sbin   directory (NOTE: network
  files may be stored in a different directory on your system); it should
  be owned by   root   and should have permissions   700
  once installed, its directory listing should look something like this:

     -rwx------  1 root        49152 Feb  8  1990 /usr/sbin/in.pop3d

- if you use an /etc/services file,  add an entry for   pop3d   in the
  file /etc/services it should look like this:

     pop3		110/tcp		postoffice

- add an entry for   pop3d   in the file /etc/inetd.conf
  it should look like this:

     pop3	stream	tcp	nowait	root	/usr/sbin/in.pop3d    in.pop3d


- if you are running Yellow Pages, remake  yp

- restart the   inetd   program;  inetd  will connect incoming TCP/IP
  traffic for the POP3 server to the   pop3d   program. Get the PID
  number for   inetd   with the   ps   command; then restart  inetd:

     wilma% ps -ax | grep inetd
       114 ?  IW    0:15 inetd
      2082 p1 S     0:00 grep inetd
     wilma% kill -HUP 114
     wilma%


- pop3d  is now installed


Special note for various UNIX-like operating systems
====================================================

When you compile the server, you may get an error involving
the    flock()    function or the    LOCK_EX and LOCK_UN
constants. The purpose of these calls is to create an exclusive
lock on the mailbox file. This prevents other processes from
re-writing the mailbox while the POP server is also writing or
reading from the mailbox.

In general, the flock() function may not be avialable on your system.

The 'brute force' way to get around this problem is to simply
comment out the flock() calls. However, this will leave the mailbox
file unprotected from other processes; if two processes write to the
file at the same time, the results are undefined.

As an alternative, you should check the source code for other
e-mail prcoesses on your system. Presumably, they will have some
kind of file locking mechanism. Modify the POP3 server source
code to use the same file locking mechanism.

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

--  Katie Stevens
    dkstevens@ucdavis.edu
    Information Technology -- Campus Access Point
    University of California, Davis
