sendmail(1M) TCP/IP R4.11 sendmail(1M)
NAME
sendmail, newaliases, smtp, mailq - Internet mail transport service
SYNOPSIS
sendmail [ flags ] [ address ... ]
newaliases
smtp [ flags ]
mailq
DESCRIPTION
The sendmail program sends a message to one or more recipients,
routing the message over whatever networks are necessary. The
sendmail program does internetwork forwarding, as necessary, to
deliver the message to the correct place.
The sendmail program 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 a ^D 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.
Local addresses are looked up in a file and aliased appropriately.
Aliasing can be prevented by using the -n flag. Normally the sender
is not included in any alias expansions, e.g., if `john' sends to
`group', and `group' includes `john' in the expansion, then the
letter will not be delivered to `john'. To override this feature,
use the -om option. Recursive alias expansion is automatically
suppressed.
When it gets a message, sendmail attempts to reconcile the name of
the addressee for any possible alias, unless aliasing is suppressed.
It first interrogates the local alias database. If it does not find
the alias there, sendmail queries the Network Information Services'
(NIS) mail.aliases map. If the name alias does not exist in
mail.aliases, sendmail attempts to deliver the mail to the named
addressee. If NIS is not installed on the host, or if NIS becomes
unavailable, sendmail checks the local alias database as usual. For
more information about mail.aliases, see Managing ONC/NFS and Its
Facilities on the DG/UX System.
Flags are:
-Btype Set the body type to type. Current legal values are 7BIT
or 8BITMIME.
-bd Run as a server (daemon). This is the same as saying smtp
in the command line.
-bi Initialize the alias database. This is the same as using
newaliases on the command line.
-bm Deliver mail in the usual way (default).
-bp Print the contents of the mail queue (same as command
mailq).
-bs Use the SMTP protocol as described in RFC821 on standard
input and output.
-bt Run in address test mode. This mode reads addresses and
shows the steps in parsing; it is used for debugging
configuration tables.
-bv Verify names only - do not try to collect or deliver a
message. Verify mode is normally used for validating users
or mailing lists.
-Cfile Use alternate configuration file. When given this option,
sendmail runs as the invoking user, not root.
-dX Set debugging value to X. In general, this will cause
sendmail to print more information about what it is doing.
See the sendmail chapter in Managing TCP/IP on the DG/UX
System for more information on different ways to set
debugging levels.
-Ffullname
Set the full name of the sender on the From: line to
fullname.
-fname Sets the name of the "from" person (that is, the sender of
the mail). -f can be used only by the trusted users,
typically root, daemon, and network. -f can also be used
by other users if name is their own name.
-hN Set the hop count to N. The hop count is incremented every
time the mail is processed. When it reaches a limit, the
mail is returned with an error message, possibly the victim
of an aliasing loop.
-i Alternate form of -oi (see i option below).
-m Alternate form of -om (see m option below).
-n Don't do aliasing.
-oxvalue Set option x to the specified value. Options are described
below.
-pprotocol
Set the name of the protocol used to receive the message.
This can be a simple protocol name such as UUCP or a
protocol and hostname, such as UUCP:hostx.
-q[time] Process saved messages in the queue at given intervals.
You must have the appropriate privilege to use this option.
For systems supporting the DG/UX Capability Option,
appropriate privilege is defined as having one or more
specific capabilities enabled in the effective capability
set of the user. See capdefaults(5) for the default
capabilities for this command.
On systems without the DG/UX Capability Option, appropriate privilege
means that your process has an effective UID of root. See the
appropriateprivilege(5) man page for more information.
If time is omitted, process the queue once. time is given as a
tagged number and uses the following abbreviations:
s = seconds
m = minutes
h = hours
d = days
w = weeks
For example, "-q1h30m" or "-q90m" both set the time interval to 1
hour 30 minutes.
-qXstring Run the queue once, limiting the jobs to those matching
Xstring. X can be set to I to limit based on queue
identifier, R to limit based on recipient, or S to limit
based on sender. A particular queued job is accepted if it
contains the indicated string in its queue id (if X is I),
recipient addresses (if X is R) or sender addresses (if X
is S).
-rname Obsolete form of the -f flag.
-t Use the To:, Cc: and Bcc: lines of the message to determine
where the mail should go.
-v Go into verbose mode. Alias expansions will be announced.
-Xlogfile Log all traffic in and out of mailers in the indicated
logfile. This should only be used as a last resort for
debugging mailer bugs. It will log a lot of data very
quickly.
There are also a number of processing options that may be set.
Normally, these will be used only by a system administrator. Options
may be set either on the command line using the -o flag or in the
configuration file.
The options are:
Afile Use alternate alias file.
a[N] If set, wait N minutes for an @:@ entry to exist in the
alias database before rebuilding the database. If it does
not appear in N minutes, rebuild the database. If N is not
specified, the wait is 5 minutes.
Bc Substitute the character c for any blank encountered in the
address.
bnblocks The minimum number of free blocks needed on the spool
filesystem.
c Queue "expensive" mailers (see the -e flag, below), rather
than initiate an immediate connection.
CN Checkpoint the queue file after every N successful
deliveries (default 10). This avoids excessive duplicate
deliveries when sending a message to long mailing lists is
interrupted for whatever reason.
dx Set the delivery mode to x. Delivery modes are as follows:
i = interactive (synchronous) delivery
b = background (asynchronous) delivery
q = queue only - i.e., actual delivery is done the next
time the queue is run.
D If necessary, try to automatically rebuild the alias
database. If this option is not used, the newaliases
command must be invoked each time the aliases file is
updated.
Estring Set the default error message header to string. If string
begins with a backslash, it is interpreted as a file
containing the default error message header. This header
will be prepended to any error messages.
ex Set error processing to mode x. Valid modes are as
follows:
e = mail errors back and give zero exit status
m = mail back the error message
w = "write" back the error message (or mail it back if the
sender is not logged in)
p = print the errors on the terminal (default)
q = throw away error messages
For w and p modes, the text of the message is also appended
to the file dead.letter in the sender's home directory.
This option works only with interactive delivery by
invoking sendmail with the -v flag. While working with
non-interactive mode, error messages are always mailed to
the sender.
Fmode The file permission mode to use when creating temporary
files.
f Save UNIX-style "From " lines at the front of messages.
G Match local mail names against the GECOS portion of the
password file.
gid The default group ID to use when calling mailers.
Hfile Specify the SMTP help file.
hN The maximum number of times a message is allowed to "hop"
before it is assumed to be in a loop and rejected.
I If set, sendmail uses the domain name system (DNS) to
determine where to route mail on the Internet. If this
option is not set and the DNS is not running, the
/etc/hosts file will be considered complete. In general,
you do not want to set this option if your /etc/hosts file
does not include all hosts known to you or if you are using
the MX (mail forwarding) feature of the DNS. The DNS will
still be consulted even if this option is not set, but
sendmail will feel free to resort to reading /etc/hosts if
the DNS is not available. If set and the DNS is not
available, sendmail queues the mail. Thus, you should
never set this option if you are not using the DNS; mail
will never get delivered.
i Do not interpret a dot on a line by itself as a message
terminator.
j Send error messages in MIME format.
Jpath Set the search path for finding a user's .forward file to
path (default is .forward in the user's home directory).
path may consist of a colon separated list of files.
kN Set SMTP connection cache size to N (default is one).
Setting N to zero turns caching off (each SMTP connection
is closed after transmitting one messages).
Ktimeout Set SMTP connection cache timeout to timeout. This option
is used in conjunction with k to specify how long to wait
for another message before closing a cached connection.
Ln The log level.
l Send error messages to the addresses specified in the
Errors-To: header. This violates RFC1123.
Mxvalue Set the macro x to value. Use this option only from the
command line (for example, sendmail -oMDARPA); recall that
in the configuration file, you use Dxval to set macros (for
example, DDARPA).
m Mail to the sender, even if it is in alias expansion.
n Validate the right hand side of aliases during a newaliases
command.
o If this option is set, the message may have old style
headers. If the option is not set, the 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.
Ooptions Set SMTP options for the server. options is a comma
separated list of options of the form key=value where key
is one of the following:
Port = service listening port (defaults to SMTP)
Addr = network address (defaults to INADDR_ANY)
Family = network family (defaults to INET)
Listen = listen queue size (defaults to 10)
SendBufferSize = TCP/IP send buffer size in bytes
ReceiveBufferSize = TCP/IP receive buffer size in bytes
poptions Set privacy options for the server. options is a comma
separated list of options using one or more of the
following:
public = public access (the default)
needmailhelo = HELO or ELHO must be sent before MAIL
needexpnhelo = HELO or ELHO must be sent before EXPN
needvrfyhelo = HELO or ELHO must be sent before VRFY
noexpn = EXPN commands not allowed
novrfy = VRFY commands not allowed
restrictmailq = restrict mailq usage to privileged users
and group bin
restrictqrun = restrict -q usage to privileged users and
user bin
authwarnings = use X-Authentication-Warning: header
noreceipts = ignore Return-Receipt-To: header
goaway = do not allow status queries (equivalent to setting
all options except public, restrictmailq and restrictqrun).
Pname Send a copy of the header of a failed message to local user
name.
Qdirectory
Select the directory in which to queue messages.
qfactor The sendmail program divides the value of the factor you
specify by the difference between the current load average
and the load average limit to determine the maximum message
priority of messages to be sent immediately. When the
resulting quotient is less than the priority of the
message, the job is queued rather than run immediately.
rtimeouts The timeouts on various SMTP commands. timeouts is a comma
separated list of timeouts of the form key=value where key
is one of the following:
initial = initial greeting (default is 5 minutes)
mail = MAIL command (default is 10 minutes)
rcpt = RCPT command (default is 1 hour)
datainit = DATA command (default is 5 minutes)
datablock = data block read (default is 1 hour)
datafinal = message terminator (default is 1 hour)
command = command read (default is 1 hour)
rset = RSET command (default is 5 minutes)
helo = HELO and EHLO commands (default is 5 minutes)
quit = QUIT command (default is 2 minutes)
misc = NOOP and VERB commands (default is 2 minutes)
r without any timeouts specified is accepted for backwards
compatibility.
R Do not prune route addresses. By default, sendmail tries to
rewrite route addresses to make connections as direct as
possible.
Sfile Log mail statistics in the specified file. The statistics
logged are the number of messages to and from each mailer
and the number of kilobytes transferred to and from each
mailer. The default statistics file is /etc/sendmail.st.
If you use a non-default statistics file, first create an
empty file.
s Always create the queue file, even under circumstances
where it is not strictly necessary. This provides safety
against system failures during delivery.
Ttime 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.
ttimezone Set the time zone. Default is EST5EDT.
uid Set the default user ID for mailers.
v Run in verbose mode. This option is only to be used on the
command line and not in a configuration file. Use of this
option turns option c to false and option d to i
(interactive).
Vhost Specify a fallback host where mail is to be forwarded after
all other MX connection attempts have failed.
xN Set the load average above which to queue messages to N,
where N is a real number. The default value for N is 2.0.
The sendmail program will only queue messages to conserve
system resources.
Xn Set the load average above which to refuse incoming
messages to n, where n is a real number. The default value
for n is 3.0. The sendmail program will not accept any
incoming connections until the load average falls below n.
Y If set, sendmail uses a distinct process to deliver each
job that is run from the queue. Use this option if your
system has little memory, since otherwise sendmail uses
considerable memory when processing the queue.
yfactor In the calculation of the priority of a message, sendmail
multiplies the number of recipients by factor and adds this
to the current priority value. This option is therefore
used to lower the priority of messages which have large
recipient lists. The default value of factor is 30,000.
zfactor In the calculation of the priority of a message, sendmail
multiplies the class (precedence) of a message by factor
and subtracts this from the current priority value. This
option is therefore used to raise the priority of messages
which are of higher class. The default value of factor is
1800.
Zfactor Increment the priority value of a message in the queue by
factor. The longer a message remains in the queue, the
lower its priority. The default value of factor is 90,000.
7 Strip incoming messages to seven bits.
The destination address for sendmail may be a name of a program to
pipe the mail to, rather than a username. Such a destination must be
included in the aliases file and must start with a vertical bar. It
may be necessary to quote the name of the user to keep sendmail from
suppressing the blanks between arguments.
Aliases may also have the syntax :include:filename to ask sendmail to
read the named file for a list of recipients. For example, an alias
such as:
poets: ":include:/usr/local/lib/poets.list"
would read /usr/local/lib/poets.list for the list of addresses making
up the group.
The sendmail program returns an exit status describing what it did.
0 EX_OK Successful completion on all addresses.
64 EX_USAGE Incorrect arguments to command.
65 EX_DATAERR Input data was incorrect.
66 EX_NOINPUT An input file (not a system file)
did not exist or was not readable.
67 EX_NOUSER Username not recognized.
68 EX_NOHOST Hostname not recognized.
69 EX_UNAVAILABLE Necessary resources were not available.
70 EX_SOFTWARE Software error, including bad arguments.
71 EX_OSERR Temporary operating system error;
for example, cannot fork.
72 EX_OSFILE Some system file does not exist.
73 EX_CANTCREAT A user-specified file cannot be created
74 EX_IOERR An error occurred while reading from or
writing to some file.
75 EX_TEMPFAIL Message not sent immediately; is queued.
76 EX_PROTOCOL The remote system returned something
violating the SMTP protocol.
77 EX_NOPERM Invoking user lacked permission for
requested operation.
78 EX_CONFIG Configuration error.
If you invoke it as newaliases, sendmail will rebuild the alias
database. If you invoke it as mailq, sendmail will print the
contents of the mail queue. If invoked it as smtp, sendmail starts
the server.
FILES
Some of these pathnames are specified in /etc/sendmail.cf. Thus,
these values are only defaults.
/etc/aliases Text file for alias database
/etc/aliases.dir Compiled alias database - contains
database index
/etc/aliases.pag Compiled alias database - contains
database data
/etc/mailstats.st Repository for mail statistics
/etc/sendmail.cf Configuration file
/etc/sendmail.hf Help file for sendmail
/etc/sendmail.pid File containing process ID of the smtp
server
/usr/bin/newaliases To initialize aliases
/usr/bin/dbm Program to build dbm files for sendmail
/usr/bin/mailq To print the mail queue
/usr/bin/mailstats Program to print/clear accumulated mail
statistics
/usr/bin/smtp To start sendmail server
/var/spool/mqueue/* Temp files
/usr/bin/mail To deliver local mail
/usr/bin/mailx Interactive message processing system
/etc/mail/mailx.rc Initialization file for mailx(1). Use
"sendmail=/usr/bin/sendmail" to specify
sendmail(1M) as the delivery agent
instead of the default, mail(1).
/etc/tcpip.params TCP/IP parameters
/usr/sbin/init.d/rc.tcpipserv
Must start smtp server
/etc/passwd Must include entry for local mailer
/etc/services Must include smtp entry
SEE ALSO
dbm(1M), mail(1), mailstats(1M), mailx(1), aliases(4),
appropriateprivilege(5).
capdefaults(5).
RFC821, RFC822, RFC1123.
BUGS
The sendmail program converts blanks in addresses to dots. This is
incorrect according to the old ARPANET mail protocol RFC733 (NIC
41952), but is consistent with the new protocols (RFC822).
Licensed material--property of copyright holder(s)