This file is indexed.

/usr/share/doc/courier-doc/html/sendmail.html is in courier-doc 0.78.0-2ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>sendmail</title><link rel="stylesheet" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/><link rel="home" href="#idm139849432424624" title="sendmail"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--

Copyright 1998 - 2009 Double Precision, Inc.  See COPYING for distribution
information.

--></head><body><div class="refentry"><a id="idm139849432424624" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>sendmail — Send an E-mail message</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">sendmail</code>  [<em class="replaceable"><code>option</code></em>...] [--] [<em class="replaceable"><code>address</code></em>...]</p></div><div class="cmdsynopsis"><p><code class="command">rmail</code>  [-f <em class="replaceable"><code>sender</code></em>] {<em class="replaceable"><code>address</code></em>} [<em class="replaceable"><code>address</code></em>...]</p></div></div><div class="refsect1"><a id="idm139849436824896" shape="rect"> </a><h2>DESCRIPTION</h2><p>
The <span class="command"><strong>sendmail</strong></span> command reads an E-mail message and delivers
the
message to its recipients. This <span class="command"><strong>sendmail</strong></span> command is part of the
Courier mail server, although it attempts to emulate the behavior of the
original
<a class="ulink" href="http://www.sendmail.org/" target="_top" shape="rect"><span class="application">sendmail</span></a>
MTA. Applications written for
<span class="application">Sendmail</span> should be able to use
<span class="application">Courier</span> mail server's
<span class="command"><strong>sendmail</strong></span>.
This
<span class="command"><strong>sendmail</strong></span> wrapper understands most command line arguments
used by
sendmail 8.9. Certain sendmail-specific arguments that make no sense for
Courier, (like -o), are silently ignored.</p><p>
This <span class="command"><strong>sendmail</strong></span> always behaves like the real sendmail with the
<code class="option">-oi</code> and <code class="option">-t</code> options. This is how most
applications expect it to work.  Some applications might run sendmail without
the <code class="option">-oi</code> and <code class="option">-t</code> options, and expect
sendmail's legacy
behavior when those options are not used.  Those application may have problems
with this sendmail wrapper.</p><p>
<span class="command"><strong>sendmail</strong></span> reads the message from standard input, rewrites its
headers appropriately and delivers it to the specified recipients.</p><p>
If at least one E-mail address is specified on the command line,
<span class="command"><strong>sendmail</strong></span> delivers the message to those recipients only.
If no
addresses are specified on the command line, <span class="command"><strong>sendmail</strong></span>
reads the
message and builds the recipient list from the <code class="literal">To:</code>,
<code class="literal">Cc:</code> and <code class="literal">Bcc:</code> headers.</p><p>
      <span class="command"><strong>sendmail</strong></span> always removes <code class="literal">Bcc:</code>
      headers before sending the message if recipients are not specified on the
      command line.
    </p><p>
Some of the functionality described below is actually implemented by other
Courier modules that <span class="command"><strong>sendmail</strong></span> runs automatically.
This process is
transparent to the end user, or the application.</p><div class="refsect2"><a id="idm139849436861584" shape="rect"> </a><h3>OPTIONS</h3><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-f <em class="replaceable"><code>address</code></em></code></span></dt><dd><p>
Sets the <code class="literal">From:</code> address. This is just
the E-mail address only, not the name.</p></dd><dt><span class="term"><code class="option">-F "<em class="replaceable"><code>name</code></em>"</code></span></dt><dd><p>
Sets the name to put in the <code class="literal">From:</code> header.</p></dd><dt><span class="term"><code class="option">-N <em class="replaceable"><code>options</code></em></code></span></dt><dd><p>
Sets delivery status notification
options. <em class="replaceable"><code>options</code></em> is a comma-separated list of one or more of the
following keywords: <code class="literal">never</code>, <code class="literal">success</code>,
<code class="literal">fail</code>, <code class="literal">delay</code>. If not specified, the
<code class="option">-N</code> option
defaults to either "<code class="literal">delay, fail</code>", or just
"<code class="literal">fail</code>", depending on systemwide options set by the
administrator. The "<code class="literal">success</code>" keyword sends a return receipt
to the sender when the message is succesfully received by each recipient.
"<code class="literal">fail</code>" sends a notice if the message could not be delivered
for some reason. "<code class="literal">delay</code>" sends a notice if the message
remains undeliverable for a period of time (but has not yet completely
failed). "<code class="literal">never</code>" means do not send any notices for any
reason, but see BUGS below.</p></dd><dt><span class="term"><code class="option">-n</code></span></dt><dd><p>
Do not actually deliver the message, but copy it to
standard output, after rewriting all the headers.</p></dd><dt><span class="term"><code class="option">-o, -t, -q</code></span></dt><dd><p>
These sendmail-specific options are ignored,
because this is not the real sendmail.</p></dd><dt><span class="term"><code class="option">-R full</code></span></dt><dd><p>
Requests that delivery status notifications
include the original message, in its entirety.</p></dd><dt><span class="term"><code class="option">-R hdrs</code></span></dt><dd><p>
Requests that delivery status notifications
include just the headers of the original message.</p></dd><dt><span class="term"><code class="option">-V "<em class="replaceable"><code>envid</code></em>"</code></span></dt><dd><p>
Specifies the original envelope id to
be returned in delivery status notifications. Of interest only to mail
robots.</p></dd><dt><span class="term"><code class="option">-S "<em class="replaceable"><code>level</code></em>"</code></span></dt><dd><p>
Specify <em class="replaceable"><code>level</code></em> as a minimum
security level for delivering this message. This is a Courier-specific
extension that uses a Courier-specific SMTP extension. <em class="replaceable"><code>level</code></em> is
either "NONE" or "STARTTLS". "NONE" specifies the normal security level
(none at all); "STARTTLS" specifies that SSL/TLS must be used when
transmitting this message to a remote mail relay, and the remote mail
relay must supply a certificate that's signed by a private certificate authority
that's configured in Courier. See Courier installation notes for more
information.</p></dd><dt><span class="term"><code class="option">-bcc</code></span></dt><dd><p>
Read <code class="literal">Bcc:</code> headers only. Normally, if no
recipients are specified, <span class="command"><strong>sendmail</strong></span> obtains the list of
recipients by reading the <code class="literal">To:</code>, <code class="literal">Cc:</code> and
<code class="literal">Bcc:</code> headers (<code class="literal">Bcc:</code> headers are then
removed).
The <code class="literal">-bcc</code> option ignores <code class="literal">To:</code> and
<code class="literal">Cc:</code>
headers for this purpose. This option is ignored if an explicit address
list is specified on the <span class="command"><strong>sendmail</strong></span> command line.</p></dd><dt><span class="term"><code class="option">-bs</code></span></dt><dd><p>
Talk ESMTP on standard input.  This option is
actually implemented by running Courier's ESMTP server, which takes over
and provides a complete ESMTP implementation.</p></dd><dt><span class="term"><code class="option">-verp</code></span></dt><dd><p>
Use a <code class="literal">VERP</code> for this message.
</p></dd></dl></div></div><div class="refsect2"><a id="idm139849436947328" shape="rect"> </a><h3>RETURN ADDRESS</h3><p>
The return address is the E-mail address where delivery status
notifications (non-delivery notices, or return receipts) are sent for this
message.</p><p>
<span class="command"><strong>sendmail</strong></span> constructs the envelope sender (the return address),
<code class="literal">userid@host</code> as follows, unless the <code class="option">-bs</code>
option was
specified. If the <code class="option">-bs</code> option is specified the envelope sender is
specified via ESMTP commands, of course.</p><p>
If the <code class="option">-f</code> option was specified, the address specified by the
<code class="option">-f</code> option is used.</p><p>
Otherwise, the <em class="replaceable"><code>userid</code></em> portion of the return address is set to
the contents of the first environment variable that's defined from the
following list: <code class="envar">MAILSUSER</code>, <code class="envar">MAILUSER</code>,
<code class="envar">LOGNAME</code>, <code class="envar">LOGUSER</code>. If none of these environment
variables are defined, the system account name is used.</p><p>
The <em class="replaceable"><code>host</code></em> portion of the return address is set to the contents
of the <code class="envar">MAILSHOST</code> environment variable. If
<code class="envar">MAILSHOST</code>
is not defined, <code class="envar">MAILHOST</code> will be used. If neither variable is
set, the configured machine name is used.</p><p>
The return address is then subject to the address rewriting rules for the
"local" Courier module (the "esmtp" module when the <code class="option">-bs</code> flag is
specified).</p><p>
Finally, if the <code class="option">-verp</code> option was specified, the return address
is VERPed.</p></div><div class="refsect2"><a id="idm139849435189632" shape="rect"> </a><h3>Variable Envelope Return Paths (VERPs)</h3><p>
A VERP is a return address which contains the recipient address encoded in
it. Not all MTAs support
<a class="ulink" href="http://www.rfc-editor.org/rfc/rfc1894.txt" target="_top" shape="rect">RFC 1894</a>-based
delivery status notifications. VERPs permit
mailing list software to identify non-deliverable addresses even in the
absence of a machine-readable DSN.</p><p>
This option exists mainly to support Courier's own mailing list manager. At
this time, it's the only software in the world that knows how to use this
option.
The <a class="ulink" href="http://www.qmail.org/" target="_top" shape="rect"><span class="application">Qmail</span></a>
server has very
similar functionality, for it's own mailing list manager.
However,
there are many functional differences between the two mail servers, so
<span class="application">Courier</span> mail server's
and <span class="application">Qmail</span>'s
mailing list managers are not interchangeable.</p><p>
Except for this detail,
Courier's implementation of a VERP is very similar to
Qmail's. When a message from <em class="replaceable"><code>user@domain.com</code></em> is addressed to
address X, then return address will be set to <em class="replaceable"><code>user-Y@domain.com</code></em>,
where Y is defined as follows:</p><p>
1. The last @ character in X is changed to the = character.</p><p>
2. The remaining characters in X are copied verbatim to Y, except for some
special characters like @, +, %, :, and !.</p><p>
3. These special characters are replaced with the character +, followed by
a two-character hexadecimal ASCII code for the special character.</p><p>
Using <code class="option">-verp</code> for a message to multiple recipients results in
Courier generating and transmitting one copy of the message separately to
every recipient. That's because the return address for every recipient is
different, requiring a separate message to be sent.</p><p>
Except in one case.</p><p>
The one exception is when a VERPed message is sent from one Courier server
to another Courier server via ESMTP. An ESMTP extension will be used to send
one message, preserving the VERP status of the message. This ESMTP extension
is described in the document,
<code class="filename">draft-varshavchik-verp-smtpext</code>,
a copy of which is included in Courier's source code.</p></div><div class="refsect2"><a id="idm139849435178544" shape="rect"> </a><h3>SENDER ADDRESS</h3><p>
<span class="command"><strong>sendmail</strong></span> sets the contents of the
<code class="literal">From:</code> header as
follows. Note that this is not the same as the return address of the
message.</p><p>
If the <code class="option">-bs</code> option is specified, none of the following will be
applicable. All environment variables are ignored when the <code class="option">-bs</code>
option is used.</p><p>
If the <code class="literal">From:</code> header is present in the message, but the
environment variable <code class="envar">MAILUSER</code> is set, the userid portion of the
<code class="literal">From:</code> header is replaced by the contents of
<code class="envar">MAILUSER</code>.</p><p>
If the <code class="literal">From:</code> header is present in the message, but the
<code class="envar">MAILHOST</code> environment variable is set, the contents of
<code class="envar">MAILHOST</code> replaces the host portion of the
<code class="literal">From:</code> header.</p><p>
If the <code class="literal">From:</code> header is present in the message,
but either the
<code class="option">-F</code> option was specified, or the <code class="envar">MAILNAME</code> or the
<code class="envar">NAME</code> environment variable is set,  the contents of the -F option,
or the environment variable, will replace the sender's name in the
<code class="literal">From:</code> header.</p><p>
If the <code class="literal">From:</code> header is not present in the message, one is
constructed as follows. The sender's name is set by the -F option. If the -F
option was not specified, the contents of the <code class="envar">MAILNAME</code> or the
<code class="envar">NAME</code> environment variable is used. If neither variable is used,
the name is looked up from the system account file. The userid portion of the
address is set by the contents of any one of the following environment
variables: <code class="envar">MAILUSER</code>, <code class="envar">LOGNAME</code>,
<code class="envar">USER</code>. If none of these variables
are set, the system userid is used. The host portion of the address is set by
the contents of the <code class="envar">MAILHOST</code> environment variable. If it is not
set, the system name of the server is used.</p></div><div class="refsect2"><a id="idm139849435161440" shape="rect"> </a><h3>EXIT CODE</h3><p>
<span class="command"><strong>sendmail</strong></span> exits with exit status of zero if the message was
succesfully scheduled for a delivery. If there was a problem accepting the
message for delivery, <span class="command"><strong>sendmail</strong></span> displays an error message and
exits with a non-zero status. The exit status will always be zero when the
<code class="option">-bs</code> option is used,
unless a serious system problem occurs.</p></div><div class="refsect2"><a id="idm139849435158208" shape="rect"> </a><h3>RMAIL</h3><p>
If called as <span class="command"><strong>rmail</strong></span>, only a subset of these options are
available, namely <code class="option">-f</code>, <code class="option">-verp</code>,
<code class="option">-N</code>, <code class="option">-R</code>, <code class="option">-V</code>,
<code class="option">-o</code>, and <code class="option">-t</code>. Other options are not
allowed. Additionally, recipient addresses must be explicitly specified on the
command line. The <span class="command"><strong>rmail</strong></span> alias is intended to be used for
receiving mail via UUCP. You must install compatible UUCP software separately,
and set it up so that it looks for <span class="command"><strong>rmail</strong></span> in Courier's
installation directory.</p><p>
When invoked as <span class="command"><strong>rmail</strong></span> this wrapper will refuse to run unless
it is invoked by the <code class="literal">uucp</code> user. Additionally, the
<code class="envar">UU_MACHINE</code> and <code class="envar">UU_USER</code> environment
variables must be
defined.  Also, header and address rewriting described in previous paragraphs
do not take place; instead, UUCP-specific header and address rewriting rules
will apply.  See the
<a class="ulink" href="courieruucp.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courieruucp</span>(8)</span></a>
manual page for more information.</p></div></div><div class="refsect1"><a id="idm139849435147328" shape="rect"> </a><h2>BUGS</h2><p>
There are still some mail gateways out there that do not implement
delivery status notifications according to RFC 1894. This means that you may
get a delivery notice even if <code class="option">-N never</code> keyword was
specified.</p><p>
Header rewriting rules are similar, but not identical, to Qmail's. The
precedence of the various environment variables, plus the situations where
they're used, are different from Qmail's and may produce different
results.</p></div><div class="refsect1"><a id="idm139849435144880" shape="rect"> </a><h2>SEE ALSO</h2><p>
<a class="ulink" href="courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courier</span>(8)</span></a>,
<a class="ulink" href="courieruucp.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courieruucp</span>(8)</span></a>
<a class="ulink" href="mailq.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">mailq</span>(8)</span></a>,
<a class="ulink" href="cancelmsg.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">cancelmsg</span>(1)</span></a>,
<a class="ulink" href="http://www.sendmail.org" target="_top" shape="rect">http://www.sendmail.org</a>,
<a class="ulink" href="http://www.qmail.org" target="_top" shape="rect">http://www.qmail.org</a>.</p></div></div></body></html>