File: addrgrammar.txt

package info (click to toggle)
ruby-rubymail 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,188 kB
  • ctags: 1,109
  • sloc: ruby: 6,061; makefile: 7
file content (113 lines) | stat: -rw-r--r-- 3,780 bytes parent folder | download | duplicates (8)
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
110
111
112
113
Primarily concerned about mailbox, mailbox-list, and address-list

    mailbox - sender, resent-sender

    mailbox-list - from, resent-from

    address-list - reply-to, to, cc, bcc, resent-to, resent-cc, resent-bcc

----------------------------------------------------------------------
Tokens
----------------------------------------------------------------------

Primitive -- these do not appear in Address Spedifications
----------------------------------------------------------------------

NO-WS-CTL       =       %d1-8 /         ; US-ASCII control characters
                        %d11 /          ;  that do not include the
                        %d12 /          ;  carriage return, line feed,
                        %d14-31 /       ;  and white space characters
                        %d127

atext           =       a-z / A-Z / ; Any character except controls,
			0-9 /
                        "!" / "#" /     ;  SP, and specials.
                        "$" / "%" /     ;  Used for atoms
                        "&" / "'" /
                        "*" / "+" /
                        "-" / "/" /
                        "=" / "?" /
                        "^" / "_" /
                        "`" / "{" /
                        "|" / "}" /
                        "~"

quoted-pair     =       "\" (%d0-127)

qtext           =       NO-WS-CTL /     ; Non white space controls
                        %d33 /          ; The rest of the US-ASCII
                        %d35-91 /       ;  characters not including "\"
                        %d93-126        ;  or the quote character

WSP		=	%d32 / %d09		; SPACE or TAB

ctext           =       NO-WS-CTL /     ; Non white space controls
                        %d33-39 /       ; The rest of the US-ASCII
                        %d42-91 /       ;  characters not including "(",
                        %d93-126        ;  ")", or "\"

comment         =       "(" *([FWS] ccontent) [FWS] ")"

ccontent        =       ctext / quoted-pair / comment

qcontent	=	qtext / quoted-pair

dtext           =       NO-WS-CTL /     ; Non white space controls
                        %d33-90 /       ; The rest of the US-ASCII
                        %d94-126        ;  characters not including "[",
                                        ;  "]", or "\"

Less primitive - these appear in Address Specifications
----------------------------------------------------------------------

FWS		=	1*([CRLF] WSP)

CFWS            =       *([FWS] comment) (([FWS] comment) / FWS)

atom		=	[CFWS] 1*atext [CFWS]

quoted-string   =       [CFWS]
                        " *([FWS] qcontent) [FWS] "
                        [CFWS]

phrase		=       word *(word / "." / CFWS)

word            =       atom / quoted-string

dcontent        =       dtext / quoted-pair

----------------------------------------------------------------------
Address Specification
----------------------------------------------------------------------

address-list    =       1*([address] [CFWS] "," [CFWS]) [address]

address         =       mailbox / group

mailbox		=	name-addr / addr-spec

group           =       display-name ":" [mailbox-list / CFWS] ";"
                        [CFWS]

mailbox-list   =        1*([mailbox] [CFWS] "," [CFWS]) [mailbox]

name-addr	=	[display-name] angle-addr

display-name	=	phrase

angle-addr	=	[CFWS] "<" [obs-route] addr-spec ">" [CFWS]

obs-route       =       [CFWS] obs-domain-list ":" [CFWS]

obs-domain-list =       "@" domain *(*(CFWS / "," ) [CFWS] "@" domain)

domain          =       domain-literal / obs-domain

domain-literal  =       [CFWS] "[" *([FWS] dcontent) [FWS] "]" [CFWS]

obs-domain      =       atom *("." atom)

addr-spec       =       local-part "@" domain

local-part      =       word *("." word)