RFC 1154

Encoding header field for internet messages

๐Ÿ“… published April 1990, from ietf

RFC 1154: Encoding Header Field for Internet Messages ๐Ÿ’–

Okay bestie, this one is all about the Encoding header field โœจ It's from the Network Working Group, Request for Comments: 1154, written by D. Robinson and R. Ullmann of Prime Computer, Inc. ๐ŸŽ€ It's dated April 1990 ๐Ÿ“…

The category is an elective experimental header field, which the memo says about itself ๐Ÿงช It updates RFC 1049 (Content-Type) ๐Ÿ”„ and it's a suggested update to RFCs 1113, 1114, and 1115 (Privacy Enhancement) ๐Ÿ” Nothing is listed as obsoleted in the title block ๐Ÿซถ


1. Status of the Memo ๐Ÿ“œ

This RFC proposes an elective experimental Encoding header field so you can mail multi-part, multi-structured messages ๐Ÿ’Œ

Using Encoding updates RFC 1049 (Content-Type), and it's a suggested update to RFCs 1113, 1114, and 1115 (Privacy Enhancement) [4,7,8] ๐ŸŒธ

Distribution of this memo is unlimited ๐ŸŒˆ

2. Introduction ๐Ÿฆ‹

RFC 822 [2] says an electronic mail message has two parts: the message header and the message body, separated by an apparently blank line ๐Ÿ’…

The Encoding header field lets the message body get broken up into even more parts, and each part is also separated from the next one by an apparently blank line ๐Ÿ“

So conceptually, a message has a header part, followed by one or more body parts, all separated by blank lines. It's giving organized ๐Ÿงš

Each body part has an encoding type. The default (aka no Encoding field in the header) is a message body that's just one part of type "text" โœจ

3. The Encoding Field ๐ŸŽ€

The Encoding field is one or more subfields, separated by commas. Each subfield matches a part of the message, in the order that part shows up. A subfield is a line count, a keyword that defines the encoding, and optional info that only matters for that specific encoding. The line count is optional in the last subfield ๐Ÿ’–

3.1. Format of the Encoding Field ๐Ÿงฉ

The format of the Encoding field looks like this:

  [<count> <keyword> [<options>], ]* [<count>] <keyword> [<options>]

  where:

     <count>   := a decimal integer
     <keyword> := a single alphanumeric token starting with an alpha
     <options> := keyword-dependent options

3.2. <count> ๐Ÿ”ข

The line count is a decimal number saying how many text lines are in the part. Parts are separated by a blank line, and that blank line doesn't get counted in the part before it or the part after it ๐Ÿ™ˆ Since a count always starts with a digit and a keyword always starts with a letter, you can always tell whether a count is there. (The count goes first because it's the only thing you need when you're skipping over the part โญ๏ธ)

The count is not required on the last or only part โœจ

3.3. <keyword> ๐Ÿท๏ธ

The keyword defines the encoding type. It's a common single-word name for the encoding type ๐Ÿ’… Keywords are not case-sensitive ๐ŸŒธ

The list of standard keywords is meant to match the one used for the Content-Type: header described in [6], and this RFC proposes additions to that list. Implementations can then treat Content-Type as an alias of Encoding, which will always have only one body part ๐Ÿซถ

3.4. <options> ๐Ÿง

Optional info is used to specify extra keyword-specific info needed to interpret the contents of the encoded part. It's any sequence of tokens that doesn't contain a comma ๐Ÿ’ซ

3.5. Encoding Version Numbers ๐Ÿ”–

In general, version numbers for encodings, when they're not actually available inside the encoded information, get handled as options ๐Ÿ”ข

3.6. Comments ๐Ÿ’ฌ

Comments in parentheses can go anywhere in the Encoding field ๐Ÿ’• Mail reading systems may pass the comments on to their clients. Comments must not be used by mail reading systems for content interpretation, because that's the job of options ๐Ÿšซ

4. Encodings ๐ŸŒˆ

This section describes some of the encodings that are defined ๐Ÿ“š

As with the other keyword-defined parts of the header format standard, extensions in the form of new keywords are expected and welcomed ๐Ÿค Several basic principles should be followed when adding encodings:

  • The keyword should be the most common single-word name for the encoding, acronyms included if they fit. The idea is that different implementors are likely to pick the same name for the same encoding ๐Ÿ’ก
  • Keep keywords from being too general. "binary" would have been a bad choice for the "hex" encoding ๐Ÿ™…
  • The encoding should be as free from unnecessary idiosyncrasies as possible, except when it conforms to an existing standard, in which case there's nothing that can be done ๐Ÿคทโ€โ™€๏ธ
  • The encoding should, if possible, use only the 7 bit ASCII printing characters when it's a complete transformation of a source document (e.g., "hex" or "uuencode"). If it's essentially a text format, the full range may be used. If there's an external standard, the character set may already be defined ๐Ÿ” 

Keywords beginning with X- are permanently reserved for implementation-specific use. No standard registered encoding keyword will ever begin with X- ๐Ÿ”’

4.1. Text ๐Ÿ“

This indicates that the message isn't in any particular encoded format, but is to be presented to the user as is โœจ

The full range of the ASCII character set is used. The message is expected to consist of lines of reasonable length (less than 1000 characters) ๐Ÿ“

On some transport services, only the 7 bit subset of ASCII can be used. Where full 8 bit transparency is available, the text is assumed to be ISO 8859-1 [3] (ASCII-8) ๐ŸŒ

4.2. Message ๐Ÿ’Œ

This encoding says the body part is itself in the format of an Internet message, with its own header part and body part(s). A "message" body part's message header may be a full internet message header, or it may consist only of an Encoding field ๐Ÿ“ฆ

Using the message encoding on returned mail makes it practical for a mail reading system to implement a reliable resending function, if the mailer generates it when returning contents. It's also useful in a "copy append" MUA operation ๐Ÿ”

Message encoding is also used when mapping to X.400 to handle recursively included X.400 P2 messages ๐Ÿช†

4.3. Hex ๐Ÿ”ข

This encoding says the body part contains binary data, encoded as 2 hexadecimal digits per byte, highest significant nibble first ๐Ÿ’œ

Lines consist of an even number of hexadecimal digits. Blank lines are not permitted. The decode process must accept lines with between 2 and 1000 characters, inclusive ๐ŸŒธ

4.4. EVFU ๐Ÿ–จ๏ธ

EVFU (Electronic Vertical Format Unit) specifies that each line begins with a one-character "channel selector". The original purpose was to select a channel on a paper tape loop controlling the printer ๐Ÿ“œ

This encoding is sometimes called "FORTRAN" format. It's the default output format of FORTRAN programs on a number of computer systems ๐Ÿงฎ

The legal characters are '0' to '9', '+', '-', and space. These correspond to the 12 rows (and absence of a punch) on a printer control tape, used when the control unit was electromechanical โš™๏ธ

The channels that have generally agreed definitions are:

           1     advances to the first print line on the next page
           0     skip a line, i.e., double-space
           +     over-print the preceeding line
           -     skip 2 lines, i.e., triple-space
        (space)  print on the next line, single-space

4.5. EDI ๐Ÿ’ผ

The EDI (Electronic Document Interchange) keyword says the message or part is a business document, formatted according to ANSI X12 or related standards ๐Ÿข

The first word after the EDI keyword names the particular interchange standard ๐Ÿท๏ธ

A message with a note and 2 X12 purchase orders might have an encoding of:

       Encoding: 17 TEXT, 146 EDI X12, 69 EDI X12

4.6. X.400 ๐Ÿ“จ

The Encoding header field gives you a way to map multi-part messages between CCITT X.400 [1] and RFC 822 ๐Ÿ”€

The X.400 keyword marks a section that's converted from an X.400 body part type the gateway doesn't know, or one that doesn't correspond to a useful internet encoding ๐Ÿง

If the message transits another gateway, or if the receiving user has the appropriate software, it can be decoded and used ๐Ÿ’–

The X.400 keyword is followed by a second token that says which method was used. The simplest form is X.400 HEX, with the complete X.409 encoding of the body part in hexadecimal. More compact is X.400 3/4, which uses the 3-byte to 4-character encoding specified in RFC 1113, section 4.3.2.4 โœจ

4.7. uuencode ๐Ÿš

The uuencode keyword marks a section that consists of the output of the uuencode program supplied as part of uucp ๐Ÿ“ฆ

4.8. encrypted ๐Ÿ”

The encrypted keyword says the section is encrypted with the methods in RFC 1115 [8]. This replaces the possible use of RFC 934 [5] encapsulation ๐Ÿ›ก๏ธ


References ๐Ÿ“š

[1] International Telegraph and Telephone Consultative Committee, "Data Communication Networks: Message Handling Systems", In CCITT Recommendations X.400 to X.430, VIIIth Plenary Assembly, Malaga-Torremolinos, 1984, Fascicle VIII.7 ("Red Book").

[2] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", RFC 822, University of Delaware, August 1982.

[3] International Organization for Standardization, "Information processing - 8-bit single-byte coded graphic character sets - Part 1: Latin alphabet No. 1", ISO 8859-1, ISO, 1987.

[4] Linn, J., "Privacy Enhancement for Internet Electronic Mail: Part I -- Message Encipherment and Authentication Procedures", RFC 1113, IAB Privacy Task Force, August 1989.

[5] Rose, M., and E. Stefferud, "Proposed Standard for Message Encapsulation", RFC 943, University of Delaware and NMA, January 1985.

[6] Sirbu, M., "Content-type Header Field for Internet Messages", RFC 1049, CMU, March 1988.

[7] Kent, S., and J. Linn, "Privacy Enhancement for Internet Electronic Mail: Part II -- Certificate-Based Key Management", RFC 1114, IAB Privacy Task Force, August 1989.

[8] Linn, J., "Privacy Enhancement for Internet Electronic Mail: Part III -- Algorithms, Modes, and Identifiers", RFC 1115, IAB Privacy Task Force, August 1989.


Security Considerations ๐Ÿ”’

Security issues are not addressed in this memo. Not even a little ๐Ÿ’€

Authors' Addresses ๐Ÿงš

David Robinson 10-30 Prime Computer, Inc. 500 Old Connecticut Path Framingham, MA 01701 Phone: +1 508 879 2960 x1774 Email: DRB@Relay.Prime.COM

Robert Ullmann 10-30 Prime Computer, Inc. 500 Old Connecticut Path Framingham, MA 01701 Phone: +1 508 879 2960 x1736 Email: Ariel@Relay.Prime.COM

๐Ÿ“ฆ where this page comes from