ただのメモ(RFC2822)

あくまでも自分用。機械的に賢く抽出したわけではなくてエディタで手作業で抜いてるので、作業ミスしてる可能性は否定できないです。あしからず。(自分用なのでこれでいい。)

RFC2822の定義のみ抜粋
  1 NO-WS-CTL       =       %d1-8 /         ; US-ASCII control characters
  2                         %d11 /          ;  that do not include the
  3                         %d12 /          ;  carriage return, line feed,
  4                         %d14-31 /       ;  and white space characters
  5                         %d127
  6 
  7 text            =       %d1-9 /         ; Characters excluding CR and LF
  8                         %d11 /
  9                         %d12 /
 10                         %d14-127 /
 11                         obs-text
 12 
 13 specials        =       "(" / ")" /     ; Special characters used in
 14                         "<" / ">" /     ;  other parts of the syntax
 15                         "[" / "]" /
 16                         ":" / ";" /
 17                         "@" / "\" /
 18                         "," / "." /
 19                         DQUOTE
 20 
 21 quoted-pair     =       ("\" text) / obs-qp
 22 
 23 FWS             =       ([*WSP CRLF] 1*WSP) /   ; Folding white space
 24                         obs-FWS
 25 
 26 ctext           =       NO-WS-CTL /     ; Non white space controls
 27 
 28                         %d33-39 /       ; The rest of the US-ASCII
 29                         %d42-91 /       ;  characters not including "(",
 30                         %d93-126        ;  ")", or "\"
 31 
 32 ccontent        =       ctext / quoted-pair / comment
 33 
 34 comment         =       "(" *([FWS] ccontent) [FWS] ")"
 35 
 36 CFWS            =       *([FWS] comment) (([FWS] comment) / FWS)
 37 
 38 atext           =       ALPHA / DIGIT / ; Any character except controls,
 39                         "!" / "#" /     ;  SP, and specials.
 40                         "$" / "%" /     ;  Used for atoms
 41                         "&" / "'" /
 42                         "*" / "+" /
 43                         "-" / "/" /
 44                         "=" / "?" /
 45                         "^" / "_" /
 46                         "`" / "{" /
 47                         "|" / "}" /
 48                         "~"
 49 
 50 atom            =       [CFWS] 1*atext [CFWS]
 51 
 52 dot-atom        =       [CFWS] dot-atom-text [CFWS]
 53 
 54 dot-atom-text   =       1*atext *("." 1*atext)
 55 
 56 qtext           =       NO-WS-CTL /     ; Non white space controls
 57 
 58                         %d33 /          ; The rest of the US-ASCII
 59                         %d35-91 /       ;  characters not including "\"
 60                         %d93-126        ;  or the quote character
 61 
 62 qcontent        =       qtext / quoted-pair
 63 
 64 quoted-string   =       [CFWS]
 65                         DQUOTE *([FWS] qcontent) [FWS] DQUOTE
 66                         [CFWS]
 67 
 68 word            =       atom / quoted-string
 69 
 70 phrase          =       1*word / obs-phrase
 71 
 72 utext           =       NO-WS-CTL /     ; Non white space controls
 73                         %d33-126 /      ; The rest of US-ASCII
 74                         obs-utext
 75 
 76 unstructured    =       *([FWS] utext) [FWS]
 77 
 78 date-time       =       [ day-of-week "," ] date FWS time [CFWS]
 79 
 80 day-of-week     =       ([FWS] day-name) / obs-day-of-week
 81 
 82 day-name        =       "Mon" / "Tue" / "Wed" / "Thu" /
 83                         "Fri" / "Sat" / "Sun"
 84 
 85 date            =       day month year
 86 
 87 year            =       4*DIGIT / obs-year
 88 
 89 month           =       (FWS month-name FWS) / obs-month
 90 
 91 month-name      =       "Jan" / "Feb" / "Mar" / "Apr" /
 92                         "May" / "Jun" / "Jul" / "Aug" /
 93                         "Sep" / "Oct" / "Nov" / "Dec"
 94 
 95 day             =       ([FWS] 1*2DIGIT) / obs-day
 96 
 97 time            =       time-of-day FWS zone
 98 
 99 time-of-day     =       hour ":" minute [ ":" second ]
100 
101 hour            =       2DIGIT / obs-hour
102 
103 minute          =       2DIGIT / obs-minute
104 
105 second          =       2DIGIT / obs-second
106 
107 zone            =       (( "+" / "-" ) 4DIGIT) / obs-zone
108 
109 address         =       mailbox / group
110 
111 mailbox         =       name-addr / addr-spec
112 
113 name-addr       =       [display-name] angle-addr
114 
115 angle-addr      =       [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
116 
117 group           =       display-name ":" [mailbox-list / CFWS] ";"
118                         [CFWS]
119 
120 display-name    =       phrase
121 
122 mailbox-list    =       (mailbox *("," mailbox)) / obs-mbox-list
123 
124 address-list    =       (address *("," address)) / obs-addr-list
125 
126 addr-spec       =       local-part "@" domain
127 
128 local-part      =       dot-atom / quoted-string / obs-local-part
129 
130 domain          =       dot-atom / domain-literal / obs-domain
131 
132 domain-literal  =       [CFWS] "[" *([FWS] dcontent) [FWS] "]" [CFWS]
133 
134 dcontent        =       dtext / quoted-pair
135 
136 dtext           =       NO-WS-CTL /     ; Non white space controls
137 
138                         %d33-90 /       ; The rest of the US-ASCII
139                         %d94-126        ;  characters not including "[",
140                                         ;  "]", or "\"
141 
142 message         =       (fields / obs-fields)
143                         [CRLF body]
144 
145 body            =       *(*998text CRLF) *998text
146 
147 fields          =       *(trace
148                           *(resent-date /
149                            resent-from /
150                            resent-sender /
151                            resent-to /
152                            resent-cc /
153                            resent-bcc /
154                            resent-msg-id))
155                         *(orig-date /
156                         from /
157                         sender /
158                         reply-to /
159                         to /
160                         cc /
161                         bcc /
162                         message-id /
163                         in-reply-to /
164                         references /
165                         subject /
166                         comments /
167                         keywords /
168                         optional-field)
169 
170 orig-date       =       "Date:" date-time CRLF
171 
172 from            =       "From:" mailbox-list CRLF
173 
174 sender          =       "Sender:" mailbox CRLF
175 
176 reply-to        =       "Reply-To:" address-list CRLF
177 
178 to              =       "To:" address-list CRLF
179 
180 cc              =       "Cc:" address-list CRLF
181 
182 bcc             =       "Bcc:" (address-list / [CFWS]) CRLF
183 
184 message-id      =       "Message-ID:" msg-id CRLF
185 
186 in-reply-to     =       "In-Reply-To:" 1*msg-id CRLF
187 
188 references      =       "References:" 1*msg-id CRLF
189 
190 msg-id          =       [CFWS] "<" id-left "@" id-right ">" [CFWS]
191 
192 id-left         =       dot-atom-text / no-fold-quote / obs-id-left
193 
194 id-right        =       dot-atom-text / no-fold-literal / obs-id-right
195 
196 no-fold-quote   =       DQUOTE *(qtext / quoted-pair) DQUOTE
197 no-fold-literal =       "[" *(dtext / quoted-pair) "]"
198 
199 subject         =       "Subject:" unstructured CRLF
200 
201 comments        =       "Comments:" unstructured CRLF
202 
203 keywords        =       "Keywords:" phrase *("," phrase) CRLF
204 
205 resent-date     =       "Resent-Date:" date-time CRLF
206 
207 resent-from     =       "Resent-From:" mailbox-list CRLF
208 
209 resent-sender   =       "Resent-Sender:" mailbox CRLF
210 
211 resent-to       =       "Resent-To:" address-list CRLF
212 
213 resent-cc       =       "Resent-Cc:" address-list CRLF
214 
215 resent-bcc      =       "Resent-Bcc:" (address-list / [CFWS]) CRLF
216 
217 resent-msg-id   =       "Resent-Message-ID:" msg-id CRLF
218 
219 trace           =       [return]
220                         1*received
221 
222 return          =       "Return-Path:" path CRLF
223 
224 path            =       ([CFWS] "<" ([CFWS] / addr-spec) ">" [CFWS]) /
225                         obs-path
226 
227 received        =       "Received:" name-val-list ";" date-time CRLF
228 
229 name-val-list   =       [CFWS] [name-val-pair *(CFWS name-val-pair)]
230 
231 name-val-pair   =       item-name CFWS item-value
232 
233 item-name       =       ALPHA *(["-"] (ALPHA / DIGIT))
234 
235 item-value      =       1*angle-addr / addr-spec /
236                          atom / domain / msg-id
237 
238 optional-field  =       field-name ":" unstructured CRLF
239 
240 field-name      =       1*ftext
241 
242 ftext           =       %d33-57 /               ; Any character except
243                         %d59-126                ;  controls, SP, and
244                                                 ;  ":".
245 
246 obs-qp          =       "\" (%d0-127)
247 
248 obs-text        =       *LF *CR *(obs-char *LF *CR)
249 obs-char        =       %d0-9 / %d11 /          ; %d0-127 except CR and
250                         %d12 / %d14-127         ;  LF
251 
252 obs-utext       =       obs-text
253 
254 obs-phrase      =       word *(word / "." / CFWS)
255 
256 obs-phrase-list =       phrase / 1*([phrase] [CFWS] "," [CFWS]) [phrase]
257 
258 obs-FWS         =       1*WSP *(CRLF 1*WSP)
259 
260 obs-day-of-week =       [CFWS] day-name [CFWS]
261 
262 obs-year        =       [CFWS] 2*DIGIT [CFWS]
263 
264 obs-month       =       CFWS month-name CFWS
265 
266 obs-day         =       [CFWS] 1*2DIGIT [CFWS]
267 
268 obs-hour        =       [CFWS] 2DIGIT [CFWS]
269 
270 obs-minute      =       [CFWS] 2DIGIT [CFWS]
271 
272 obs-second      =       [CFWS] 2DIGIT [CFWS]
273 
274 obs-zone        =       "UT" / "GMT" /          ; Universal Time
275                                                 ; North American UT
276                                                 ; offsets
277                         "EST" / "EDT" /         ; Eastern:  - 5/ - 4
278                         "CST" / "CDT" /         ; Central:  - 6/ - 5
279                         "MST" / "MDT" /         ; Mountain: - 7/ - 6
280                         "PST" / "PDT" /         ; Pacific:  - 8/ - 7
281 
282                         %d65-73 /               ; Military zones - "A"
283                         %d75-90 /               ; through "I" and "K"
284                         %d97-105 /              ; through "Z", both
285                         %d107-122               ; upper and lower case
286 
287 obs-angle-addr  =       [CFWS] "<" [obs-route] addr-spec ">" [CFWS]
288 
289 obs-route       =       [CFWS] obs-domain-list ":" [CFWS]
290 
291 obs-domain-list =       "@" domain *(*(CFWS / "," ) [CFWS] "@" domain)
292 
293 obs-local-part  =       word *("." word)
294 
295 obs-domain      =       atom *("." atom)
296 
297 obs-mbox-list   =       1*([mailbox] [CFWS] "," [CFWS]) [mailbox]
298 
299 obs-addr-list   =       1*([address] [CFWS] "," [CFWS]) [address]
300 
301 obs-fields      =       *(obs-return /
302                         obs-received /
303                         obs-orig-date /
304                         obs-from /
305                         obs-sender /
306                         obs-reply-to /
307                         obs-to /
308                         obs-cc /
309                         obs-bcc /
310                         obs-message-id /
311                         obs-in-reply-to /
312                         obs-references /
313                         obs-subject /
314                         obs-comments /
315                         obs-keywords /
316                         obs-resent-date /
317                         obs-resent-from /
318                         obs-resent-send /
319                         obs-resent-rply /
320                         obs-resent-to /
321                         obs-resent-cc /
322                         obs-resent-bcc /
323                         obs-resent-mid /
324                         obs-optional)
325 
326 obs-orig-date   =       "Date" *WSP ":" date-time CRLF
327 
328 obs-from        =       "From" *WSP ":" mailbox-list CRLF
329 
330 obs-sender      =       "Sender" *WSP ":" mailbox CRLF
331 
332 obs-reply-to    =       "Reply-To" *WSP ":" mailbox-list CRLF
333 
334 obs-to          =       "To" *WSP ":" address-list CRLF
335 
336 obs-cc          =       "Cc" *WSP ":" address-list CRLF
337 
338 obs-bcc         =       "Bcc" *WSP ":" (address-list / [CFWS]) CRLF
339 
340 obs-message-id  =       "Message-ID" *WSP ":" msg-id CRLF
341 
342 obs-in-reply-to =       "In-Reply-To" *WSP ":" *(phrase / msg-id) CRLF
343 
344 obs-references  =       "References" *WSP ":" *(phrase / msg-id) CRLF
345 
346 obs-id-left     =       local-part
347 
348 obs-id-right    =       domain
349 
350 obs-subject     =       "Subject" *WSP ":" unstructured CRLF
351 
352 obs-comments    =       "Comments" *WSP ":" unstructured CRLF
353 
354 obs-keywords    =       "Keywords" *WSP ":" obs-phrase-list CRLF
355 
356 obs-resent-from =       "Resent-From" *WSP ":" mailbox-list CRLF
357 
358 obs-resent-send =       "Resent-Sender" *WSP ":" mailbox CRLF
359 
360 obs-resent-date =       "Resent-Date" *WSP ":" date-time CRLF
361 
362 obs-resent-to   =       "Resent-To" *WSP ":" address-list CRLF
363 
364 obs-resent-cc   =       "Resent-Cc" *WSP ":" address-list CRLF
365 
366 obs-resent-bcc  =       "Resent-Bcc" *WSP ":"
367                          (address-list / [CFWS]) CRLF
368 
369 obs-resent-mid  =       "Resent-Message-ID" *WSP ":" msg-id CRLF
370 
371 obs-resent-rply =       "Resent-Reply-To" *WSP ":" address-list CRLF
372 
373 obs-return      =       "Return-Path" *WSP ":" path CRLF
374 
375 obs-received    =       "Received" *WSP ":" name-val-list CRLF
376 
377 obs-path        =       obs-angle-addr
378 
379 obs-optional    =       field-name *WSP ":" unstructured CRLF