sendmail sends a message to one or more people, routing the message over whatever networks are necessary. sendmail does internetwork forwarding as necessary to deliver the message to the correct place.
sendmail is not intended as a user interface routine; other programs provide user-friendly front ends; sendmail is used only to deliver pre-formatted messages.
With no flags, sendmail reads its standard input up to an EOF , or a line with a single dot, and sends a copy of the letter found there to all of the addresses listed. It determines the network to use based on the syntax and contents of the addresses.
Local addresses are looked up in the local aliases(4) file, or by using the YP name service, and aliased appropriately. In addition, if there is a .forward file in a recipient’s home directory, sendmail forwards a copy of each message to the list of recipients that file contains. Aliasing can be prevented by preceding the address with a backslash. Normally the sender is not included in alias expansions, for example, if ‘john’ sends to ‘group’, and ‘group’ includes ‘john’ in the expansion, then the letter will not be delivered to ‘john’.
sendmail will also route mail directly to other known hosts in a local network. The list of hosts to which mail is directly sent is maintained in the file /usr/lib/mailhosts.
If a letter is found to be undeliverable, it is returned to the sender with diagnostics that indicate the location and nature of the failure; or, the letter is placed in a dead.letter file in the sender’s home directory.
-pUUCP:uunet
sets the sending protocol to UUCP and the sending host to uunet. (Some existing programs use -oM to set the r and s macros; this is equivalent to using -p).
Oovalue
This sets option o to be value. Depending on the option, value may be
- a string
- an integer
- a boolean (with legal values t, T, f, or F; the default is TRUE)
- a time interval.
The options supported are:
All but command apply to client SMTP . For backward compatibility, a timeout with no keyword= part will set all of the longer values.
All options can be specified on the command line using the -o flag, but most will cause sendmail to relinquish its setuid permissions. The options that will not cause this are b, d, e, E, i, L, m, o, p, r, s, v, C, and 7. Also, M (define macro) when defining the r or s macros is also considered "safe ."
If the first character of the user name is a vertical bar, the rest of the user name is used as the name of a program to pipe the mail to. It may be necessary to quote the name of the user to keep sendmail from suppressing the blanks from between arguments.
sendmail returns an exit status describing what it did. The codes are defined in /usr/include/sysexits.h.
- EX_OK
- Successful completion on all addresses.
- EX_NOUSER
- User name not recognized.
- EX_UNAVAILABLE
- Catchall. Necessary resources were not available.
- EX_SYNTAX
- Syntax error in address.
- EX_SOFTWARE
- Internal software error, including bad arguments.
- X_OSERR
- Temporary operating system error, such as ‘cannot fork’.
- EX_NOHOST
- Host name not recognized.
- EX_TEMPFAIL
- Message could not be sent immediately, but was queued.
If invoked as newaliases, sendmail rebuilds the alias database. If invoked as mailq, sendmail prints the contents of the mail queue.
Su, Zaw-Sing, and
Jon Postel, The Domain Naming Convention for Internet User Applications,
RFC
819, Network Information Center, SRI
International, Menlo Park, Calif.,
August 1982.
Postel, Jon, Simple Mail Transfer Protocol, RFC
821, Network Information
Center, SRI
International, Menlo Park, Calif., August 1982.
Crocker, Dave, Standard for the Format of ARPA -Internet TextMessages, RFC 822, Network Information Center, SRI International, Menlo Park, Calif., August 1982.