sm is a ZMailer's sendmail(8) compatible transport agent to deliver messages by invoking a program with facilities and in a way compatible with a sendmail(8) MTA.
The program scans the message control files named on stdin for addresses destined for the channel and/or the host given on the command line. If any are found, all matching addresses and messages are processed according to the specifications for the mailer in the configuration file.
The exit status of a mailer should be one of the standard values specified in #include <sysexits.h>. Of these, EX_OK indicates successful deliver, and EX_DATAERR, EX_NOUSER, EX_NOHOST, EX_UNAVAILABLE, and EX_NOPERM indicate permanent failure. All other exit codes will be treated as a temporary failure and the delivery will be retried.
Usage:
sm [-8] [-H] [-Q] [-V] [-f configfile] -c channel -h host mailer
Configuration:
The configuration file $MAILSHARE/sm.conf associates the mailer keyword from the command line with a specification of a delivery program. This is very similar to the way the definition of a ``mailer'' in sendmail(8). It requires flags, a program name, and a command line specification. These are in fact the fields of the entries of the configuration file. Lines starting with whitespace or a ``#'' are ignored, and all others are assumed to follow format shown in figure Figure 15-1.
Figure 15-1. Sample sm.conf file
#mailer flags program argument list #------ ----- -------------- -------------------------------- local mS sm/localm localm -r $g $u prog - /bin/sh sh -c $u tty rs /usr/local/to to $u uucp U /usr/bin/uux uux - -r -a$g -gC $h!rmail ($u) usenet m sm/usenet usenet $u test n sm/test test $u |
The mailer field extends from the beginning of the line to the first whitespace. It is used simply as a key index to the configuration file contents. One or more whitespace is used as the field separator for all the fields.
The flags field contains a concatenation of one-letter flags. If no flags are desired, a ``-'' character should be used to indicate presence of the field. All normal sendmail (of 5.x era..) flags are recognized, but the ones that do not make sense in the context of ZMailer will produce an error (or some are ignored). The flags that change the behaviour of sm are:
will activate BSMTP-type wrapping with a ``hidden-dot'' algorithm; e.g. quite ordinary SMTP stream, but in ``batch mode''.
The first ``B'' turns on similar BSMTP wrapping as ``b'', but adds SIZE and, if the sm is started with option ``-8'', also 8BITMIME options. The second ``B'' adds there also DSN (Delivery Status Notification) parameters.
will prepend ``>'' to any message body line starting with ``From ''. (Read: ``From-space'')
adds ``-f sender'' arguments to the delivery program.
will not prepend a ``From ''-line (normal mailbox separator line) to the message.
adds ``-r sender'' arguments to the delivery program.
will run the delivery program with the same real and effective uid as the sm process. If this flag is not set, the delivery program will be run with the real uid of the sm process. This may be useful if sm is setuid.
informs sm that each instance of the delivery program can deliver to many destinations. This affects $u expansion in the argument list, see below.
prepends a ``Return-Path:'' header to the message.
will prepend a ``From ''-line, with a ``remote from myuucpname'' at the end, to the message. This is what is expected by remote rmail(1) programs for incoming UUCP mail.
use CRLF sequence as end-of-line sequence. Without it, will use LF-only end-of-line sequence.
does SMTP-like ``hidden-dot'' algorithm of doubling all dots that are at the start of the line.
will strip (set to 0) the 8th bit of every character in the message.
The path field specifies the location of the delivery program. Relative pathnames are allowed and are relative to the $MAILBIN/ directory.
The arguments field extends to the end of the line. It contains whitespace separated argv parameters which may contain one of the following sequences:
which is replaced by the sender address.
which is replaced by the destination host.
which is replaced by the recipient address. If the ``m'' mailer flag is set and there are several recipients for this message, the argument containing the ``$u'' will be replicated as necessary for each recipient.