活动目录名称中关于RFC 822中地址的定义

放在这里多少有些牵强, 不过微软的活动目录标准名称格式中遵守RFC 822, 所以我专门看了一下RFC 822的内容, 并将下面的内容贴出来, 帮助大家了解活动目录中使用RFC 822的邮件地址  

如果你看到下面内容没有对齐, 那么请复制到文本编辑器, 并使用等宽字体进行查看.

   2.  NOTATIONAL CONVENTIONS

          This specification uses an augmented Backus-Naur Form  (BNF)
     notation.  The differences from standard BNF involve naming rules
     and indicating repetition and "local" alternatives.

     2.1.  RULE NAMING

          Angle brackets ("<", ">") are not  used,  in  general.   The
     name  of  a rule is simply the name itself, rather than "<name>".
     Quotation-marks enclose literal text (which may be  upper  and/or
     lower  case).   Certain  basic  rules  are  in uppercase, such as
     SPACE, TAB, CRLF, DIGIT, ALPHA, etc.  Angle brackets are used  in
     rule  definitions,  and  in  the rest of this  document, whenever
     their presence will facilitate discerning the use of rule names.

     2.2.  RULE1 / RULE2:  ALTERNATIVES

          Elements separated by slash ("/") are alternatives.   There-
     fore "foo / bar" will accept foo or bar.

     2.3.  (RULE1 RULE2):  LOCAL ALTERNATIVES

          Elements enclosed in parentheses are  treated  as  a  single
     element.   Thus,  "(elem  (foo  /  bar)  elem)"  allows the token
     sequences "elem foo elem" and "elem bar elem".

     2.4.  *RULE:  REPETITION

          The character "*" preceding an element indicates repetition.
     The full form is:

                              <l>*<m>element

     indicating at least <l> and at most <m> occurrences  of  element.
     Default values are 0 and infinity so that "*(element)" allows any
     number, including zero; "1*element" requires at  least  one;  and
     "1*2element" allows one or two.

     2.5.  [RULE]:  OPTIONAL

          Square brackets enclose optional elements; "[foo  bar]"   is
     equivalent to "*1(foo bar)".

     2.6.  NRULE:  SPECIFIC REPETITION

          "<n>(element)" is equivalent to "<n>*<n>(element)"; that is,
     exactly  <n>  occurrences  of (element). Thus 2DIGIT is a 2-digit
     number, and 3ALPHA is a string of three alphabetic characters.

     August 13, 1982               - 3 -                      RFC #822

     Standard for ARPA Internet Text Messages

     2.7.  #RULE:  LISTS

          A construct "#" is defined, similar to "*", as follows:

                              <l>#<m>element

     indicating at least <l> and at most <m> elements, each  separated
     by  one  or more commas (","). This makes the usual form of lists
     very easy; a rule such as '(element *("," element))' can be shown
     as  "1#element".   Wherever this construct is used, null elements
     are allowed, but do not  contribute  to  the  count  of  elements
     present.   That  is,  "(element),,(element)"  is  permitted,  but
     counts as only two elements.  Therefore, where at least one  ele-
     ment  is required, at least one non-null element must be present.
     Default values are 0 and infinity so that "#(element)" allows any
     number,  including  zero;  "1#element" requires at least one; and
     "1#2element" allows one or two.

     2.8.  ; COMMENTS

          A semi-colon, set off some distance to  the  right  of  rule
     text,  starts  a comment that continues to the end of line.  This
     is a simple way of including useful notes in  parallel  with  the
     specifications.

上面主要是介绍RFC 822中定义文法使用结构, 如果有形式语言, 词法分析, 语法分析相关知识的人读起来可能会更简单, 不过都不是太难的东西. 下面是一些名称上涉及的定义:

    phrase      =  1*word                                 ; Sequence of words
    word        =  atom / quoted-string
    atom        =  1*<any CHAR except specials, SPACE and CTLs>
    quoted-string = <"> *(qtext/quoted-pair) <">; Regular qtext or
                                                          ;   quoted chars.
    qtext       =  <any CHAR excepting <">,               ; => may be folded
                   "/" & CR, and including
                   linear-white-space>
    quoted-pair =  "/" CHAR                               ; may quote any char
    CHAR        =  <any ASCII character>                  ; (  0-177,  0.-127.)
    CTL         =  <any ASCII control                     ; (  0- 37,  0.- 31.)
                   character and DEL>                     ; (    177,     127.)
    CR          =  <ASCII CR, carriage return>            ; (     15,      13.)
    LF          =  <ASCII LF, linefeed>                   ; (     12,      10.)
    SPACE       =  <ASCII SP, space>                      ; (     40,      32.)
    HTAB        =  <ASCII HT, horizontal-tab>             ; (     11,       9.)
    <">         =  <ASCII quote mark>                     ; (     42,      34.)
    CRLF        =  CR LF
    linear-white-space =  1*([CRLF] LWSP-char)  ; semantics = SPACE
                                             ; CRLF => folding

     6.  ADDRESS SPECIFICATION

     6.1.  SYNTAX

     address     =  mailbox                      ; one addressee
                 /  group                        ; named list

     group       =  phrase ":" [#mailbox] ";"

     mailbox     =  addr-spec                    ; simple address
                 /  phrase route-addr            ; name & addr-spec

     route-addr  =  "<" [route] addr-spec ">"

     route       =  1#("@" domain) ":"           ; path-relative

     addr-spec   =  local-part "@" domain        ; global address

     local-part  =  word *("." word)             ; uninterpreted
                                                 ; case-preserved

     domain      =  sub-domain *("." sub-domain)

     sub-domain  =  domain-ref / domain-literal

     domain-ref  =  atom                         ; symbolic reference

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值