sendmail

Name

sendmail -- an electronic mail transport agent

Synopsis

/usr/sbin/sendmail [options] [address...]

Description

To deliver electronic mail (email), implementations shall provide the interface described here as a command named sendmail. This interface shall be the default delivery method for applications needing to transmit an email message.

This program sends an email message to one or more recipients, routing the message as necessary. This program is not intended as a user interface routine.

With no options, sendmail reads its standard input up to an end-of-file or a line consisting only of a single dot and sends a copy of the message found there to all of the addresses listed. It determines the network(s) to use based on the syntax and contents of the addresses.

If an address is preceded by a backslash, '\', it is unspecified whether the address is subject to local alias expansion.

The format of messages shall be as defined in RFC 2822:Internet Message Format.

Note: The required name sendmail was chosen for historical reasons, but the behaviors specified here are intended to reflect functionality which can be provided by a number of other implementations such as smail, exim and others. This specification does not require that the specific sendmail program be the implementation chosen to provide this functionality.

Options

-bm 

read mail from standard input and deliver it to the recipient addresses. This is the default mode of operation.

-bp 

If the user has sufficient privilege, list information about messages currently in the mail queue.

-bs 

use the SMTP protocol as described in RFC 2821:Simple Mail Transfer Protocol; read SMTP commands on standard input and write SMTP responses on standard output.

In this mode, sendmail shall accept \r\n (CR-LF), as required by RFC 2821:Simple Mail Transfer Protocol, and \n (LF) line terminators.

-F fullname 

explicitly set the full name of the sender for incoming mail unless the message already contains a From: message header.

If the user running sendmail is not sufficiently trusted, then the actual sender may be indicated in the message, depending on the configuration of the agent.

-f name 

explicitly set the envelope sender address for incoming mail. If there is no From: header, the address specified in the From: header will also be set.

If the user running sendmail is not sufficiently trusted, then the actual sender shall be indicated in the message.

-i 

ignore dots alone on lines by themselves in incoming messages. If this options is not specified, a line consisting of a single dot shall terminate the input. If -bs is also used, the behavior is unspecified.

-odb 

deliver any mail in background, if supported; otherwise ignored.

-odf 

deliver any mail in foreground, if supported; otherwise ignored.

-oem or -em 

mail errors back to the sender. (default)

-oep or -ep 

write errors to the standard error output.

-oeq or -eq 

do not send notification of errors to the sender. This only works for mail delivered locally.

-oi 

is equivalent to -i.

-om 

indicate that the sender of a message should receive a copy of the message if the sender appears in an alias expansion. Ignored if aliases are not supported.

-t 

read the message to obtain recipients from the To:, Cc:, and Bcc: headers in the message instead of from the command arguments. If a Bcc: header is present, it is removed from the message unless there is no To: or Cc: header, in which case a Bcc: header with no data is created, in accordance with RFC 2822:Internet Message Format.

If there are any operands, the recipients list is unspecified.

This option may be ignored when not in -bm mode (the default).

Note: It is recommended that applications use as few options as necessary, none if possible.

Exit status

The sendmail command returns an exit status indicating the results of the operation. The exit codes are as defined in <sysexits.h>.

EX_OK 

successful completion on all addresses. Note this does not necessarily indicate successful delivery.

EX_NOUSER 

The user specified did not exist.

EX_UNAVAILABLE 

A required service or resource was unavailable.

EX_USAGE 

Command was invoked incorrectly, such as wrong number of arguments, syntax error in arguments, bad flags.

EX_SOFTWARE 

An internal sofware error was detected. Includes bad arguments.

EX_OSERROR 

An operating system error was detected. Includes failure to execute fork() or pipe().

EX_NOHOST 

The host specified did not exist.

EX_TEMPFAIL 

Temporary failure. Used to indicate the message could not be sent immediately, perhaps because a connection could not be created, but the request can be retried.