File: dot-forward.html

package info (click to toggle)
courier 1.0.16-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 49,264 kB
  • sloc: ansic: 128,070; cpp: 24,331; sh: 8,958; perl: 4,127; makefile: 3,243; sed: 16
file content (109 lines) | stat: -rw-r--r-- 8,947 bytes parent folder | download | duplicates (2)
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
<?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>dot-forward</title><link rel="stylesheet" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"/><link rel="home" href="#dot-forward" title="dot-forward"/><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="dot-forward" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>dot-forward, dotforward — Read <code class="filename">$HOME/.forward</code></p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="informalexample"><pre class="programlisting" xml:space="preserve">
$ cat $HOME/.courier
|| dotforward
./Maildir
</pre></div></div><div class="refsect1"><a id="dot-forward_description" shape="rect"> </a><h2>DESCRIPTION</h2><p>
The <span class="command"><strong>dotforward</strong></span> program is a compatibility module that reads
forwarding instructions in <code class="filename">$HOME/.forward</code>.
<span class="command"><strong>dotforward</strong></span> is used for compatibility
with <span class="command"><strong>sendmail</strong></span> or
other mail servers that use the <code class="filename">$HOME/.forward</code> file. The
<span class="command"><strong>dotforward</strong></span> program is intended to be executed from a
<a class="ulink" href="dot-courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">dot-courier</span>(5)</span></a>
delivery instruction file. The
system administrator can add it to the default set of delivery instructions,
thus unilaterally implementing <code class="filename">$HOME/.forward</code> systemwide.  To
read forwarding instructions from <code class="filename">$HOME/.forward</code>, put
"<code class="literal">|| dotforward</code>" on the first line of
<code class="filename">$HOME/.courier*</code>. "<code class="literal">|| dotforward</code>"
can also be added to the <code class="envar">DEFAULTDELIVERY</code> setting in the
<code class="literal">courierd</code> configuration file.  In both cases it must be followed
by a newline, and the remaining delivery instructions, which will be used if
<code class="filename">$HOME/.forward</code> does not exist.</p><p>
<span class="command"><strong>dotforward</strong></span> expects to be invoked from
<a class="ulink" href="dot-courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">dot-courier</span>(5)</span></a>
delivery instruction file via the
"<span class="token">||</span>" operator (or from <code class="envar">DEFAULTDELIVERY</code>). <span class="command"><strong>dotforward</strong></span>
checks its environment, reads the message from standard input, reconciles its
environment with the contents of <code class="filename">$HOME/.forward</code>, then prints on
standard output equivalent
<a class="ulink" href="dot-courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">dot-courier</span>(5)</span></a>
compatible delivery instructions.
The "<span class="token">||</span>" operator reinterprets <span class="command"><strong>dotforward</strong></span>'s output as additional
delivery instructions, by the
<span class="application">Courier</span> mail server.</p><p>
The different security models of the
<span class="application">Courier</span> mail server and other mail
servers that use
<code class="filename">$HOME/.forward</code>, such as <span class="command"><strong>sendmail</strong></span>,
means that it is
not possible to faithfully duplicate 100% of the behavior of
<code class="filename">$HOME/.forward</code> that originated with <span class="command"><strong>sendmail</strong></span>. The
following section documents the behavior of the <span class="command"><strong>dotforward</strong></span>
utility in the the <span class="application">Courier</span>
mail server mail server.</p><div class="refsect2"><a id="dot-forward__home__forward_processing" shape="rect"> </a><h3><code class="filename">$HOME/.forward</code> processing</h3><p>
<span class="command"><strong>dotforward</strong></span> reads the <code class="envar">DTLINE</code> environment variable,
and the headers of the message being delivered, from standard input.
<code class="envar">DTLINE</code> contains the recipient's E-mail address.  The
<code class="literal">Delivered-To</code> headers list the recipients that already received
this message.  This is used to prevent mail loops between
<code class="filename">$HOME/.forward</code> files from different recipients, which forward
mail to each other.</p><p>
If <code class="filename">$HOME/.forward</code> does not exist, <span class="command"><strong>dotforward</strong></span>
quietly terminates with a zero exit code, doing nothing. The remaining
delivery instructions in <code class="filename">$HOME/.courier</code> are then carried out.</p><p>
If <code class="filename">$HOME/.forward</code> exists, it is expected to contain a list of
addresses that the message should be forwarded to. An address may be an actual
E-mail address, or a name of a program or a mailbox.  Each line in
<code class="filename">$HOME/.forward</code> should contain a list of comma-separated
addresses.  Use "| /path/to/program" (including the double quotes) to specify
a delivery to a program (the message is piped to the given program). Use
"/path/to/mailbox" or "./path/to/mailbox" (again including the double quotes)
to specify a delivery to a mailbox (relative to <code class="literal">$HOME</code> in the
second case).</p><p>
"<code class="literal">| /path/to/program</code>",
"<code class="literal">/path/to/mailbox</code>",
 and "<code class="literal">./path/to/mailbox</code>" may also
be listed on a line by themselves without the double quotes.</p><p>
All other addresses are interpreted as E-mail addresses where the mail
should be forwarded.  Any backslash at the beginning of an E-mail address is
removed. Backslashes are used by <span class="command"><strong>sendmail</strong></span> to prevent mail
loops.
The <span class="application">Courier</span> mail server does not need the
backslashes -- it uses a different mechanism to
prevent mail loops.</p><p>
Every E-mail address is checked against the list of E-mail addresses found
in <code class="literal">Delivered-To</code> headers.  If the E-mail address specified in
<code class="filename">$HOME/.forward</code> matches any address in the
<code class="literal">Delivered-To</code> header, it is automatically removed from a list of
addresses.</p><p>
<span class="command"><strong>dotforward</strong></span> normally terminates with the exit code set to
<span class="errorcode">99</span>.
This results in the <span class="application">Courier</span> mail server
considering the message to be succesfully delivered,
and any additional delivery instructions in the <code class="filename">.courier</code> file
will not be carried out.  If an address read from <code class="filename">$HOME/.forward</code>
matches the address in the <code class="envar">DTLINE</code> environment variable, the
address is removed from the list of addresses that the message will be
forwarded to, and <span class="command"><strong>dotforward</strong></span> terminates with the exit code set to
0 (after printing all the relevant delivery instructions to standard output).
The messages will be forwarded, and the
<span class="application">Courier</span> mail server will proceed with
additional
delivery instructions in the <code class="filename">.courier</code> after finishing with the
delivery instructions it reads from <span class="command"><strong>dotforward</strong></span>.</p></div></div><div class="refsect1"><a id="dot-forward_bugs" shape="rect"> </a><h2>BUGS</h2><p>The restrictions and precautions mentioned in
<a class="ulink" href="dot-courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">dot-courier</span>(5)</span></a>
are also applicable here. There is
an upper limit on the maximum number of characters that are read from any
process executed by <span class="token">||</span>.
Also if any delivery instruction fails with a transit
exit code, the message will be completely redelivered at a later point, even
to all the addresses it has been succesfully delivered the first time
around.</p></div><div class="refsect1"><a id="dot-forward_see_also" shape="rect"> </a><h2>SEE ALSO</h2><p>
<a class="ulink" href="dot-courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">dot-courier</span>(5)</span></a>.</p></div></div></body></html>