debian/rules: Use `git' potty wrapper.
[qmail] / envelopes.5
CommitLineData
2117e02e
MW
1.TH envelopes 5
2.SH "NAME"
3envelopes \- sender/recipient lists attached to messages
4.SH "INTRODUCTION"
5Electronic mail messages are delivered in
6.IR envelopes .
7
8An envelope lists a
9.I sender
10and one or more
11.IR recipients .
12Usually these
13envelope addresses are the same
14as the addresses listed in the message header:
15
16.EX
17 (envelope) from djb to root
18.br
19 From: djb
20.br
21 To: root
22.EE
23
24In more complicated situations, though,
25the envelope addresses may differ from the header addresses.
26.SH "ENVELOPE EXAMPLES"
27When a message is delivered to
28several people at different locations,
29it is first photocopied
30and placed into several envelopes:
31
32.EX
33 (envelope) from djb to root
34.br
35 From: djb Copy #1 of message
36.br
37 To: root, god@brl.mil
38.EE
39
40.EX
41 (envelope) from djb to god@brl.mil
42.br
43 From: djb Copy #2 of message
44.br
45 To: root, god@brl.mil
46.EE
47
48When a message is delivered
49to several people at the same location,
50the sender doesn't have to photocopy it.
51He can instead stuff it into
52one envelope with several addresses;
53the recipients will make the photocopy:
54
55.EX
56 (envelope) from djb to god@brl.mil, angel@brl.mil
57.br
58 From: djb
59.br
60 To: god@brl.mil, angel@brl.mil, joe, frde
61.EE
62
63Bounced mail is sent back to the envelope sender address.
64The bounced mail doesn't list an envelope sender,
65so bounce loops are impossible:
66
67.EX
68 (envelope) from <> to djb
69.br
70 From: MAILER-DAEMON
71.br
72 To: djb
73.br
74 Subject: unknown user frde
75.EE
76
77The recipient of a message may make another copy
78and forward it in a new envelope:
79
80.EX
81 (envelope) from djb to joe
82.br
83 From: djb Original message
84.br
85 To: joe
86.EE
87
88.EX
89 (envelope) from joe to fred
90.br
91 From: djb Forwarded message
92.br
93 To: joe
94.EE
95
96A mailing list works almost the same way:
97
98.EX
99 (envelope) from djb to sos-list
100.br
101 From: djb Original message
102.br
103 To: sos-list
104.EE
105
106.EX
107 (envelope) from sos-owner to god@brl.mil
108.br
109 From: djb Forwarded message
110.br
111 To: sos-list to recipient #1
112.EE
113
114.EX
115 (envelope) from sos-owner to frde
116.br
117 From: djb Forwarded message
118.br
119 To: sos-list to recipient #2
120.EE
121
122Notice that the mailing list is set up
123to replace the envelope sender with something new,
124.BR sos-owner .
125So bounces will come back to
126.BR sos-owner :
127
128.EX
129 (envelope) from <> to sos-owner
130.br
131 From: MAILER-DAEMON
132.br
133 To: sos-owner
134.br
135 Subject: unknown user frde
136.EE
137
138It's a good idea to set up an extra address,
139.BR sos-owner ,
140like this:
141the original envelope sender (\fBdjb\fP)
142has no way to fix bad
143.B sos-list
144addresses,
145and of course bounces must not be sent to
146.B sos-list
147itself.
148.SH "HOW ENVELOPE ADDRESSES ARE STORED"
149Envelope sender and envelope recipient addresses
150are transmitted and recorded in several ways.
151
152When a user injects mail through
153.BR qmail-inject ,
154he can supply a
155.B Return-Path
156line or a
157.B \-f
158option for the envelope sender;
159by default the envelope sender is his login name.
160The envelope recipient addresses can be taken
161from the command line or from various header fields,
162depending on the options to
163.BR qmail-inject .
164Similar comments apply to
165.BR sendmail .
166
167When a message is transferred from one machine to another through SMTP,
168the envelope sender is given in a
169.B MAIL FROM
170command,
171the envelope recipients are given in
172.B RCPT TO
173commands,
174and the message is supplied separately by a
175.B DATA
176command.
177
178When a message is delivered by
179.B qmail
180to a single local recipient,
181.B qmail-local
182records the recipient in
183.B Delivered-To
184and the envelope sender in
185.BR Return-Path .
186It uses
187.B Delivered-To
188to detect mail forwarding loops.
189
190.B sendmail
191normally records the envelope sender in
192.BR Return-Path .
193It does not record envelope recipient addresses,
194on the theory that they are redundant:
195you received the mail,
196so you must have been one of the envelope recipients.
197
198Note that,
199if the header doesn't have any recipient addresses,
200.B sendmail
201will move envelope recipient addresses back into the header.
202This situation occurs if all addresses were originally listed as
203.BR Bcc ,
204since
205.B Bcc
206is automatically removed.
207When
208.B sendmail
209sees this, it creates a new
210.B Apparently-To
211header field with the envelope recipient addresses.
212This has the strange effect that each blind-carbon-copy recipient will see
213a list of all recipients on the same machine.
214
215When a message is stored in
216.B mbox
217format,
218the envelope sender is recorded at the top of the message
219as a UUCP-style
220.B From
221(no colon) line.
222Note that this line is less reliable than the
223.B Return-Path
224line added by
225.B qmail-local
226or
227.B sendmail\fP.
228.SH "SEE ALSO"
229qmail-header(5),
230qmail-local(8),
231qmail-inject(8)