SENDMAIL(8) | System Manager's Manual | SENDMAIL(8) |
sendmail
— an
electronic mail transport agent
sendmail |
[flags] [address ...]
[-v ] |
hoststat |
purgestat |
sendmail
sends a message to one or more
recipients,
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 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.
Local addresses are looked up in a file and aliased appropriately. Aliasing can be prevented by preceding the address with a backslash. Beginning with 8.10, the sender is included in any alias expansions, e.g., if `john' sends to `group', and `group' includes `john' in the expansion, then the letter will also be delivered to `john'.
sendmail
can be made to conduct ESMTP
transactions over TLS circuits to increase the security of mail server
transactions if TLS/SSL is enabled. See
starttls(8) for more
information.
-Ac
-Am
-B
type7BIT
or 8BITMIME
.-ba
-bd
sendmail
will fork and run in the
background listening on socket 25 for incoming SMTP connections. By
default, sendmail
will also listen on socket 587
for RFC 6409 message submission. This is normally run from
/etc/rc.-bD
-bd
except runs in foreground.-bh
-bH
-bi
-bm
-bp
-bP
-bs
-ba
flag that are compatible with SMTP.-bt
-bv
-C
filesendmail
gives
up any enhanced (set-user-ID or set-group-ID) privileges if an alternate
configuration file is specified.-D
logfile-d
category.level-d
0.1 prints the
version of sendmail
and the options it was
compiled with.
sendmail
's source code.-F
fullname-f
name-f
should only be used by
``trusted'' users (normally
root,
daemon,
and
network)
or if the person you are trying to become is the same as the person you
are. Otherwise, an X-Authentication-Warning header will be added to the
message.-G
-h
N-i
-L
tag-N
dsnnever
’ for no
notifications or a comma separated list of the values
‘failure
’ to be notified if delivery
failed, ‘delay
’ to be notified if
delivery is delayed, and ‘success
’
to be notified when the message is successfully delivered.-n
-O
option=value-o
x
value-p
protocol-Q
[reason]-q
[time]s
’ being seconds,
‘m
’ being minutes (default),
‘h
’ being hours,
‘d
’ being days, and
‘w
’ being weeks. For example,
‘-q1h30m
’ or
‘-q90m
’ would both set the timeout
to one hour thirty minutes. By default, sendmail
will run in the background. This option can be used safely with
-bd
.-qp
[time]-q
time, except
that instead of periodically forking a child to process the queue,
sendmail forks a single persistent child for each queue that alternates
between processing the queue and sleeping. The sleep time is given as the
argument; it defaults to 1 second. The process will always sleep at least
5 seconds if the queue was empty in the previous queue run.-qf
-qG
name-q
[!
]I
substr!
is
specified.-q
[!
]Q
substr!
is specified.-q
[!
]R
substr!
is specified.-q
[!
]S
substr!
is
specified.-R
returnfull
’ to return the entire message
or ‘hdrs
’ to return only the
headers. In the latter case also local bounces return only the
headers.-r
name-f
flag.-t
-V
envid-v
-X
logfile--
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 -o
flag
(for short names), the -O
flag (for long names), or
in the configuration file. This is a partial list limited to those options
that are likely to be useful on the command line and only shows the long
names; for a complete list (and details), consult the
Sendmail Installation and Operation Guide. The
options are:
AliasFile=
fileHoldExpensive
CheckpointInterval=
NDeliveryMode=
xi
’ for interactive (synchronous)
delivery, ‘b
’ for background
(asynchronous) delivery, ‘q
’ for
queue only - i.e., actual delivery is done the next time the queue is run,
and ‘d
’ for deferred - the same as
‘q
’ except that database lookups for
maps which have set the -D option (default for the host map) are
avoided.ErrorMode=
xm
’ to mail back the error message,
‘w
’ to ``write'' back the error
message (or mail it back if the sender is not logged in),
‘p
’ 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
‘m
’ or
‘w
’ and if the sender is local to
this machine, a copy of the message is appended to the file
dead.letter in the sender's home directory.SaveFromLine
MaxHopCount=
NIgnoreDots
SendMimeErrors
ConnectionCacheTimeout=
timeoutConnectionCacheSize=
NLogLevel=
nMeToo=
FalseCheckAliases
OldStyleHeaders
QueueDirectory=
queuedirStatusFile=
fileTimeout.queuereturn=
timeUserDatabaseSpec=
userdatabaseUSERDB
option compiled in.ForkEachJob
SevenBitInput
EightBitMode=
modem
(mimefy) will
convert to seven-bit MIME format, p
(pass) will
pass it as eight bits (but violates protocols), and
s
(strict) will bounce the message.MinQueueAge=
timeoutDefaultCharSet=
charsetDialDelay=
sleeptimeNoRecipientAction=
actionnone
leaves the message unchanged,
add-to
adds a To: header with the envelope
recipients, add-apparently-to
adds an
Apparently-To: header with the envelope recipients,
add-bcc
adds an empty Bcc: header, and
add-to-undisclosed
adds a header reading
‘To: undisclosed-recipients:;
’.MaxDaemonChildren=
NConnectionRateThrottle=
NIn aliases, the first character of a name may be a vertical bar to
cause interpretation of the rest of the name as a command to pipe the mail
to. It may be necessary to quote the name to keep
sendmail
from suppressing the blanks from between
arguments. For example:
eric: "|/usr/bin/vacation -a allman eric"
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.
If invoked as newaliases
,
sendmail
will rebuild the alias database. If invoked
as mailq
, sendmail
will
print the contents of the mail queue. If invoked as
hoststat
, sendmail
will
print the persistent host status database. If invoked as
purgestat
, sendmail
will
purge expired entries from the persistent host status database.
Except for the file /etc/mail/sendmail.cf itself the following pathnames are all specified in /etc/mail/sendmail.cf. Thus, these values are only approximations.
sendmail
returns an exit status describing
what it did. The codes are defined in
⟨sysexits.h⟩:
EX_OK
EX_NOUSER
EX_UNAVAILABLE
EX_SYNTAX
EX_SOFTWARE
EX_OSERR
EX_NOHOST
EX_TEMPFAIL
mail(1), syslog(3), aliases(5), mailer.conf(5), mailaddr(7), mail.local(8), mailq(8), mailstats(8), newaliases(8), rc(8), starttls(8)
"Filtering Mail with Sendmail",
/usr/share/doc/html/milter/index.html.
US Patent Numbers 6865671, 6986037.
Zaw-Sing Su and Jon Postel, The Domain Naming Convention for Internet User Applications, RFC 819, August 1982.
J. Klensin, Simple Mail Transfer Protocol, RFC 5321, October 2008.
P. Resnick, Internet Message Format, RFC 5322, October 2008.
The sendmail
command appeared in
4.2BSD.
sendmail
often gets blamed for many
problems that are actually the result of other problems, such as overly
permissive modes on directories. For this reason,
sendmail
checks the modes on system directories and
files to determine if they can be trusted. Although these checks can be
turned off and your system security reduced by setting the
DontBlameSendmail
option, the permission problems
should be fixed. For more information, see:
http://www.sendmail.org/tips/DontBlameSendmail.html
Because smtpd(8) is
the default OpenBSD mailer,
sendmail
versions of
aliases(5),
forward(5),
makemap(8), and
newaliases(8) are not
currently installed.
March 19, 2014 | OpenBSD-5.6 |