"Fossies" - the Fresh Open Source Software Archive

Member "courier-1.2.2/courier/doc/sendmail.html" (22 Jan 2022, 18342 Bytes) of package /linux/misc/courier-1.2.2.tar.bz2:

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.

    1 <?xml version="1.0"?>
    2 <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 Vsnapshot"/><link rel="home" href="#sendmail" 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"/><!--
    4 Copyright 1998 - 2009 Double Precision, Inc.  See COPYING for distribution
    5 information.
    7 --></head><body><div class="refentry"><a id="sendmail" 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="description" shape="rect"> </a><h2>DESCRIPTION</h2><p>
    8 The <span class="command"><strong>sendmail</strong></span> command reads an E-mail message and delivers
    9 the
   10 message to its recipients. This <span class="command"><strong>sendmail</strong></span> command is part of the
   11 Courier mail server, although it attempts to emulate the behavior of the
   12 original
   13 <a class="ulink" href="http://www.sendmail.org/" target="_top" shape="rect"><span class="application">sendmail</span></a>
   14 MTA. Applications written for
   15 <span class="application">Sendmail</span> should be able to use
   16 <span class="application">Courier</span> mail server's
   17 <span class="command"><strong>sendmail</strong></span>.
   18 This
   19 <span class="command"><strong>sendmail</strong></span> wrapper understands most command line arguments
   20 used by
   21 sendmail 8.9. Certain sendmail-specific arguments that make no sense for
   22 Courier, (like -o), are silently ignored.</p><p>
   23 This <span class="command"><strong>sendmail</strong></span> always behaves like the real sendmail with the
   24 <code class="option">-oi</code> and <code class="option">-t</code> options. This is how most
   25 applications expect it to work.  Some applications might run sendmail without
   26 the <code class="option">-oi</code> and <code class="option">-t</code> options, and expect
   27 sendmail's legacy
   28 behavior when those options are not used.  Those application may have problems
   29 with this sendmail wrapper.</p><p>
   30 <span class="command"><strong>sendmail</strong></span> reads the message from standard input, rewrites its
   31 headers appropriately and delivers it to the specified recipients.</p><p>
   32 If at least one E-mail address is specified on the command line,
   33 <span class="command"><strong>sendmail</strong></span> delivers the message to those recipients only.
   34 If no
   35 addresses are specified on the command line, <span class="command"><strong>sendmail</strong></span>
   36 reads the
   37 message and builds the recipient list from the <code class="literal">To:</code>,
   38 <code class="literal">Cc:</code> and <code class="literal">Bcc:</code> headers.</p><p>
   39       <span class="command"><strong>sendmail</strong></span> always removes <code class="literal">Bcc:</code>
   40       headers before sending the message if recipients are not specified on the
   41       command line.
   42     </p><p>
   43 Some of the functionality described below is actually implemented by other
   44 Courier modules that <span class="command"><strong>sendmail</strong></span> runs automatically.
   45 This process is
   46 transparent to the end user, or the application.</p><div class="refsect2"><a id="options" 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>
   47 Sets the <code class="literal">From:</code> address. This is just
   48 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>
   49 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>
   50 Sets delivery status notification
   51 options. <em class="replaceable"><code>options</code></em> is a comma-separated list of one or more of the
   52 following keywords: <code class="literal">never</code>, <code class="literal">success</code>,
   53 <code class="literal">fail</code>, <code class="literal">delay</code>. If not specified, the
   54 <code class="option">-N</code> option
   55 defaults to either "<code class="literal">delay, fail</code>", or just
   56 "<code class="literal">fail</code>", depending on systemwide options set by the
   57 administrator. The "<code class="literal">success</code>" keyword sends a return receipt
   58 to the sender when the message is succesfully received by each recipient.
   59 "<code class="literal">fail</code>" sends a notice if the message could not be delivered
   60 for some reason. "<code class="literal">delay</code>" sends a notice if the message
   61 remains undeliverable for a period of time (but has not yet completely
   62 failed). "<code class="literal">never</code>" means do not send any notices for any
   63 reason, but see BUGS below.</p></dd><dt><span class="term"><code class="option">-n</code></span></dt><dd><p>
   64 Do not actually deliver the message, but copy it to
   65 standard output, after rewriting all the headers.</p></dd><dt><span class="term"><code class="option">-o, -t, -q</code></span></dt><dd><p>
   66 These sendmail-specific options are ignored,
   67 because this is not the real sendmail.</p></dd><dt><span class="term"><code class="option">-R full</code></span></dt><dd><p>
   68 Requests that delivery status notifications
   69 include the original message, in its entirety.</p></dd><dt><span class="term"><code class="option">-R hdrs</code></span></dt><dd><p>
   70 Requests that delivery status notifications
   71 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>
   72 Specifies the original envelope id to
   73 be returned in delivery status notifications. Of interest only to mail
   74 robots.</p></dd><dt><span class="term"><code class="option">-S "<em class="replaceable"><code>level</code></em>"</code></span></dt><dd><p>
   75 Specify <em class="replaceable"><code>level</code></em> as a minimum
   76 security level for delivering this message. This is a Courier-specific
   77 extension that uses a Courier-specific SMTP extension. <em class="replaceable"><code>level</code></em> is
   78 either "NONE" or "STARTTLS". "NONE" specifies the normal security level
   79 (none at all); "STARTTLS" specifies that SSL/TLS must be used when
   80 transmitting this message to a remote mail relay, and the remote mail
   81 relay must supply a certificate that's signed by a private certificate authority
   82 that's configured in Courier. See Courier installation notes for more
   83 information.</p></dd><dt><span class="term"><code class="option">-bcc</code></span></dt><dd><p>
   84 Read <code class="literal">Bcc:</code> headers only. Normally, if no
   85 recipients are specified, <span class="command"><strong>sendmail</strong></span> obtains the list of
   86 recipients by reading the <code class="literal">To:</code>, <code class="literal">Cc:</code> and
   87 <code class="literal">Bcc:</code> headers (<code class="literal">Bcc:</code> headers are then
   88 removed).
   89 The <code class="literal">-bcc</code> option ignores <code class="literal">To:</code> and
   90 <code class="literal">Cc:</code>
   91 headers for this purpose. This option is ignored if an explicit address
   92 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>
   93 Talk ESMTP on standard input.  This option is
   94 actually implemented by running Courier's ESMTP server, which takes over
   95 and provides a complete ESMTP implementation.</p></dd><dt><span class="term"><code class="option">-verp</code></span></dt><dd><p>
   96 Use a <code class="literal">VERP</code> for this message.
   97 </p></dd></dl></div></div><div class="refsect2"><a id="returnaddress" shape="rect"> </a><h3>RETURN ADDRESS</h3><p>
   98 The return address is the E-mail address where delivery status
   99 notifications (non-delivery notices, or return receipts) are sent for this
  100 message.</p><p>
  101 <span class="command"><strong>sendmail</strong></span> constructs the envelope sender (the return address),
  102 <code class="literal">userid@host</code> as follows, unless the <code class="option">-bs</code>
  103 option was
  104 specified. If the <code class="option">-bs</code> option is specified the envelope sender is
  105 specified via ESMTP commands, of course.</p><p>
  106 If the <code class="option">-f</code> option was specified, the address specified by the
  107 <code class="option">-f</code> option is used.</p><p>
  108 Otherwise, the <em class="replaceable"><code>userid</code></em> portion of the return address is set to
  109 the contents of the first environment variable that's defined from the
  110 following list: <code class="envar">MAILSUSER</code>, <code class="envar">MAILUSER</code>,
  111 <code class="envar">LOGNAME</code>, <code class="envar">LOGUSER</code>. If none of these environment
  112 variables are defined, the system account name is used.</p><p>
  113 The <em class="replaceable"><code>host</code></em> portion of the return address is set to the contents
  114 of the <code class="envar">MAILSHOST</code> environment variable. If
  115 <code class="envar">MAILSHOST</code>
  116 is not defined, <code class="envar">MAILHOST</code> will be used. If neither variable is
  117 set, the configured machine name is used.</p><p>
  118 The return address is then subject to the address rewriting rules for the
  119 "local" Courier module (the "esmtp" module when the <code class="option">-bs</code> flag is
  120 specified).</p><p>
  121 Finally, if the <code class="option">-verp</code> option was specified, the return address
  122 is VERPed.</p></div><div class="refsect2"><a id="verp" shape="rect"> </a><h3>Variable Envelope Return Paths (VERPs)</h3><p>
  123 A VERP is a return address which contains the recipient address encoded in
  124 it. Not all MTAs support
  125 <a class="ulink" href="http://www.rfc-editor.org/rfc/rfc1894.txt" target="_top" shape="rect">RFC 1894</a>-based
  126 delivery status notifications. VERPs permit
  127 mailing list software to identify non-deliverable addresses even in the
  128 absence of a machine-readable DSN.</p><p>
  129 This option exists mainly to support Courier's own mailing list manager. At
  130 this time, it's the only software in the world that knows how to use this
  131 option.
  132 The <span class="application">Qmail</span>
  133 server originally had very
  134 similar functionality, for it's own mailing list manager.
  135 However,
  136 there are many functional differences between the two mail servers, so
  137 <span class="application">Courier</span> mail server's
  138 and <span class="application">Qmail</span>'s
  139 mailing list managers are not interchangeable.</p><p>
  140 Except for this detail,
  141 Courier's implementation of a VERP is very similar to
  142 Qmail's. When a message from <em class="replaceable"><code>user@domain.com</code></em> is addressed to
  143 address X, then return address will be set to <em class="replaceable"><code>user-Y@domain.com</code></em>,
  144 where Y is defined as follows:</p><p>
  145 1. The last @ character in X is changed to the = character.</p><p>
  146 2. The remaining characters in X are copied verbatim to Y, except for some
  147 special characters like @, +, %, :, and !.</p><p>
  148 3. These special characters are replaced with the character +, followed by
  149 a two-character hexadecimal ASCII code for the special character.</p><p>
  150 Using <code class="option">-verp</code> for a message to multiple recipients results in
  151 Courier generating and transmitting one copy of the message separately to
  152 every recipient. That's because the return address for every recipient is
  153 different, requiring a separate message to be sent.</p><p>
  154 Except in one case.</p><p>
  155 The one exception is when a VERPed message is sent from one Courier server
  156 to another Courier server via ESMTP. An ESMTP extension will be used to send
  157 one message, preserving the VERP status of the message. This ESMTP extension
  158 is described in the document,
  159 <code class="filename">draft-varshavchik-verp-smtpext</code>,
  160 a copy of which is included in Courier's source code.</p></div><div class="refsect2"><a id="senderaddress" shape="rect"> </a><h3>SENDER ADDRESS</h3><p>
  161 <span class="command"><strong>sendmail</strong></span> sets the contents of the
  162 <code class="literal">From:</code> header as
  163 follows. Note that this is not the same as the return address of the
  164 message.</p><p>
  165 If the <code class="option">-bs</code> option is specified, none of the following will be
  166 applicable. All environment variables are ignored when the <code class="option">-bs</code>
  167 option is used.</p><p>
  168 If the <code class="literal">From:</code> header is present in the message, but the
  169 environment variable <code class="envar">MAILUSER</code> is set, the userid portion of the
  170 <code class="literal">From:</code> header is replaced by the contents of
  171 <code class="envar">MAILUSER</code>.</p><p>
  172 If the <code class="literal">From:</code> header is present in the message, but the
  173 <code class="envar">MAILHOST</code> environment variable is set, the contents of
  174 <code class="envar">MAILHOST</code> replaces the host portion of the
  175 <code class="literal">From:</code> header.</p><p>
  176 If the <code class="literal">From:</code> header is present in the message,
  177 but either the
  178 <code class="option">-F</code> option was specified, or the <code class="envar">MAILNAME</code> or the
  179 <code class="envar">NAME</code> environment variable is set,  the contents of the -F option,
  180 or the environment variable, will replace the sender's name in the
  181 <code class="literal">From:</code> header.</p><p>
  182 If the <code class="literal">From:</code> header is not present in the message, one is
  183 constructed as follows. The sender's name is set by the -F option. If the -F
  184 option was not specified, the contents of the <code class="envar">MAILNAME</code> or the
  185 <code class="envar">NAME</code> environment variable is used. If neither variable is used,
  186 the name is looked up from the system account file. The userid portion of the
  187 address is set by the contents of any one of the following environment
  188 variables: <code class="envar">MAILUSER</code>, <code class="envar">LOGNAME</code>,
  189 <code class="envar">USER</code>. If none of these variables
  190 are set, the system userid is used. The host portion of the address is set by
  191 the contents of the <code class="envar">MAILHOST</code> environment variable. If it is not
  192 set, the system name of the server is used.</p></div><div class="refsect2"><a id="exitcode" shape="rect"> </a><h3>EXIT CODE</h3><p>
  193 <span class="command"><strong>sendmail</strong></span> exits with exit status of zero if the message was
  194 succesfully scheduled for a delivery. If there was a problem accepting the
  195 message for delivery, <span class="command"><strong>sendmail</strong></span> displays an error message and
  196 exits with a non-zero status. The exit status will always be zero when the
  197 <code class="option">-bs</code> option is used,
  198 unless a serious system problem occurs.</p></div><div class="refsect2"><a id="rmail" shape="rect"> </a><h3>RMAIL</h3><p>
  199 If called as <span class="command"><strong>rmail</strong></span>, only a subset of these options are
  200 available, namely <code class="option">-f</code>, <code class="option">-verp</code>,
  201 <code class="option">-N</code>, <code class="option">-R</code>, <code class="option">-V</code>,
  202 <code class="option">-o</code>, and <code class="option">-t</code>. Other options are not
  203 allowed. Additionally, recipient addresses must be explicitly specified on the
  204 command line. The <span class="command"><strong>rmail</strong></span> alias is intended to be used for
  205 receiving mail via UUCP. You must install compatible UUCP software separately,
  206 and set it up so that it looks for <span class="command"><strong>rmail</strong></span> in Courier's
  207 installation directory.</p><p>
  208 When invoked as <span class="command"><strong>rmail</strong></span> this wrapper will refuse to run unless
  209 it is invoked by the <code class="literal">uucp</code> user. Additionally, the
  210 <code class="envar">UU_MACHINE</code> and <code class="envar">UU_USER</code> environment
  211 variables must be
  212 defined.  Also, header and address rewriting described in previous paragraphs
  213 do not take place; instead, UUCP-specific header and address rewriting rules
  214 will apply.  See the
  215 <a class="ulink" href="courieruucp.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courieruucp</span>(8)</span></a>
  216 manual page for more information.</p></div></div><div class="refsect1"><a id="bugs" shape="rect"> </a><h2>BUGS</h2><p>
  217 There are still some mail gateways out there that do not implement
  218 delivery status notifications according to RFC 1894. This means that you may
  219 get a delivery notice even if <code class="option">-N never</code> keyword was
  220 specified.</p><p>
  221 Header rewriting rules are similar, but not identical, to Qmail's. The
  222 precedence of the various environment variables, plus the situations where
  223 they're used, are different from Qmail's and may produce different
  224 results.</p></div><div class="refsect1"><a id="seealso" shape="rect"> </a><h2>SEE ALSO</h2><p>
  225 <a class="ulink" href="courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courier</span>(8)</span></a>,
  226 <a class="ulink" href="courieruucp.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courieruucp</span>(8)</span></a>
  227 <a class="ulink" href="mailq.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">mailq</span>(8)</span></a>,
  228 <a class="ulink" href="cancelmsg.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">cancelmsg</span>(1)</span></a>,
  229 <a class="ulink" href="http://www.sendmail.org" target="_top" shape="rect">http://www.sendmail.org</a>.</p></div></div></body></html>