NAME
smap - sendmail wrapper client
SYNOPSIS
smap [invoked from inetd]
DESCRIPTION
The smap client implements a minimal version of SMTP, accepting messages from over the network, and writing them to disk for future delivery by smapd. smap is designed to run under chroot(2) as a non-privileged process, to overcome potential security risks presented by privileged mailers running where they can be accessed from over a network.
smap is invoked from inetd(8) and exits when its session is completed. Each session's mail is recorded in an temporary file in its spool directory, with the SMTP envelope encoded in the heading of the file. In order to coordinate processing with smapd the file is locked while it is being written. As a secondary means of signalling when a message is completely gathered, the mode of the file, which is initially 644, is changed to 755. In this manner the system can identify truncated or partial files left after a system crash or reboot.
OPTIONS
smap takes no command line options. All configuration rules in netperm-table for application "smap" are read, and the following clauses and parameters are recognized:
- userid name
-
specify the userid that smap should run under. The name can be either a name from the password database, or a numeric user-ID. This userid should be the same as that under which smapd runs, and should have write permission to the spool directory.
- directory pathname
-
specifies the spool directory where smap should store incoming messages. A chroot(2) system call is used to irrevocably make the specified directory the root filesystem for the remainder of the process.
- maxbytes value
-
specifies the maximum size of messages to gather, in bytes. If no value is set, message sizes are limited by the amount of disk space in the spool area.
- maxrecip value
-
specifies the maximum number of recipients allowed for any message. This option is only for administrators who are worried about the more esoteric denial of service attacks.
- timeout value
-
specifies a timeout, after which smap should exit if it has not collected a message. If no timeout value is specified, smap will never time out a connection.
INSTALLATION
To install smap identify the spool directory where mail will be collected. Identify the userid that smap will run with, and make sure that it own the spool directory. Install smap in /etc/inetd.conf as follows (pathnames may change):
smtp stream tcp nowait root /usr/local/etc/smap smap
After modifying /etc/inetd.conf it is necessary to signal inetd to reload its configuration information, and to make sure that sendmail(8) is no longer running on the system.
In the spool directory, it may be necessary to make an /etc directory with system-specific configuration files, if the C support library on the host UNIX requires them. Generally it is recommended to build smap so it is completely standalone, i.e.: a statically linked executable, linked against a resolver library that will not crash if it is unable to read /etc/resolv.conf. Alternately, a small number of support files (/etc/hosts, /etc/resolv.conf) may be required. Be careful not to install any device files, or executables in the spool directory. Test installation by using telnet to connect to the SMTP port.
smap assumes that smapd will also be running on the system. See smapd(8).
FILES
- spool directory
SEE ALSO
BUGS
The support for SPECIALDOMAIN is an ugly hack.