Provided by: zmailer_2.99.56-2_i386 bug


       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(8zm),  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 8-bit clean, and for any MIME message
              with QUOTED-PRINTABLE 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 QUOTED-PRINTABLE 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/

       -c channel
              specifies  which  channel  name should be keyed on.  There is no
              default.  If this option is not specified, the  -h  option  must

       -h host
              specifies  which  host  name  should  be  keyed on.  There is no
              default.  If this option is not specified, the  -c  option  must

       -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             argument list

       For example:

       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
       ean      mn      /lib/ean/gwsmean    gwsmean -d $u
       test     n       sm/test             test $u
       smsgw    nS      ${MAILBIN}/sms-gw   sms-gw $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

       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 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(8zm)  and  their  comparisons
       against sendmail-8.11 are:

              sendmail: Not defined/used

              sm: Special ‘‘no flags defined’’ dummy entry

       :, |, /, %, @
              sendmail:  various  sendmail-specific  things  that  are handled
              mostly by the router(8zm) subsystem at ZMailer.

              sm: Not used.

              sendmail: Equivalent of ZMailer’s smtp(8zm) transport agents  -x
              option.  (Don’t use MX data, only addresses)

              sm: Not used

       1, 2
              sendmail, sm: Not defined/used

              sendmail:  Extend  the  list  of  characters  converted  to  =XX
              notation when converting to Quoted-Printable  to  include  those
              that don’t map cleanly between ASCII and EBCDIC.  Usefull if you
              have IBM mainframes on site.

              sm: Not implemented/used

              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

              sendmail: Strip RFC 822 headers to 7 bits.

              sm: Not implemented/used

              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.)

              sendmail,  sm:  Tells that the recipient system is 8-bit capable
              and that no 8->7 downgrading is needed.

              sendmail, sm: If set, do  limited  7->8  bit  MIME  conversions.
              These conversions are limited to text/plain data.

              sendmail: Run ESMTP protocol on the SMTP connection

              sm:  Not  implemented/used  (See  ‘‘B’’) (SMTP transport agent’s

              sendmail: Look up the user part of  the  address  in  the  alias

              sm: Not used (Router’s task)

              sendmail:  Force  a  blank  line  on the end of a message.  (Not
              needed in sms usage environment.)

              sm:  will  activate  BSMTP-type  wrapping  with   ‘‘hidden-dot’’
              algorithm;  e.g.   quite  ordinary  SMTP  stream,  but in "batch

              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.

              sendmail: Do not include comments in RFC 822 header addresses.

              sm: not implemented/used

              sendmail: Header address canonicalization

              sm: Not used (router’s task)

              sendmail:  Do  not  include  angle brackets around route-address
              syntax addresses.  (this is broken security trick for some shell
              script usages, nor recommented!)

              sm: Not implemented/used

              sendmail: ‘‘Date:’’ header wanted

              sm: Not used (router’s task)

              sendmail:  This mailer is expensive to connect, connections only
              from queuerun.  (Meaningless in sm)

              sm:  Throw  in  a  collection  of   ‘‘X-Envelope-*:’’   headers;

                 This  is  one  for  the  message,  if  it has been defined in
                 incoming message.


                 These two appear in sequence, and the first should exist  for
                 every message in the system.

              Frankly,  it does not make much sense to use this in combination
              with e.g. ’m’-mode (multi-recipient processing).

              sendmail, sm: Will  prepend  ‘‘>’’  to  any  message  body  line
              starting with ‘‘From ’’ (From space).

              sendmail,  sm:  adds  ‘‘-f sender’’  arguments  to  the delivery

              sendmail: This mailer wants ‘‘From:’’ header line.

              sm: Not used (Router’s task)

              sendmail: Affects on  what  to  use  as  error  source  envelope

              sm: Not used (Scheduler’s task)

              sendmail, sm: Not used

              sendmail, sm: Not used

              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.

              sendmail: Do User Database rewriting on envelope sender address

              sm: Not used (router’s task)

              sendmail: The remote system is  another  sendmail,  use  special
              protocol  features

              sm: Not used

              sendmail:  Do  User Database rewriting on envelope recipients as
              well as senders.

              sm: not implemented/used (router’s task)

              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(8zm) transport agent.)

              sendmail: Currently unimplemented, reserved for CHUNKING.

              sm: Not used

              sendmail:  This  mailer  is  local (i.e., final delivery will be

              sm: Not used (semi meaningless)

              sendmail: Limit the line lengths as specified in RFC 821.  (This
              is deprecated option.)

              sm: Not used

              sendmail,  sm:  This  mailer  can  hangle  multiple  recipients;
              Existence of $u macro in argv part of the mailer definition will
              be expanded with recipients.

              sendmail: ‘‘Message-ID:’’ header wanted

              sm: Not used (Router’s task)

              sendmail,  sm:  Do not prepend a From-space line (normal mailbox
              separator line) to the message.

              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 can be driven.)

              sendmail: Not used.

              sm:   Outputs   the  Original-Recipient:  meta-header  for  each
              recipient of the message.  This carries incoming  SMTP  protocol
              ORCPT= parameter, if any.

              sendmail:  Use  route-addr style reverse-path in the SMTP ‘‘MAIL
              FROM:’’ command rather than just the return address.

              sm: Meaningless, not used.  (smtp transport agent’s task.)

              sendmail, sm: Header ‘‘Return-Path:’’ is wanted to be  added  to
              the message.

              sendmail:  Some  SMTP  VRFY  related  thing,  not  applicable to

              sm: Not used.

              sendmail, sm: Not used.

              sendmail, rm:  adds  ‘‘-r sender’’  arguments  to  the  delivery

              sendmail:   Open   SMTP  connections  from  a  ‘‘secure’’  port.
              (Meaningless in ZMailer, but see smtp(8zm) transport agent.)

              sm: Use CRLF sequence as end-of-line sequence.  Without it, will
              use LF-only end-of-line sequence.

              sendmail:  Strip quote characters (" and \) off of the addresses
              before calling the actual mailer.

              sm: Not implemented/used.

              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 (which is not

       t, T
              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

              sendmail,  sm:  will  prepend  a From-space line, with a "remote
              from myuucpname" at the end, to the message.  This  is  what  is
              expected by remote rmail(1zm) programs for incoming UUCP mail.

       v, V
              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.

              sendmail, sm: Not used

              sendmail: A ‘‘Full-Name:’’ header is wanted.

              sm: Not implemented/used

              sendmail,  sm: does SMTP-like ’hidden-dot’ algorithm of doubling
              all dots that are at the start of the line.

       y, Y
              sendmail, sm: Not used

              sendmail:  Run  Local  Mail  Transfer  protocol  (LMTP)  between
              sendmail and the local mailer.  See RFC 2033.

              sm:  Not implemented/used.  ZMailer’s smtp(8zm) implements LMTP.

              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 dollar-expressions of type: ${ZENVAR}

       The arguments field extends to  the  end  of  the  line.   It  contains
       whitespace-separated  argv  parameters  which  may  contain  one of the
       following sequences:

       $g     which is replaced by the sender address.

       $h     which is replaced by the destination host.

       $u     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.

           relative-spool-path [ <TAB> hostname ]

       This program produces diagnostic output on the standard output.  Normal
       diagnostic output is of the form:

           id/offset<TAB>notify-data<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>.




              This environment variable is expected to be inherited  from  the
              scheduler(8zm),  and  it  tells  where scheduler’s idea of ZENV-
              variables are located at.







       /etc/zmailer/zmailer.conf   (ZCONFIG)
       /var/spool/postoffice       (POSTOFFICE)
       /etc/zmailer/          (MAILSHARE/


       scheduler(8zm), smtp(8zm), zmailer.conf(5zm).


       This program authored and copyright by:
          Rayan Zachariassen <no address>
       Several extensions by:
          Matti Aarnio <>

                                  2003-Aug-28                          SM(8zm)