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