debian/rules: Use `git' potty wrapper.
[qmail] / addresses.5
CommitLineData
2117e02e
MW
1.TH addresses 5
2.SH "NAME"
3addresses \- formats for Internet mail addresses
4.SH "INTRODUCTION"
5A
6.B mail address
7is a string of characters containing @.
8
9Every mail address has a
10.B local part
11and a
12.B domain part\fR.
13The domain part is everything after the final @.
14The local part is everything before.
15
16For example, the mail addresses
17
18.EX
19 God@heaven.af.mil
20 @heaven.af.mil
21 @at@@heaven.af.mil
22.EE
23
24all have domain part
25.BR heaven.af.mil .
26The local parts are
27.BR God ,
28empty,
29and
30.BR @at@ .
31
32Some domains have owners.
33It is up to the owner of
34.B heaven.af.mil
35to say how mail messages will be delivered to addresses with domain part
36.BR heaven.af.mil .
37
38The domain part of an address is interpreted without regard to case, so
39
40.EX
41 God@heaven.af.mil
42.br
43 God@HEAVEN.AF.MIL
44.br
45 God@Heaven.AF.Mil
46.EE
47
48all refer to the same domain.
49
50There is one exceptional address that does not contain an @:
51namely, the empty string.
52The empty string cannot be used as a recipient address.
53It can be used as a sender address so that
54the real sender doesn't receive bounces.
55.SH "QMAIL EXTENSIONS"
56The
57.B qmail
58system allows several further types of addresses in mail envelopes.
59
60First, an envelope recipient address without an @ is interpreted as being at
61.IR envnoathost .
62For example, if
63.I envnoathost
64is
65.BR heaven.af.mil ,
66the address
67.B God
68will be rewritten as
69.BR God@heaven.af.mil .
70
71Second, the address
72.B #@[]
73is used as an envelope sender address for double bounces.
74
75Third, envelope sender addresses of the form
76.I pre\fB@\fIhost\fB-@[]
77are used to support variable envelope return paths (VERPs).
78.B qmail-send
79will rewrite
80.I pre\fB@\fIhost\fB-@[]
81as
82.I prerecip\fB=\fIdomain\fB@\fIhost
83for deliveries to
84.IR recip\fB@\fIdomain .
85Bounces directly from
86.B qmail-send
87will come back to
88.IR pre\fB@\fIhost .
89.SH "CHOOSING MAIL ADDRESSES"
90Here are some suggestions on choosing mail addresses for the Internet.
91
92Do not use non-ASCII characters.
93Under RFC 822 and RFC 821,
94these characters cannot be used in mail headers or in SMTP commands.
95In practice, they are regularly corrupted.
96
97Do not use ASCII control characters.
98NUL is regularly corrupted.
99CR and LF cannot be used in some combinations
100and are corrupted in all.
101None of these characters are usable on business cards.
102
103Avoid spaces and the characters
104
105.EX
106 \\"<>()[],;:
107.EE
108
109These all require quoting in mail headers and in SMTP.
110Many existing mail programs do not handle quoting properly.
111
112Do not use @ in a local part.
113@ requires quoting in mail headers and in SMTP.
114Many programs incorrectly look for the first @,
115rather than the last @,
116to find the domain part of an address.
117
118In a local part,
119do not use two consecutive dots, a dot at the beginning, or a dot at the end.
120Any of these would require quoting in mail headers.
121
122Do not use an empty local part; it cannot appear in SMTP commands.
123
124Avoid local parts longer than 64 characters.
125
126Be wary of uppercase letters in local parts.
127Some mail programs (and users!) will incorrectly convert
128.B God@heaven.af.mil
129to
130.BR god@heaven.af.mil .
131
132Be wary of the following characters:
133
134.EX
135 $&!#~`'^*|{}
136.EE
137
138Some users will not know
139how to feed these characters safely to their mail programs.
140
141In domain names, stick to letters, digits, dash, and dot.
142One popular DNS resolver has,
143under the banner of security,
144recently begun destroying domain names
145that contain certain other characters,
146including underscore.
147Exception: A dotted-decimal IP address in brackets,
148such as
149.BR [127.0.0.1] ,
150identifies a domain owned by whoever owns the host at that IP address,
151and can be used safely.
152
153In a domain name,
154do not use two consecutive dots,
155a dot at the beginning,
156or a dot at the end.
157This means that,
158when a domain name is broken down into components separated by dots,
159there are no empty components.
160
161Always use at least one dot in a domain name.
162If you own the
163.B mil
164domain,
165don't bother using the address
166.BR root@mil ;
167most users will be unable to send messages to that address.
168Same for the root domain.
169
170Avoid domain names longer than 64 characters.
171.SH "ENCODED ADDRESSES IN SMTP COMMANDS"
172RFC 821 defines an encoding of mail addresses in SMTP.
173For example, the addresses
174
175.EX
176 God@heaven.af.mil
177.br
178 a"quote@heaven.af.mil
179.br
180 The Almighty.One@heaven.af.mil
181.EE
182
183could be encoded in RCPT commands as
184
185.EX
186 RCPT TO:<God@heaven.af.mil>
187.br
188 RCPT TO:<a\\"quote@heaven.af.mil>
189.br
190 RCPT TO:<The\\ Almighty.One@heaven.af.mil>
191.EE
192
193There are several restrictions in RFC 821
194on the mail addresses that can be used over SMTP.
195Non-ASCII characters are prohibited.
196The local part must not be empty.
197The domain part must be a sequence of elements separated by dots,
198where each element is either a component,
199a sequence of digits preceded by #,
200or a dotted-decimal IP address surrounded by brackets.
201The only allowable characters in components are
202letters, digits, and dashes.
203Every component must (believe it or not)
204have at least three characters;
205the first character must be a letter;
206the last character must not be a hyphen.
207.SH "ENCODED ADDRESSES IN MAIL HEADERS"
208RFC 822 defines an encoding of mail addresses
209in certain header fields in a mail message.
210For example, the addresses
211
212.EX
213 God@heaven.af.mil
214.br
215 a"quote@heaven.af.mil
216.br
217 The Almighty.One@heaven.af.mil
218.EE
219
220could be encoded in a
221.B To
222field as
223
224.EX
225 To: God@heaven.af.mil,
226.br
227 <@brl.mil:"a\\"quote"@heaven.af.mil>,
228.br
229 "The Almighty".One@heaven.af.mil
230.EE
231
232or perhaps
233
234.EX
235 To: < "God"@heaven .af.mil>,
236.br
237 "a\\"quote" (Who?) @ heaven . af. mil
238.br
239 , God<"The Almighty.One"@heaven.af.mil>
240.EE
241
242There are several restrictions on the mail addresses that can
243be used in these header fields.
244Non-ASCII characters are prohibited.
245The domain part must be a sequence of elements separated by dots,
246where each element either (1) begins with [ and ends with ]
247or (2) is a nonempty string of printable ASCII characters
248not including any of
249
250.EX
251 \\".<>()[],;:
252.EE
253
254and not including space.
255.SH "SEE ALSO"
256envelopes(5),
257qmail-header(5),
258qmail-inject(8),
259qmail-remote(8),
260qmail-smtpd(8)