.\" @(#)sendmail 40.2 89/12/20 SMI; from UCB 4.2
'\" macro stdmacro
.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
.\"
.nr X
.if \nX=0 .ds x} sendmail 1M "BSD Compatibility Package" "\&"
.if \nX=1 .ds x} sendmail 1M "BSD Compatibility Package"
.if \nX=2 .ds x} sendmail 1M "" "\&"
.if \nX=3 .ds x} sendmail "" "" "\&"
.TH \*(x}
.SH NAME
\f4sendmail\f1 \- send mail over the internet
.SH SYNOPSIS
\f4/usr/ucb/sendmail\f1
[
\f4\-ba\f1
] [
\f4\-bd\f1
] [
\f4\-bi\f1
] [
\f4\-bm\f1
] [
\f4\-bp\f1
] [
\f4\-bs\f1
] [
\f4\-bt\f1
] [
\f4\-bv\f1
]
.br
	[
\f4\-bz\f1
] [
\f4\-C\f2file\f1
] [
\f4\-d\f2X\f1
] [
\f4\-F\f2fullname\f1
] [
\f4\-f\f2name\f1
] [
\f4\-h\f2N\f1
] [
\f4\-n\f1
] [
\f4\-o x\f2value\f1
]
.br
	[
\f4\-q\f1[
\f2time\f1
] ]
[
\f4\-r\f2name\f1
] [
\f4\-t\f1
] [
\f4\-v\f1
] [
\f2address .\|.\|.\f1]
.SH DESCRIPTION
\f4sendmail\f1
sends a message to one or more people,
routing the message over whatever networks are necessary.
\f4sendmail\f1
does internetwork forwarding as necessary
to deliver the message to the correct place.
.P
\f4sendmail\f1
is not intended as a user interface routine;
other programs provide user-friendly front ends;
\f4sendmail\f1
is used only to deliver pre-formatted messages.
.P
With no flags,
\f4sendmail\f1
reads its standard input up to an
\s-1EOF\s0,
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.
.P
Local addresses are looked up in the local
\f4aliases\f1(4)
file, or by using the
\s-1YP\s0
name service, and aliased appropriately.
In addition, if there is a
\f4.forward\f1
file in a recipient's  home directory,
\f4sendmail\f1
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'.
.P
\f4sendmail\f1
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
\f4/usr/lib/mailhosts\f1.
.P
The following options are available:
.TP
\f4\-ba\f1
Go into
\s-1ARPANET\s0
mode.
All input lines must end with a
\s-1CR-LF\s0,
and all messages will be generated with a
\s-1CR-LF\s0
at the end. 
Also, the ``From:'' and ``Sender:''
fields are examined for the name of the sender.
.TP
\f4\-bd\f1
Run as a daemon, waiting for incoming
\s-1SMTP\s0
connections.
.TP
\f4\-bi\f1
Initialize the alias database.
.TP
\f4\-bm\f1
Deliver mail in the usual way (default).
.TP
\f4\-bp\f1
Print a summary of the mail queue.
.TP
\f4\-bs\f1
Use the
\s-2SMTP\s0
protocol as described in
\s-1RFC\s0
821.
This flag implies all the operations of the
\f4\-ba\f1
flag that are compatible with
\s-2SMTP\s0.
.TP
\f4\-bt\f1
Run in address test mode.
This mode reads addresses and shows the steps in parsing;
it is used for debugging configuration tables.
.TP
\f4\-bv\f1
Verify names only \(em do not try to collect or deliver a message.
Verify mode is normally used for validating users or mailing lists.
.TP
\f4\-bz\f1
Create the configuration freeze file.
.TP
\f4\-C\f2file\f1
Use alternate configuration file.
.TP
\f4\-d\f2X\f1
Set debugging value to
\f2X\f1.
.TP
\f4\-F\f2fullname\f1
Set the full name of the sender.
.TP
\f4\-f\f2name\f1
Sets the name of the ``from'' person (that is, the sender of the mail).
\f4\-f\f1
can only be used by ``trusted'' users (who are
listed in the config file).
.TP
\f4\-h\f2N\f1
Set the hop count to
\f2N\f1.
The hop count is incremented every time the mail is processed.
When it reaches a limit, the mail is returned with an error message,
the victim of an aliasing loop.
.TP
\f4\-M\f2id\f1
Attempt to deliver the queued message with message-id
\f4id\f1.
.TP
\f4\-n\f1
Do not do aliasing.
.TP
\f4\-o\f2x\|value\f1
Set option
\f2x\f1
to the specified
\f2value\f1.
Options are described below.
.TP
\f4\-q\f1[\f2time]\f1
Processed saved messages in the queue at given intervals.
If
\f2time\f1
is omitted, process the queue once.
\f2Time\f1
is given as a tagged number, with
\f4s\f1
being seconds,
\f4m\f1
being minutes,
\f4h\f1
being hours,
\f4d\f1
being days, and
\f4w\f1
being weeks.
For example,
\f4\-q1h30m\f1
or
\f4\-q90m\f1
would both set the timeout to one hour thirty minutes.
.TP
\f4\-r\f2name\f1
An alternate and obsolete form of the
\f4\-f\f1
flag.
.TP
\f4\-R\f2string\f1
Go through the queue of pending mail and attempt to deliver any
message with a recipient containing the specified string.
This is
useful for clearing out mail directed to a machine which has been
down for awhile.
.TP
\f4\-t\f1
Read message for recipients.
``To:'', ``Cc:'', and ``Bcc:''
lines will be scanned for people to send to.
The ``Bcc:'' line will be deleted before transmission.
Any addresses in the argument list will be suppressed.
.TP
\f4\-v\f1
Go into verbose mode.
Alias expansions will be announced, etc.
.SS "PROCESSING OPTIONS"
There are also a number of processing options that may be set.
Normally these will only be used by a system administrator.
Options may be set either on the command line using the
\f4\-o\f1
flag or in the configuration file.
.\"These are described in detail in the
.\"\f2Installation and Operation Guide\fP.
The options are:
.TP
.RI A file
Use alternate alias file.
.TP
c
On mailers that are considered ``expensive'' to connect to,
do not initiate immediate connection.
This requires queueing.
.TP
.RI d x
Set the delivery mode to
\f2x\f1.
Delivery modes are
\f4i\f1
for interactive (synchronous) delivery,
\f4b\f1
for background (asynchronous) delivery, and
\f4q\f1
for queue only \(em that is, actual delivery is done
the next time the queue is run.
.TP
D
Run
\f4newaliases\f1(1M)
to automatically rebuild the alias database, if necessary.
.TP
.RI e x
Set error processing to mode
\f2x\f1.
Valid modes are
\f4m\f1
to mail back the error message,
\f4w\f1
to ``write'' back the error message
(or mail it back if the sender is not logged in),
\f4p\f1
to print the errors on the terminal (default),
`q' to throw away error messages (only exit status is returned),
and `e' to do special processing for the BerkNet.
If the text of the message is not mailed back by modes
\f4m\f1
or
\f4w\f1
and if the sender is local to this machine,
a copy of the message is appended to the file
\f4dead.letter\f1
in the sender's home directory.
.TP
.RI F mode
The mode to use when creating temporary files.
.TP
f
Save
\s-1UNIX\s0-system-style
``From'' lines at the front of messages.
.TP
.RI g N
The default group
\s-1ID\s0
to use when calling mailers.
.TP
.RI H file
The
\f4SMTP\fP
help file.
.TP
i
Do not take dots on a line by themselves as a message terminator.
.TP
.RI L n
The log level.
.TP
m
Send to ``me'' (the sender) also if I am in an alias expansion.
.TP
o
If set, this message may have old style headers.
If not set, this message is guaranteed to have new style headers
(that is, commas instead of spaces between addresses).
If set, an adaptive algorithm is used that will correctly
determine the header format in most cases.
.TP
.RI Q queuedir
Select the directory in which to queue messages.
.TP
.RI r timeout
The timeout on reads; if none is set,
\f4sendmail\f1
will wait forever for a mailer.
.TP
.RI S file
Save statistics in the named file.
.TP
s
Always instantiate the queue file,
even under circumstances where it is not strictly necessary.
.TP
.RI T time
Set the timeout on messages in the queue to the specified time.
After sitting in the queue for this amount of time,
they will be returned to the sender.
The default is three days.
.TP
.RI t stz,dtz
Set the name of the time zone.
.TP
.RI u N
Set the default user id for mailers.
.P
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
\f4sendmail\f1
from suppressing the blanks from between arguments.
.P
\f4sendmail\f1
returns an exit status describing what it
did.
The codes are defined in
.RI < sysexits.h >
.ta 3n +\w'EX_UNAVAILABLE'u+3n
.de XX
.ti \n(.iu
..
.in +\w'EX_UNAVAILABLE'u+6n
.XX
	\s-1EX_OK\s0	Successful completion on all addresses.
.XX
	\s-1EX_NOUSER\s0	User name not recognized.
.XX
	\s-1EX_UNAVAILABLE\s0	Catchall meaning necessary resources
were not available.
.XX
	\s-1EX_SYNTAX\s0	Syntax error in address.
.XX
	\s-1EX_SOFTWARE\s0	Internal software error,
including bad arguments.
.XX
	\s-1EX_OSERR\s0	Temporary operating system error,
such as \*(lqcannot fork\*(rq.
.XX
	\s-1EX_NOHOST\s0	Host name not recognized.
.XX
	\s-1EX_TEMPFAIL\s0	Message could not be sent immediately,
but was queued.
.P
If invoked as
\f2newaliases\f1,
\f4sendmail\f1
rebuilds the alias database.
If invoked as
\f2mailq\f1,
\f4sendmail\f1
prints the contents of the mail queue.
.SH FILES
Except for
\f4/etc/sendmail.cf\f1,
these pathnames are all specified in
\f4/etc/sendmail.cf\f1.
Thus, these values are only approximations.
.P
.PD 0
.\".TP 20
.\"\f4/etc/aliases\f1
.\"raw data for alias names
.\".TP
.\"\f4/etc/aliases.pag\f1
.\"data base of alias names
.\".TP
.\"\f4/etc/aliases.dir\f1
.\".TP
.\"\f4/usr/lib/mailhosts\f1
.\"list of hosts to which mail can be sent directly
.\".TP
.\"\f4/etc/sendmail.cf\f1
.\"configuration file
.\".TP
.\"\f4/etc/sendmail.fc\f1
.\"frozen configuration
.\".TP
.\"\f4/etc/sendmail.hf\f1
.\"help file
.\".TP
.\"\f4/etc/sendmail.st\f1
.\"collected statistics
.TP 1.5i
\f4/usr/bin/uux\f1
to deliver uucp mail
.TP
\f4/usr/bin/mail\f1
to deliver local mail
.TP
\f4/var/spool/mqueue/*\f1
temp files and queued mail
.TP
\f4~/.forward\f1
list of recipients for forwarding messages
.PD
.SH SEE ALSO
\f4biff\fP(1),
.\" \f4mail\fP(1),
\f4aliases\fP(4).
.P
Su, Zaw-Sing, and Jon Postel,
\f2The Domain Naming Convention for Internet User Applications\f1,
\s-1RFC\s0
819,
Network Information Center,
\s-1SRI\s0
International, Menlo Park, Calif.,
August 1982.
.br
Postel, Jon,
\f2Simple Mail Transfer Protocol\f1,
\s-1RFC\s0
821,
Network Information Center,
\s-1SRI\s0
International, Menlo Park, Calif.,
August 1982.
.br
Crocker, Dave,
\f2Standard for the Format of\f1
.I
\s-1ARPA\s0-Internet
\f2Text Messages\f1,
\s-1RFC\s0
822,
Network Information Center,
\s-1SRI\s0
International, Menlo Park, Calif.,
August 1982.
