# Sendmail

Reference

This `sendmail` program is an emulation of the original 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 `mail`, rather it is used by the old User Agent programs, e.g., mail(1), to submit mail. This mechanism has been superseded by the `zmailer(3)` library routines as the native submission interface (Application Program Interface) for ZMailer.

The default action is to submit the RFC822 format mail message expected on `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 userid, except for `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.)

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

Usage:

-     /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

Parameters:

- `-bm`

- asks `sendmail` to deliver mail, which it does anyway. This option has no effect.

`-bs`

- will start a SMTP server reading from `STDIN`. This causes the `smtpserver(8)` program to be executed.

`-bd`

- starts the `router(8)` and `scheduler(8)` programs to emulate sendmail's daemon mode. This is not a recommended method to start these programs, instead use `zmailer(1)` script.

`-bt`

- runs the `router(8)` in interactive mode for testing.

`-bu`

- runs `newaliases(8)` to rebuild the alias file database.

`-bp`

- runs `mailq(1)` to print the mail transport queue status.

`-C configfile`

- specifies the `router(8)` configuration file.

`-E`

- indicates the origin of this message is an insecure channel. This should be used when `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.

`-f address`

- specifies the sender address. This is the default originator address if there is no From: headerin the message. It becomes the 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.

`-F fullname`

- specifies the full name of the (local) sender.

`-i`

- tells `sendmail` to not use a period (.) on a line by itself as a message terminator, only the end of file will terminate the message.

`-m`

- asks the mailer not to ignore the originator in the addressee list. This is default behaviour, so this option has no effect.

`-N notify`

- sets Delivery-Status-Notification notify parameter to be: `NEVER`, or any combination of: `SUCCESS`, `FAILURE`, `DELAY`.

`-oi`

- is like `-i`.

`-oQ postoffice`

- specifies an alternate `$`POSTOFFICE`/` directory.

`-q`

- asks for queue processing. This option has no effect.

`-Q retmode`

- sets Delivery-Status-Notification parameter to be either of: `FULL`, `HDRS`.

`-r address`

- is like `-f`.

`-t`

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

`-v`

- will report the progress of the message after it has been submitted. The `sendmail` process will write verbose log information to the `STDERR` stream until the `scheduler` deletes the message.

`-V envid`

- sets Delivery-Status-Notification parameter `ENVID` to be any arbitrary [xtext] string.