sm - zmailer Sendmail compatible transport agent
sm [ -8HQV ] [ -f configfile ] -c channel -h host mailer
sm is a ZMailer transport agent which is usually only run by the scheduler(8), to deliver
messages by invoking a program with facilities and in a way compatible with a Sendmail
mailer. The sm program must be run with the same current directory as the scheduler,
namely POSTOFFICE/transport.
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 <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.
-8 |
tells that the output is 8bit clean, and for any MIME message with QUOTEDPRINTABLE encoding the coding can be decoded. |
||
-Q |
tells that the transport channel will likely treat poorly control characters like TAB, and possibly SPACE too.. This encodes them all by using QUOTEDPRINTABLE encoding. |
||
-f configfile |
specifies the name of a configuration file containing specifications of the various known Sendmail compatible mailer programs: how to invoke them and how to process messages for them. The default is MAILSHARE/sm.cf. |
||
-c channel |
specifies which channel name should be keyed on. There is no default. If this option is not specified, the -h option must be. |
||
-h host |
specifies which host name should be keyed on. There is no default. If this option is not specified, the -c option must be. |
||
-V |
prints a version message and exits. |
The configuration file 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 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 this format: |
||
mailer flags program For example: |
argument list |
|
local mS sm/localm |
localm r $g $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. Whitespace is used as the field
separator for all the fields.
The flags field contains a concatenation of oneletter flags. If no flags are desired, a ``''
character should be used to indicate presense of the field. All normal Sendmail flags are
recognized, but the ones that do not make sense in the context of ZMailer will produce an
error.
The flags that change the behaviour of sm and their comparisons against sendmail8.11 are:
- |
sendmail: Not defined/used sm: Special ``no flags defined'' dummy entry |
|
:, |, /, %, @ |
sendmail: various sendmailspecific things that are handled mostly by the router subsystem at ZMailer. sm: Not used |
|
0 |
sendmail: Equivalent of ZMailer's smtp transport agents -x option. (Don't use MX data, only addresses) sm: Not used |
|
1, 2 3 |
sendmail, sm: Not defined/used sendmail: Extend the list of characters converted to =XX notation when converting to QuotedPrintable to include those that don't map cleanly between ASCII and EBCDIC. Usefull if you have IBM mainframes on site. sm: Not implemented/used |
|
4 5 |
sendmail, sm: Not defined/used sendmail: Local delivery alternate resolution ruleset (R5) in case no aliases are found for currently processed address. (Meaningless in ZMailer; router's task) sm: Not used |
|
6 |
sendmail: Strip RFC 822 headers to 7 bits. sm: Not implemented/used |
|
7 |
sendmail: Will strip (set to 0) the 8th bit of every character in the message. sm: Will strip the 8th bit of every character of the message body, does not touch message headers. (Not stripping message header is sort of BUG.) |
|
8 |
sendmail, sm: Tells that the recipient system is 8bit capable and that no 8>7 downgrading is needed. |
|
9 |
sendmail, sm: If set, do limited 7>8 bit MIME conversions. These conversions are limited to text/plain data. |
|
a |
sendmail: Run ESMTP protocol on the SMTP connection sm: not implemented/used (See ``B'') (SMTP transport agent's task) |
A |
sendmail: Look up the user part of the address in the alias database sm: not used (Router's task) |
|
b |
sendmail: Force a blank line on the end of a message. (Not needed in sm's usage environment.) sm: will activate BSMTPtype wrapping with ``hiddendot'' algorithm; e.g. quite ordinary SMTP stream, but in "batch mode". |
|
B |
sendmail: not defined/used sm: 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. |
|
c |
sendmail: Do not include comments in RFC 822 header addresses. sm: not implemented/used |
|
C |
sendmail: Header address canonicalization sm: not used (router's task) |
|
d |
sendmail: Do not include angle brackets around routeaddress syntax addresses. (this is broken security trick for some shell script usages, nor recommented!) sm: not implemented/used |
|
D |
sendmail: ``Date:'' header wanted sm: not used (router's task) |
|
e |
sendmail: This mailer is expensive to connect, connections only from queuerun. (Meaningless in sm) sm: Throw in a collection of ``XEnvelope*:'' headers. |
|
E |
sendmail, sm: Will prepend ``>'' to any message body line starting with ``From '' (From space). |
|
f F |
sendmail, sm: adds ``-f sender'' arguments to the delivery program. sendmail: This mailer wants ``From:'' header line. sm: not used (Router's task) |
|
g |
sendmail: Affects on what to use as error source envelope address sm: not used (Scheduler's task) |
|
G h |
sendmail, sm: Not used sendmail, sm: Not used |
H |
sendmail: not used sm: Adds ``HELO'' or ``EHLO'' into front of the BSMTP stream. Normally the BSMTP streams do not have ``HELO/EHLO'' in front of them to avoid problems with catenation of BSMTP messages for streamed UUCP transfers, for example. |
|
i |
sendmail: Do User Database rewriting on envelope sender address sm: not used (router's task) |
|
I |
sendmail: The remote system is another sendmail, use special protocol features sm: Not used |
|
j |
sendmail: Do User Database rewriting on envelope recipients as well as senders. sm: not implemented/used (router's task) |
|
J k |
sendmail, sm: Not used sendmail: Allow network connection to myself (for very unusual usage cases, likely sendmail running at another port) sm: not used (See ZMailer smtp TA.) |
|
K |
sendmail: Currently unimplemented, reserved for CHUNKING. sm: not used |
|
l |
sendmail: This mailer is local (i.e., final delivery will be performed) sm: Not used (semi meaningless) |
|
L |
sendmail: Limit the line lengths as specified in RFC 821. (This is deprecated option.) sm: Not used |
|
m |
sendmail, sm: This mailer can hangle multiple recipients; Existence of $u macro in argv part of the mailer definition will be expanded with recipients. |
|
M |
sendmail: ``MessageID:'' header wanted sm: Not used (Router's task) |
|
n |
sendmail, sm: Do not prepend a Fromspace line (normal mailbox separator line) to the message. |
|
o |
sendmail Always run as the owner of the recipient mailbox sm: meaningless/not used (ZMailer's sm is not really for doing local delivery but see how procmail is driven.) |
O |
sendmail, sm: Not used |
||
p |
sendmail: Use routeaddr style reversepath in the SMTP ``MAIL FROM:'' command rather than just the return address. sm: Meaningless, not used. (smtp transport agent's task.) |
||
P |
sendmail, sm: Header ``ReturnPath:'' is wanted to be added to the message. |
||
q |
sendmail: Some SMTP VRFY related thing, not applicable to ZMailer sm: Not used. |
||
Q r R |
sendmail, sm: not used. sendmail, rm: adds ``-r sender'' arguments to the delivery program. sendmail: Open SMTP connections from a ``secure'' port. (Meaningless in ZMailer, but see smtp transport agent.) sm: Use CRLF sequence as endofline sequence. Without it, will use LFonly endofline sequence. |
||
s |
sendmail: Strip quote characters (" and ) off of the addresses before calling the actual mailer. sm: Not implemented/used. |
||
S |
sendmail, sm: 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. |
||
t, T u |
sendmail, sm: Not used sendmail: Upper case should be preserved in user names for this mailer. Standards require preservation of cae in the local part of addresses, except for those addresses for which your system accepts responsibility. sm: Not used |
||
U |
sendmail, sm: will prepend a Fromspace 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. |
||
v, V w |
sendmail, sm: Not used sendmail: The user must have a valid account on this machine, i.e., getpwnam() must succeed. If not, the mail is bounced. (Local delivery stuff.) sm: Not used |
||
W |
sendmail, sm: Not used |
x |
sendmail: A ``FullName:'' header is wanted. sm: Not implemented/used |
||
X |
sendmail, sm: does SMTPlike 'hiddendot' algorithm of doubling all dots that are at the start of the line. |
||
y, Y z |
sendmail, sm: Not used sendmail: Run Local Mail Transfer protocol (LMTP) between sendmail and the local mailer. See RFC 2033. sm: Not implemented/used. |
||
Z |
sendmail, sm: Not used |
The path field specifies the location of the delivery program. Relative pathnames are allowed and are relative to the MAILBIN directory, but also dollarexpressions of type: ${ZENVAR}
The arguments field extends to the end of the line. It contains whitespaceseparated argv parameters which may contain one of the following sequences:
$g $h $u |
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. (Also ${ZENVAR} expressions are allowed!) |
This program reads in processable file names relative to the current working directory of the scheduler (namely: $POSTIOFFICE/transport/). Optionally on the same line the scheduler may tell which host is to be looked for from the recipients of the message.
relativespoolpath [ <TAB> hostname ] |
This program produces diagnostic output on the standard output. Normal diagnostic output is of the form:
id/offset<TAB>notifydata<TAB>status message |
where id is the inode number of the message file, offset is a byte offset within its control file where the address being reported on is kept, status is one of ok, error, or deferred, and the message is descriptive text associated with the report. The text is terminated by a linefeed. Any other format (as might be produced by subprocesses) is passed to standard output for logging in the scheduler log.
The exit status is a code from <sysexits.h>.
/etc/zmailer.conf
/var/spool/postoffice (POSTOFFICE)
/local/share/mail/sm.cf (MAILSHARE/sm.cf)
scheduler(8)
This program authored and copyright by:
Rayan Zachariassen <rayan@cs.toronto.edu>
Several extensions by:
Matti Aarnio <mea@nic.funet.fi>