popper

POP3 server

Syntax:

popper [-b dir] [-d] [-s] [-T secs] [-t trace-file]

Options:

-b dir
Bulletin directory.
-d
Turn on debugging.
-s
Turn on statistics.
-T secs
Timeout (default 120 seconds).
-t trace-file
Log debugging messages to file instead of syslog().

Description:

The popper utility is an implementation of the Post Office Protocol server that runs on a variety of Unix computers to manage electronic mail for Macintosh and MS-DOS computers. It conforms fully to the specifications in RFC 1081 and RFC 1082.

The -d option sets the socket to debugging and turns on debugging. All debugging information is saved using syslogd. The -t trace-file option turns on debugging and saves the trace information in trace-file using fprintf().

The -s option turns on statistics logging using syslogd. At the end of each popper session, the following information is logged:

The -T secs option changes the default compiled value of 120 seconds for terminating a session with a POP client. When the server is waiting for a command to arrive from the client, it times out after the specified number of seconds and terminates the session. This avoids having popper processes hang forever waiting for command input from clients that have terminated abnormally. A small value is okay for small to medium nets where the network delay is within a few seconds. In this case, 15-30 seconds isn't unreasonable. Networks with large delays in sending packets (e.g. SLIP links) may require a larger value. In this case, 300 seconds (5 minutes) isn't unreasonable.

The -b dir option turns on the bulletin feature and specifies the bulletin directory path.

Bulletins

The bulletin feature gives system administrators a way to send important announcements to all POP users without having to do mass mailings.

The bulletin directory contains one file per bulletin. Each file contains a single mail message with header and body in mailbox format. The first line of each such bulletin must be a ``from'' line. The easiest way for sysadmins to create such bulletins is to:

The bulletin directory must be world-readable.

The name of each bulletin file begins with the bulletin number and may optionally continue with any other characters. For example, the filename of bulletin number 23 might be 23.pophost_down_sunday.

The popper utility creates a file named .popbull in the home directory of each user. This file contains a single line recording the highest-numbered bulletin received by the user.

Each time a POP client connects to the server, any new bulletins that the user hasn't received previously are automatically appended to the user's mail.

When a bulletin is copied, the ``To'' header line is replaced by ``To: username@thishost'', and any ``Status:'' header lines are deleted. Otherwise, the bulletin is copied as is.

When a new user checks for mail the first time, popper creates the .popbull file in the user's home directory and seeds it with the current maximum-bulletin number. Thus new users don't get old bulletins.

The POP transaction cycle

The POP server is a single program (called popper) that is launched by inetd when it gets a service request on the POP TCP port.


Note: The official port number specified in RFC 1081 for POP3 is port 110. However, some POP3 clients attempt to contact the server at port 109, the POP2 port. Unless you're running both POP2 and POP3 servers, you can simply define both ports for use by the POP3 server.

The popper program initializes and verifies that the peer IP address is registered in the local domain, logging a warning message when a connection is made to a client whose IP address doesn't have a canonical name. It also checks to see if a canonical name lookup for the client returns the same peer IP address, logging a warning message if it doesn't. The server enters the authorization state, during which the client must correctly identify itself by providing a valid Unix userid and password on the server's host machine. No other exchanges are allowed during this state (other than a request to quit).

If authentication fails, a warning message is logged and the session ends. Once the user is identified, popper changes its user and group IDs to match that of the user and enters the transaction state. The server makes a temporary copy of the user's maildrop, which is used for all subsequent transactions. These include the bulk of POP commands to retrieve mail, delete mail, undelete mail, and so forth. When the client quits, the server enters the final update state, during which the network connection is terminated and the user's maildrop is updated with the (possibly) modified temporary maildrop.

Debugging

The popper program will log debugging information when the -d parameter is specified after its invocation in the /etc/inetd.conf file. Care should be exercised in using this option since it generates considerable output in the syslog() file.

Alternatively, the -t trace-file option will place debugging information into file trace-file using fprintf() instead of syslog().

You can confirm that the POP server is running by telneting to port 110 (or 109 if you set it up that way). For example:

%telnet myhost 110
Trying...
Connected to myhost.berkeley.edu.
Escape character is '^]'.
+OK UCB Pop server (version 1.6) at myhost starting.
quit
Connection closed by foreign host.

Extensions

The server implements two extended commands:

XTND XMIT
Sends a mail message using sendmail.
XTND XLIST header [num]
Extracts and returns the specified header line for the specified message number. If the num parameter is missing, it returns the header line for all the messages not currently marked for deletion.

Files:

/usr/spool/mail
Mail files.
/etc/inetd.conf
POP program invocation.
/etc/syslog.conf
Logging specifications.
~/.popbull
Largest bulletin number seen by user.

See also:

inetd

RFC 1081, RFC 1082