<CHAPTER ID="ZREF-SENDMAIL"><?dbhtml filename="zref-sendmail.html">
<TITLE><COMMAND>Sendmail</> Reference</TITLE>

<PARA>
This ``<COMMAND>sendmail</>'' program is an emulation of the original
<APPLICATION>sendmail</> interface. It provides all the original options
that make sense to support in the context of ZMailer.
This is not intended to be the normal user interface to
<COMMAND>mail</>, rather it is used by the old User Agent programs,
e.g., <APPLICATION>mail(1)</>, to submit mail.
This mechanism has been superseded by the <FUNCTION>zmailer(3)</> library
routines as the native submission interface (Application Program Interface)
for ZMailer.
</PARA>

<PARA>
The default action is to submit the RFC822 format mail message expected
on <LITERAL>STDIN</> to the mailer, with the addresses listed on the command
line as recipients.
If there are no recipient addresses specified on the command line,
the mailer will infer them from the message header.
The sender is the account of the current <EMPHASIS>userid</>, except
for <LITERAL>root</> where the preferred sender is the account of
the current login session.
The message terminates when a period is seen by itself on a line,
or at end of file on the input stream.  (modulo used options.)
</PARA>

<PARA>
If the message submission fails immediately on the <FUNCTION>mail_open(3)</>,
the data on <LITERAL>STDIN</> will be appended to a <FILENAME>~/dead.letter</>
file in the submitters home directory.
</PARA>

<VARIABLELIST>
<VARLISTENTRY><TERM>Usage:</TERM><LISTITEM><PARA>
<SCREEN>
/usr/sbin/sendmail: unknown option -?
Usage: sendmail [sendmail options] [recipient addresses]
 ZMailer's sendmail recognizes and implements following options:
   -B bodytype  -  Valid values: 8BITMIME, 7BIT
   -C conffile  -  specifies config file (meaningfull for -bt)
   -E           -  flag 'external' source
   -F 'full name'  sender's full name string
   -N notifyopt -  Notify option(s): NEVER or a set of:
                                     SUCCESS,DELAY,FAILURE
   -P priority# -  numeric priority for ZMailer router queue
                   pre-selection
   -R returnopt -  Error report return option, either of: FULL, HDRS
   -U           -  Flag as 'user submission'
   -V envidstring - XTEXT encoded ENVID string
   -b?          -  operational mode flags
   -bd          -  starts smtpserver in daemon mode
   -bi          -  runs 'newaliases' command
   -bm          -  deliver mail; always :-)
   -bp          -  runs 'mailq' command
   -bs          -  speak smtp; runs server in interactive mode
   -bt          -  starts router in interactive test mode
   -e*          -  (ignored)
   -f fromaddr  -  sets envelope from address for the message
   -i           -  on inputs from tty this will ignore SMTP-like
                   dot-EOF
   -m           -  send a copy of the message to the sender too
                   (ignored)
   -o*          -  multiple options; those not listed cause error
   -oQ queuedir -  defines POSTOFFICE directory for message
                   submission
   -ob*         -  (ignored)
   -od*         -  (ignored)
   -oe*         -  (ignored)
   -oi          -  alias of '-i' option
   -or*         -  (ignored)
   -p submitprotocol - value for 'with' label at 'Received:' header
   -q*          -  queue processing commands (ignored)
   -r fromaddr  -  (alternate for -f)
   -t           -  scan message rfc822 headers for recipients
   -v           -  verbose trace of processing
</SCREEN>
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM>Parameters:</TERM><LISTITEM><PARA>

<VARIABLELIST>
<VARLISTENTRY><TERM><OPTION>-bm</OPTION></TERM><LISTITEM><PARA>
asks <COMMAND>sendmail</> to deliver mail, which it does anyway. 
This option has no effect.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-bs</OPTION></TERM><LISTITEM><PARA>
will start a SMTP server reading from <LITERAL>STDIN</>. 
This causes the <COMMAND>smtpserver(8)</> program to be executed.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-bd</OPTION></TERM><LISTITEM><PARA>
starts the <COMMAND>router(8)</> and <COMMAND>scheduler(8)</>
programs to emulate <APPLICATION>sendmail</>'s daemon mode.
This is <EMPHASIS ROLE=BOLD>not</> a recommended method to start these
programs, instead use <COMMAND>zmailer(1)</> script.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-bt</OPTION></TERM><LISTITEM><PARA>
runs the <COMMAND>router(8)</> in interactive mode for testing.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-bu</OPTION></TERM><LISTITEM><PARA>
runs <COMMAND>newaliases(8)</> to rebuild the alias file database.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-bp</OPTION></TERM><LISTITEM><PARA>
runs <COMMAND>mailq(1)</> to print the mail transport queue status.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-C configfile</OPTION></TERM><LISTITEM><PARA>
specifies the <COMMAND>router(8)</> configuration file.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-E</OPTION></TERM><LISTITEM><PARA>
indicates the origin of this message is an insecure channel.
This should be used when <COMMAND>sendmail</> is used to submit messages
coming in from outside the local machine, to avoid security problems during
message processing.
This flag ensures the message will have no privileges even if the current
userid is ``trusted''.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-f address</OPTION></TERM><LISTITEM><PARA>
specifies the sender address.
This is the default originator address if there is no
``<LINK LINKEND=RFC822.FROM>From:</>'' headerin the message. 
It becomes the ``<LINK LINKEND=RFC822.FROM>Sender:</>'' address otherwise.
In either case if the current userid is not ``trusted'' by the mailer,
it is free to ignore both this option and any header information to ensure
properly authenticated originator information.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-F fullname</OPTION></TERM><LISTITEM><PARA>
specifies the full name of the (local) sender.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-i</OPTION></TERM><LISTITEM><PARA>
tells <COMMAND>sendmail</> to not use a period (``.'') on a line by itself
as a message terminator, only the end of file will terminate the message.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-m</OPTION></TERM><LISTITEM><PARA>
asks the mailer not to ignore the originator in the addressee list.
This is default behaviour, so this option has no effect.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-N notify</OPTION></TERM><LISTITEM><PARA>
sets Delivery-Status-Notification notify parameter to be:
<OPTION>NEVER</>, or any combination of: <OPTION>SUCCESS</>, 
<OPTION>FAILURE</>, <OPTION>DELAY</>.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-oi</OPTION></TERM><LISTITEM><PARA>
is like <OPTION>-i</>.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-oQ postoffice</OPTION></TERM><LISTITEM><PARA>
specifies an alternate <FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/</>
directory.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-q</OPTION></TERM><LISTITEM><PARA>
asks for queue processing.
This option has no effect.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-Q retmode</OPTION></TERM><LISTITEM><PARA>
sets Delivery-Status-Notification parameter to be either of:
<OPTION>FULL</>, <OPTION>HDRS</>.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-r address</OPTION></TERM><LISTITEM><PARA>
is like <OPTION>-f</>.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-t</OPTION></TERM><LISTITEM><PARA>
scans header for recipient addresses if none are specified on the command line.
This is also the default behaviour, so this option has no effect.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-v</OPTION></TERM><LISTITEM><PARA>
will report the progress of the message after it has been submitted.
The <COMMAND>sendmail</> process will write verbose log information to
the <LITERAL>STDERR</> stream until the <COMMAND>scheduler</> deletes
the message.
</PARA></LISTITEM></VARLISTENTRY>

<VARLISTENTRY><TERM><OPTION>-V envid</OPTION></TERM><LISTITEM><PARA>
sets Delivery-Status-Notification parameter <OPTION>ENVID</>
to be any arbitrary <EMPHASIS>[xtext]</> string.
</PARA></LISTITEM></VARLISTENTRY>
</VARIABLELIST>

</PARA></LISTITEM></VARLISTENTRY>
</VARIABLELIST>

</CHAPTER>
