Skip to main content

Chapter 3 -- Basic Mappings

Chapter 3 -- Basic Mappings

   3.1.  Notation

      The P1 and P2 protocols are encoded in a structured manner
      according to the X.409 specifications, whereas RFC 822 is text
      encoded.  To define a detailed mapping, it is necessary to refer
      to detailed protocol elements in each format.  This is described.

      3.1.4.  RFC 822

         Structured text is defined according to the Extended Backus
         Naur Form (EBNF) defined in section 2 of RFC 822 [Crocker82a].
         In the EBNF definitions used in this specification, the syntax
         rules given in Appendix D of RFC 822 are assumed.  When these
         EBNF tokens are referred to outside an EBNF definition, they
         are identified by the string "882." appended to the beginning
         of the string (e.g. 822.addr-spec).  Additional syntax rules,
         to be used throughout this specification are defined in this
         chapter.

         The EBNF is used in two ways.

            1.   To describe components of RFC 822 messages (or of
                 822-P1 components).  In this case, the lexical analysis
                 defined in section 3 of RFC 822 should be used.  When
                 these new EBNF tokens are referred to outside an EBNF
                 definition, they are identified by the string "EBNF."
                 appended to the beginning of the string (e.g.
                 EBNF.bilateral-info).

            2.   To describe the structure of IA5 or ASCII information
                 not in an RFC 822 message.  In these cases, tokens will
                 either be self delimiting, or be delimited by self
                 delimiting tokens.  Comments and LWSP are not used as
                 delimiters.

      3.1.5.  X.409

         An element is referred to with the following syntax, defined in
         EBNF:

            element        = protocol "." definition *( "." definition )
            protocol       = "P1" / "P2"
            definition     = identifier / context
            identifier     = ALPHA *< ALPHA or DIGIT or "-" >
            context        = "[" 1*DIGIT "]"

         For example, P2.Heading.subject defines the subject element of
         the P2 heading.  The same syntax is also used to refer to
         element values. For example,
         P1.EncodedInformationTypes.[0].g3Fax refers to a value of
         P1.EncodedInformationTypes.[0] .

   3.2.  ASCII and IA5

      A gateway will interpret all IA5 as ASCII.  Thus, they are treated
      identically for the rest of this document.

   3.3.  Universal Primitives

      There is a need to convert between ASCII text, and some of the
      Universal Primitive types defined in X.409 [CCITT84d].  For each
      case, an EBNF syntax definition is given, for use in all of this
      specification.  All EBNF syntax definitions of Universal
      Primitives are in lower case, whereas X.409 primitives are
      referred to with the first letter in upper case.  Except as noted,
      all mappings are symmetrical.

      3.3.1.  Boolean

         Boolean is encoded as:

            boolean = "TRUE" / "FALSE"

      3.3.2.  NumericString

         NumericString is encoded as:

            numericstring = *DIGIT

      3.3.3.  PrintableString

         PrintableString is a restricted IA5String defined as:

            printablestring  = *( ps-char / ps-delim )

            ps-char          = 1DIGIT /  1ALPHA / " " / "'" / "+" / ")"
                               / "," / "-" / "." / "/" / ":" / "=" / "?"

            ps-delim         = "("

         A structured subset of EBNF.printablestring is now defined.
         This can be used to encode ASCII in the PrintableString
         character set.

            ps-encoded       = *( ps-char / ps-encoded-char )

            ps-encoded-char  =   "(a)"               ; (@)
                               / "(p)"               ; (%)
                               / "(b)"               ; (!)
                               / "(q)"               ; (")
                               / "(u)"               ; (_)
                               / "(" 3DIGIT ")"

         The 822.3DIGIT in EBNF.ps-encoded-char must have range 0-127
         (Decimal), and is interpreted in decimal as the corresponding
         ASCII character. Special encodings are given for: at sign (@),
         percent (%), exclamation mark/bang (!), double quote ("), and
         underscore (_).  These characters are not included in
         PrintableString, but are common in RFC 822 addresses.  The
         abbreviations will ease specification of RFC 822 addresses from
         an X.400 system.

         An asymmetric mapping between PrintableString and ASCII can now
         be defined <3>.  To encode ASCII as PrintableString, the
         EBNF.ps-encoded syntax is used, with all EBNF.ps-char AND
         EBNF.ps-delim mapped directly <4>.  All other 822.CHAR are
         encoded as EBNF.ps-encoded-char. There are two cases of
         encoding PrintableString as ASCII.  If the PrintableString can
         be parsed as EBNF.ps-encoded, then the previous mapping should
         be reversed.  If not, it should be interpreted as
         EBNF.printablestring.

         Some examples are now given.  Note the arrows which indicate
         asymmetrical mappings:

            PrintableString           ASCII

            'a demo.'         <->   'a demo.'
            foo(a)bar         <->   foo@bar

            (q)(u)(p)(q)      <->   "_%"
            (a)               <->   @
            (a)               <-    (a)
            (040)a(041)       ->    (a)
            (040)(a)          ->    (@
            ((a)              <-    (@

         The algorithm is designed so that it is simple to use in all
         common cases, so that it is general, and so that it is
         straightforward to code.  It is not attempting to minimise the
         number of pathological cases.

      3.3.4.  T.61String

         T.61 strings are, in general, only used for conveying human
         interpreted information.  Thus, the aim of a mapping should be
         to render the characters appropriately in the remote character
         set, rather than to maximise reversibility.  The mappings
         defined in the CEN/CENELEC X.400 functional standard should be
         used [CEN/CENELEC/85a].  These are based on the mappings of
         X.408 (sections 4.2.2 and 5.2.2).

      3.3.5.  UTCTime

         Both UTCTime and the RFC 822 822.date-time syntax contain: Year
         (lowest two digits), Month, Day of Month, hour, minute, second
         (optional), and Timezone.  822.date-time also contains an
         optional day of the week, but this is redundant.  Therefore a
         symmetrical mapping can be made between these constructs <5>.
         The UTCTime format which specifies the timezone offset should
         be used, in line with CEN/CENELEC recommendations.