SMTPSERVER(8)

NAME
smtpserver - zmailer SMTP server

SYNOPSIS
smtpserver [ -46aignvBV ] [ -p port ] [ -l logfile ] [ -s[ftveR] ] [ -L maxloadaver ] [ -M SMTPmaxsize ] [ -P postoffice ] [ -R router ] [ -C cfgfile ]

DESCRIPTION
This program implements the server side of the SMTP protocol as described in RFC821, and knows about the common extensions to the protocol expected by Sendmail and BSMTP clients.

By default the program will kill the previous smtpserver daemon, if any, then detach and listen for SMTP connections. Incoming messages will be submitted for processing using the zmailer(3) interface to ZMailer. Nontrivial address checking is done asynchronously, although this behaviour can be changed by a command line option if you cannot afford to transfer data just to bounce it back. All checking is done by executing the router(8) program in interactive mode, and executing a well-known shell function with well-known parameters for each request.

OPTIONS

-4  Explicitely to use IPv4 type of socket even on machines that is capable to do IPv6 type of sockets.

-6  Explicitely to (try to) use IPv6 type of socket even if the machine does not support it. For a default the server will try to use IPv6, if it has been compiled on an environment where it is present, but will do a fallback to IPv4 in case the runtime system does not have IPv6.

-a  turn on RFC931/RFC1413 indentification protocol, and log the information acquired with it to the submitted file.

-g  the gullible option will make the program believe any information it is told (such as origin of a connection) without checking.

-i  runs the server interactively, which makes it usable for processing a batched SMTP stream (BSMTP) on stdin. With -v option this echoes incoming BSMTP to create more accurate faximille of BITNET BSMTP mailers.

-l logfile
    specifies a logfile and enables recording of incoming SMTP conversations.

-n  indicates the program is being run from inetd(8).

-p  specifies the TCP port to listen on instead of the default SMTP port, 25.

-B  flags the email to arrive via BSMTP channel (via BITNET, for example).

-L maxloadaver
    tells the maximum load-average the system is under when we still accept email in.

-M SMTPmaxsize
    Defines the asolute maximum size we accept from incoming email. (Default: infinite) (This is local policy issue.)

-P postoffice
    specifies an alternate POSTOFFICE directory.

-R router
    specifies an alternate router (8) program to use for address verification.

-C cfgfile
    specifies nonstandard configuration file location; the default is $MAILSHARE/smtpserver.conf.

-s  specifies the style of address verification to be performed. There are four independent commands that can invoke some kind of address verification, and four independent flags to control whether this should be done. They are:

    f	check MAIL FROM addresses
    t	check RCPT TO addresses
    v	check VRFY command argument
    e	check EXPN command argument
    R	require addresses to be of syntax: local@remote (strict 821)

    The flags are concatenated to form the argument to the -s option. The default is ve.

-V  prints a version message and exits.

EHLO AND 8BITMIME
On RFC 1651/1652/1653+1428 there are extended SMTP specifications, which contain mechanism for declaring 8-bit transparent SMTP capability, as well as so called SIZE extension. When sending SMTP does EHLO instead of HELO it gets a set of responces which indicate that this system is capable on multiple things, and one of them is so called 8BITMIME.

CONFIGURATION
If the MAILSHARE/smtpserver.conf exists it is read to configure two kinds of things:

PARAM -entries
    allow server start-time parametrization of several things, including: - help-texts - acceptance/rejection database definitions

The style (-s) option
    behaviour based on glob patterns matching the HELO/EHLO name given by a remote client. Lines beginning with a # or whitespace are ignored in the file, and all other lines must consist of two tokens: a shell-style (glob) pattern starting at the beginning of the line, whitespace, and a sequence of style flags. The first matching line is used. As a special case, the flags section may start with a ! character in which case the remainder of the line is a failure comment message to print at the client. This configuration capability is intended as a way to control misbehaving client software or mailers.

PARAM maxsize
    This is synonym to start-time -M option.

PARAM max-error-recipients
    This defines how many recipients can be on a message whose source address is MAIL FROM:<>. That is, is an error message.

PARAM TcpRcvBufferSize
    This sets setsockopt(SO_RCVBUF) value, in case the system default is not suitable.

PARAM policydb
    This defines smtp input policy filtering/analysis database location. See the comments at the sample proto/db/smtp-policy.src file.

Here is a possible configuration file:

    #PARAM maxsize          10000000  # Same as -M -option
    #PARAM max-error-recipients   10  # More than this is propably SPAM!
    #PARAM TcpRcvBufferSize    32000  # Should not need to set!
    # Our company contact info:
    PARAM help ----------------------------------------------------
    PARAM help  This mail-server is at Yoyodyne Propulsion Inc.
    PARAM help  Our telephone number is: +1-234-567-8900, and
    PARAM help  telefax number is: +1-234-567-8999
    PARAM help  Our business-hours are Mon-Fri: 0800-1700 (Timezone: -0700)
    PARAM help
    PARAM help  Questions regarding our email service should be sent via
    PARAM help  email to address  <postmaster@OURDOMAIN>
    PARAM help  Reports about abuse are to be sent to: <abuse@OURDOMAIN>
    PARAM help ----------------------------------------------------
    #
    PARAM   accept-percent-kludge # "localpart" can contain '%' and '!'
    #PARAM  reject-percent-kludge # "localpart" can't contain  --"--
    #
    # The policy database:
    #     (NOTE: See  'makendbm'  for its default suffixes!)
    #
    PARAM  policydb   btree  /opt/mail/db/smtp-policy
    #
    # HELO pattern          style flags
    #
    *.mgmt.utoronto.ca      ftve
    *.mgmt.toronto.edu      ftve
    badguy.org              !Sorry, try later.
    localhost               ve
    *                       -

FILES
/etc/zmailer.conf
/var/spool/postoffice/.pid.smtpserver (POSTOFFICE/.pid.smtpserver)
/local/share/mail/smtpserver.conf (MAILSHARE/smtpserver.conf)

SEE ALSO
router(8)
RFC821, RFC1123, RFC1651, RFC1652, RFC1653, RFC1428

AUTHOR
This program authored and copyright by:
Rayan Zachariassen (was at U of Toronto)
RFC165* (and several other) extensions by
Matti Aarnio <mea@nic.funet.fi>