home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / ONLINE / OS2LYN_1 / OS2LYN_1.ZIP / docs / RFC-MAILCAP.txt < prev   
Text File  |  1994-03-23  |  32KB  |  742 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.             Network Working Group               N. Borenstein, Bellcore
  8.             Internet Draft                                  March, 1993
  9.  
  10.                         A User Agent Configuration Mechanism
  11.  
  12.                        For Multimedia Mail Format Information
  13.  
  14.  
  15.           Status of This Memo
  16.  
  17.             This  RFC  specifies  an  informational  protocol  for   the
  18.             Internet  community, and requests discussion and suggestions
  19.             for improvements.  Distribution of this memo is unlimited.
  20.  
  21.           Abstract
  22.  
  23.             This memo suggests a  file  format  to  be  used  to  inform
  24.             multiple   mail   reading  user  agent  programs  about  the
  25.             locally-installed facilities for handling  mail  in  various
  26.             formats.  The  mechanism is explicitly designed to work with
  27.             mail systems based Internet mail as defined  by  RFC's  821,
  28.             822,  934,  1049,  1113,  and the Multipurpose Internet Mail
  29.             Extensions, known as MIME.  However, with some extensions it
  30.             could  probably be made to work for X.400-based mail systems
  31.             as well.  The format and mechanism are proposed in a  manner
  32.             that  is  generally  operating-system independent.  However,
  33.             certain  implementation  details  will  inevitably   reflect
  34.             operating  system differences, some of which will have to be
  35.             handled in a uniform manner for each operating system.  This
  36.             memo  makes  such  situations explicit, and, in an appendix,
  37.             suggests  a  standard  behavior  under  the  UNIX  operating
  38.             system.
  39.  
  40.           Introduction
  41.  
  42.             The electronic mail world is in the midst  of  a  transition
  43.             from  single-part  text-only mail to multi-part, multi-media
  44.             mail.  In support of this transition, various extensions  to
  45.             RFC  821  and  RFC  822  have  been proposed and/or adopted,
  46.             notably including  MIME  [RFC-1341].  Various  parties  have
  47.             demonstrated  extremely  high-functionality multimedia mail,
  48.             but the problem of mail interchange between  different  user
  49.             agents has been severe.  In general, only text messages have
  50.             been shared between user agents  that  were  not  explicitly
  51.             designed   to   work   together.   This  limitation  is  not
  52.             compatible with a smooth transition to  a  multi-media  mail
  53.  
  54.  
  55.  
  56.             Borenstein         DRAFT - expires 8/1/93           [Page 1]
  57.  
  58.  
  59.  
  60.  
  61.             MAILCAP        Multimedia Mail Configuration      March 1993
  62.  
  63.  
  64.             world.
  65.  
  66.             One approach to this transition is to modify diverse sets of
  67.             mail  reading user agents so that, when they need to display
  68.             mail of an  unfamiliar  (non-text)  type,  they  consult  an
  69.             external  file  for information on how to display that file.
  70.             That file might say, for example, that if  the  content-type
  71.             of  a  message  is "foo" it can be displayed to the user via
  72.             the "displayfoo" program.
  73.  
  74.             This approach means that, with a  one-time  modification,  a
  75.             wide  variety  of  mail  reading  programs  can be given the
  76.             ability to display a  wide  variety  of  types  of  message.
  77.             Moreover,  extending  the  set of media types supported at a
  78.             site becomes a simple matter  of  installing  a  binary  and
  79.             adding  a  single  line to a configuration file.  Crucial to
  80.             this scheme, however, is that all of the user  agents  agree
  81.             on  a common representation and source for the configuration
  82.             file.  This memo proposes such a common representation.
  83.  
  84.           Location of Configuration Information
  85.  
  86.             Each  user  agent  must  clearly  obtain  the  configuration
  87.             information  from a common location, if the same information
  88.             is to be  used  to  configure  all  user  agents.   However,
  89.             individual  users  should  be  able to override or augment a
  90.             site's configuration.  The configuration information  should
  91.             therefore  be  obtained  from a designated set of locations.
  92.             The overall  configuration  will  be  obtained  through  the
  93.             virtual  concatenation  of  several individual configuration
  94.             files known as mailcap files.  The configuration information
  95.             will  be obtained from the FIRST matching entry in a mailcap
  96.             file, where "matching" depends on both a  matching  content-
  97.             type   specification,   an   entry   containing   sufficient
  98.             information for the purposes of the  application  doing  the
  99.             searching, and the success of any test in the "test=" field,
  100.             if present.
  101.  
  102.             The precise location of  the  mailcap  files  is  operating-
  103.             system dependent.  A standard location for UNIX is specified
  104.             in Appendix A.
  105.  
  106.           Overall Format of a Mailcap File
  107.  
  108.             Each mailcap file consists of a set of entries that describe
  109.             the  proper  handling  of  one media type at the local site.
  110.  
  111.  
  112.  
  113.             Borenstein         DRAFT - expires 8/1/93           [Page 2]
  114.  
  115.  
  116.  
  117.  
  118.             MAILCAP        Multimedia Mail Configuration      March 1993
  119.  
  120.  
  121.             For example, one line might tell how to display a message in
  122.             Group III fax format.  A mailcap file consists of a sequence
  123.             of such individual entries, separated by newlines (according
  124.             to  the operating system's newline conventions). Blank lines
  125.             and lines that start with the "#" character (ASCII  35)  are
  126.             considered  comments,  and are ignored.  Long entries may be
  127.             continued on multiple lines if each non-terminal  line  ends
  128.             with  a  backslash  character ('\', ASCII 92), in which case
  129.             the multiple lines are to be treated  as  a  single  mailcap
  130.             entry.   Note that for such "continued" lines, the backslash
  131.             must be the last character on the line to be continued.
  132.  
  133.             Thus the overall format of a mailcap file is given,  in  the
  134.             modified BNF of RFC 822, as:
  135.  
  136.                  Mailcap-File = *Mailcap-Line
  137.  
  138.                  Mailcap-Line = Comment / Mailcap-Entry
  139.  
  140.                  Comment = NEWLINE  /  "#" *CHAR NEWLINE
  141.  
  142.                  NEWLINE = <newline as defined by OS convention>
  143.  
  144.             Note that the above specification implies that comments must
  145.             appear  on  lines all to themselves, with a "#" character as
  146.             the first character on each comment line.
  147.  
  148.           Format of a Mailcap Entry
  149.  
  150.             Each mailcap entry consists of a number of fields, separated
  151.             by semi-colons.  The first two fields are required, and must
  152.             occur in the specified  order.   The  remaining  fields  are
  153.             optional, and may appear in any order.
  154.  
  155.             The first field is the  content-type,  which  indicates  the
  156.             type of data this mailcap entry describes how to handle.  It
  157.             is to be matched against the type/subtype  specification  in
  158.             the "Content-Type" header field of an Internet mail message.
  159.             If the subtype is specified as "*", it is intended to  match
  160.             all subtypes of the named content-type.
  161.  
  162.             The second field, view-command, is a  specification  of  how
  163.             the  message  or  body part can be viewed at the local site.
  164.             Although the syntax of this field is  fully  specified,  the
  165.             semantics  of  program  execution  are  necessarily somewhat
  166.             operating system dependent.  UNIX  semantics  are  given  in
  167.  
  168.  
  169.  
  170.             Borenstein         DRAFT - expires 8/1/93           [Page 3]
  171.  
  172.  
  173.  
  174.  
  175.             MAILCAP        Multimedia Mail Configuration      March 1993
  176.  
  177.  
  178.             Appendix A.
  179.  
  180.             The optional fields, which may be given in any order, are as
  181.             follows:
  182.  
  183.             -- The "compose" field may be used to specify a program that
  184.             can  be used to compose a new body or body part in the given
  185.             format.  Its intended  use  is  to  support  mail  composing
  186.             agents  that  support  the  composition of multiple types of
  187.             mail using external composing  agents.  As  with  the  view-
  188.             command,  the  semantics  of program execution are operating
  189.             system dependent, with UNIX semantics specified in  Appendix
  190.             A.   The result of the composing program may be data that is
  191.             not yet suitable for mail transport -- that is,  a  Content-
  192.             Transfer-Encoding may need to be applied to the data.
  193.  
  194.             -- The "composetyped" field  is  similar  to  the  "compose"
  195.             field, but is to be used when the composing program needs to
  196.             specify the Content-type header field to be applied  to  the
  197.             composed  data.   The  "compose"  field  is  simpler, and is
  198.             preferred for use with existing (non-mail-oriented) programs
  199.             for  composing  data  in a given format.  The "composetyped"
  200.             field is necessary when the  Content-type  information  must
  201.             include  auxilliary  parameters, and the composition program
  202.             must then know enough about mail formats to  produce  output
  203.             that includes the mail type information.
  204.  
  205.             -- The "edit" field may be used to specify  a  program  that
  206.             can be used to edit a body or body part in the given format.
  207.             In many cases,  it  may  be  identical  in  content  to  the
  208.             "compose"  field,  and shares the operating-system dependent
  209.             semantics for program execution.
  210.  
  211.             -- The "print" field may be used to specify a  program  that
  212.             can  be  used  to  print a message or body part in the given
  213.             format.  As with the view-command, the semantics of  program
  214.             execution   are   operating   system  dependent,  with  UNIX
  215.             semantics specified in Appendix A.
  216.  
  217.             -- The "test" field  may  be  used  to  test  some  external
  218.             condition  (e.g.  the  machine  architecture,  or the window
  219.             system in use) to determine whether or not the mailcap  line
  220.             applies.   It  specifies  a  program  to be run to test some
  221.             condition.  The semantics of  execution  and  of  the  value
  222.             returned by the test program are operating system dependent,
  223.             with UNIX semantics specified in Appendix A.   If  the  test
  224.  
  225.  
  226.  
  227.             Borenstein         DRAFT - expires 8/1/93           [Page 4]
  228.  
  229.  
  230.  
  231.  
  232.             MAILCAP        Multimedia Mail Configuration      March 1993
  233.  
  234.  
  235.             fails,   a   subsequent  mailcap  entry  should  be  sought.
  236.             Multiple test fields are not permitted -- since a  test  can
  237.             call a program, it can already be arbitrarily complex.
  238.  
  239.             -- The "needsterminal" field indicates that the view-command
  240.             must  be  run on an interactive terminal.  This is needed to
  241.             inform  window-oriented  user  agents  that  an  interactive
  242.             terminal  is  needed.  (The decision is not left exclusively
  243.             to the view-command because in some circumstances it may not
  244.             be  possible  for  such programs to tell whether or not they
  245.             are on interactive terminals.)   The  needsterminal  command
  246.             should be assumed to apply to the compose and edit commands,
  247.             too, if they exist.  Note that this is NOT a test -- it is a
  248.             requirement for the environment in which the program will be
  249.             executed, and should  typically  cause  the  creation  of  a
  250.             terminal  window when not executed on either a real terminal
  251.             or a terminal window.
  252.  
  253.             -- The "copiousoutput" field indicates that the output  from
  254.             the  view-command  will be an extended stream of output, and
  255.             is to be interpreted as advice to the UA (User  Agent  mail-
  256.             reading  program)  that the output should be either paged or
  257.             made scrollable. Note that  it  is  probably  a  mistake  if
  258.             needsterminal and copiousoutput are both specified.
  259.  
  260.             --  The  "description"  field  simply  provides  a   textual
  261.             description,  optionally  quoted, that describes the type of
  262.             data, to be used optionally by mail  readers  that  wish  to
  263.             describe the data before offering to display it.
  264.  
  265.             -- The "textualnewlines"  field,  if  set  to  any  non-zero
  266.             value, indicates that this type of data is line-oriented and
  267.             that, if encoded in base64, all newlines should be converted
  268.             to  canonical  form  (CRLF)  before encoding, and will be in
  269.             that form after decoding.  In general, this field is  needed
  270.             only  if there is line-oriented data of some type other than
  271.             text/* or non-line-oriented data that is a subtype of text.
  272.  
  273.             -- The "x11-bitmap" field names a file, in X11 bitmap  (xbm)
  274.             format,  which  points  to an appropriate icon to be used to
  275.             visually denote the presence of this kind of data.
  276.  
  277.             -- The "nametemplate" field gives a  file  name  format,  in
  278.             which  %s  will be replaced by a short unique string to give
  279.             the name of the temporary file to be passed to  the  viewing
  280.             command.    This   is   only  expected  to  be  relevant  in
  281.  
  282.  
  283.  
  284.             Borenstein         DRAFT - expires 8/1/93           [Page 5]
  285.  
  286.  
  287.  
  288.  
  289.             MAILCAP        Multimedia Mail Configuration      March 1993
  290.  
  291.  
  292.             environments where filename extensions are meaningful,  e.g.
  293.             one  coulld  specify  that  a GIF file being passed to a gif
  294.             viewer  should  have  a  name  eding  in  ".gif"  by   using
  295.             "nametemplate=%s.gif".
  296.  
  297.             -- Any other fields beginning with "x-" may be included  for
  298.             local   or   mailer-specific   extensions  of  this  format.
  299.             Implementations should simply ignore all  such  unrecognized
  300.             fields  to  permit  such  extensions, some of which might be
  301.             standardized in a future version of this document.
  302.  
  303.             Some of the fields above, such as "needsterminal", apply  to
  304.             the  actions of the view-command, edit-command, and compose-
  305.             command, alike.  In some unusual  cases,  this  may  not  be
  306.             desirable,  but  differentiation  can  be  accomplished  via
  307.             separate mailcap entries, taking advantage of the fact  that
  308.             subsequent  mailcap  entries  are  searched  if  an  earlier
  309.             mailcap entry does not provide enough information:
  310.  
  311.                  application/postscript; ps-to-terminal %s; \
  312.                      needsterminal
  313.                  application/postscript; ps-to-terminal %s; \
  314.                      compose=idraw %s
  315.  
  316.             In RFC 822 modified BNF, the following grammar  describes  a
  317.             mailcap entry:
  318.  
  319.                  Mailcap-Entry = typefield ; view-command
  320.                                      [";" 1#field]
  321.  
  322.                  typefield = propertype / implicit-wild
  323.  
  324.                  propertype = type "/" wildsubtype
  325.  
  326.                  implicitwild = type
  327.  
  328.                  wildsubtype = subtype / "*"
  329.  
  330.                  view-command = mtext
  331.  
  332.                  mtext = *mchar
  333.  
  334.                  mchar = schar / qchar
  335.  
  336.                  schar = * <any CHAR except
  337.  
  338.  
  339.  
  340.  
  341.             Borenstein         DRAFT - expires 8/1/93           [Page 6]
  342.  
  343.  
  344.  
  345.  
  346.             MAILCAP        Multimedia Mail Configuration      March 1993
  347.  
  348.  
  349.                             ";", "\", and CTLS>
  350.  
  351.                  qchar = "\" CHAR ; may quote any char
  352.  
  353.                  field = flag / namedfield
  354.  
  355.                  namedfield = fieldname "=" mtext
  356.  
  357.                  flag = "needsterminal"   ; All these literals are to
  358.                       / "copiousoutput"   ; be interpreted as
  359.                       / x-token           ; case-insensitive
  360.  
  361.                  fieldname =    / "compose"      ;Also all of these
  362.                                 / "composetyped" ;are case-insensitive.
  363.                                 / "print"
  364.                                 / "edit"
  365.                                 / "test"
  366.                                 / "x11-bitmap"
  367.                                 / "textualnewlines"
  368.                                 / "description"
  369.                                 / x-token
  370.  
  371.             Note that  "type",  "subtype", and "x-token" are defined  in
  372.             MIME.   Note  also  that  while  the  definition  of "schar"
  373.             includes the percent sign, "%", this character has a special
  374.             meaning  in  at least the UNIX semantics, and will therefore
  375.             need to be quoted as a qchar to be used literally.
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.             Borenstein         DRAFT - expires 8/1/93           [Page 7]
  399.  
  400.  
  401.  
  402.  
  403.             MAILCAP        Multimedia Mail Configuration      March 1993
  404.  
  405.  
  406.           Appendix A:  Implementation Details for UNIX
  407.  
  408.             Although this memo fully specifies a  syntax  for  "mailcap"
  409.             files,  the  semantics  of the mailcap file are of necessity
  410.             operating-system dependent in four respects.   In  order  to
  411.             clarify  the  intent,  and to promote a standard usage, this
  412.             appendix proposes a UNIX semantics for these four cases.  If
  413.             a  mailcap  mechanism  is  implemented  on non-UNIX systems,
  414.             similar semantic decisions should be made and published.
  415.  
  416.             Location of the Mailcap File(s)
  417.  
  418.             For UNIX, a path search of mailcap files is specified.   The
  419.             default  path  search is specified as including at least the
  420.             following:
  421.  
  422.             $HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
  423.  
  424.             However,  this  path  may  itself  be  overridden  by a path
  425.             specified by the MAILCAPS environment variable.
  426.  
  427.             Semantics of executable commands
  428.  
  429.             Several portions of a mailcap entry specify commands  to  be
  430.             executed.   In  particular,  the mandatory second field, the
  431.             view-command, takes a command to  be  executed,  as  do  the
  432.             optional print, edit, test, and compose fields.
  433.  
  434.             On a UNIX system, such commands will each be  a  full  shell
  435.             command  line, including the path name for a program and its
  436.             arguments.   (Because  of  differences  in  shells  and  the
  437.             implementation  and  behavior  of  the  same  shell from one
  438.             system to another, it is specified that the command line  be
  439.             intended  as  input  to  the  Bourne  shell, i.e. that it is
  440.             implicitly preceded by "/bin/sh -c " on the command line.)
  441.  
  442.             The two characters "%s", if used, will be  replaced  by  the
  443.             name  of  a file for the actual mail body data.  In the case
  444.             of the edit adn view-command, the body part will  be  passed
  445.             to  this  command  as  standard  input  unless  one  or more
  446.             instances of "%s" appear in the view-command, in which  case
  447.             %s  will  be  replaced  by the name of a file containing the
  448.             body part, a file which may have to be  created  before  the
  449.             view-command  program  is  executed.  (Such  files cannot be
  450.             presumed to continue to exist after the view-command program
  451.             exits.  Thus a view-command that wishes to exit and continue
  452.  
  453.  
  454.  
  455.             Borenstein         DRAFT - expires 8/1/93           [Page 8]
  456.  
  457.  
  458.  
  459.  
  460.             MAILCAP        Multimedia Mail Configuration      March 1993
  461.  
  462.  
  463.             processing in the background should take care  to  save  the
  464.             data  first.)   In  the case of the compose and composetyped
  465.             commands, %s should be replaced by the name  of  a  file  to
  466.             which  the  composed  data should be written by the programs
  467.             named in the compose or composedtyped commands.   Thus,  the
  468.             calling  program  will  look  in that file later in order to
  469.             retrieve the composed data. If %s does  not  appear  in  the
  470.             compose  or  composetyped  commands,  then the composed data
  471.             will be assumed to be written by the composing  programs  to
  472.             standard output.
  473.  
  474.             Furthermore, any occurrence of "%t" will be replaced by  the
  475.             content-type  and  subtype  specification.  (That is, if the
  476.             content-type is "text/plain", then %t will  be  replaced  by
  477.             "text/plain".)   A  literal % character may be quoted as \%.
  478.             Finally, named parameters from the Content-type field may be
  479.             placed  in the command execution line using "%{" followed by
  480.             the parameter name and a closing "}" character.  The  entire
  481.             parameter  should  appear as a single command line argument,
  482.             regardless of embedded spaces.  Thus, if the message  has  a
  483.             Content-type line of:
  484.  
  485.                  Content-type:  multipart/mixed; boundary=42
  486.  
  487.             and the mailcap file has a line of:
  488.  
  489.                  multipart/*; /usr/local/bin/showmulti \
  490.                    %t %{boundary}
  491.  
  492.             then the equivalent  of  the  following  command  should  be
  493.             executed:
  494.  
  495.                  /usr/local/bin/showmulti multipart/mixed 42
  496.  
  497.             If the content-type is "multipart" (any subtype),  then  the
  498.             two  characters  "%n"  will be replaced by an integer giving
  499.             the number of sub-parts within the multipart  entity.  Also,
  500.             the  two  characters  "%F"  will  be  replaced  by  a set of
  501.             arguments, twice as many arguments as  the  number  of  sub-
  502.             parts,  consisting  of  alternating  content-types  and file
  503.             names for each part in turn.  Thus if  multipart entity  has
  504.             three  parts,  "%F"  will  be  replaced by the equivalent of
  505.             "content-type1 file-name1 content-type2 file-name2  content-
  506.             type3 file-name3".
  507.  
  508.  
  509.  
  510.  
  511.  
  512.             Borenstein         DRAFT - expires 8/1/93           [Page 9]
  513.  
  514.  
  515.  
  516.  
  517.             MAILCAP        Multimedia Mail Configuration      March 1993
  518.  
  519.  
  520.             Semantics of the "test" field
  521.  
  522.             The "test" field specifies a program  to  be  used  to  test
  523.             whether  or  not the current mailcap line applies.  This can
  524.             be used, for example, to  have  a  mailcap  line  that  only
  525.             applies if the X window system is running, or if the user is
  526.             running on a SPARCstation with a /dev/audio.  The  value  of
  527.             the  "test"  field  is  a  program  to  run  to  test such a
  528.             condition.  The precise program to run and arguments to give
  529.             it are determined as specified in the previous section.  The
  530.             test program should return an  exit  code  of  zero  if  the
  531.             condition is true, and a non-zero code otherwise.
  532.  
  533.             Semantics of the "compose" field
  534.  
  535.             On UNIX, the composing program is expected to produce a data
  536.             stream  for  such  a  body part as its standard output.  The
  537.             program will be executed with  the  command  line  arguments
  538.             determined  as  specified  above.  The data returned via its
  539.             standard output will be given a Content-Type field that  has
  540.             no  supplementary  parameters.   For  example, the following
  541.             mailcap entry:
  542.  
  543.                  audio/basic; /usr/local/bin/showaudio %t
  544.                   compose = /usr/local/bin/recordaudio
  545.  
  546.             would  result  in  tagging  the   data   composed   by   the
  547.             "recordaudio" program as:
  548.  
  549.                  Content-Type: audio/basic
  550.  
  551.             If this is unacceptable --  for  example,  in  the  case  of
  552.             multipart  mail  a  "boundary" parameter is required -- then
  553.             the  "compose"  field  cannot   be   used.    Instead,   the
  554.             "composetyped" field should be used in the mailcap file.
  555.  
  556.             Semantics of the "composetyped" field
  557.  
  558.             The "composetyped" filed is much like the  "compose"  field,
  559.             except  that  it  names a composition program that produces,
  560.             not raw data, but data that includes a MIME-conformant  type
  561.             specification.   The  program  will  be  executed  with  the
  562.             command line arguments determined as specified  above.   The
  563.             data  returned  via  its  standard  output must begin with a
  564.             Content-Type header, followed optionally by other  Content-*
  565.             headers,  and  then  by  a  blank  line  and  the data.  For
  566.  
  567.  
  568.  
  569.             Borenstein         DRAFT - expires 8/1/93          [Page 10]
  570.  
  571.  
  572.  
  573.  
  574.             MAILCAP        Multimedia Mail Configuration      March 1993
  575.  
  576.  
  577.             example, the following mailcap entry:
  578.  
  579.                  multipart/mixed; /usr/local/bin/showmulti %t \
  580.                    %{boundary}; \
  581.                    composetyped = /usr/local/bin/makemulti
  582.  
  583.             would result in executing  the  "makemulti"  program,  which
  584.             would  be  expected  to  begin its output with a line of the
  585.             form:
  586.  
  587.                  Content-Type: multipart/mixed; boundary=foobar
  588.  
  589.             Note that a composition program need not encode binary  data
  590.             in base64 or quoted-printable. It remains the responsibility
  591.             of the software calling the composition  program  to  encode
  592.             such  data  as  necessary.   However, if a composing program
  593.             does  encode  data,  which  is  not  encouraged,  it  should
  594.             announce  that fact using a Content-Transfer-Encoding header
  595.             in the  standard  manner  defined  by  MIME.   Because  such
  596.             encodings  must  be  announced by such a header, they are an
  597.             option only  for  composetyped  programs,  not  for  compose
  598.             programs.
  599.  
  600.           Appendix B: Sample Mailcap File
  601.  
  602.             The following is an example of a mailcap file for UNIX  that
  603.             demonstrates  most  of  the  syntax  above.     It  contains
  604.             explanatory comments where necessary.
  605.  
  606.                  # Mailcap file for Bellcore lab 214.
  607.                  #
  608.                  # The next line sends "richtext" to the richtext
  609.                  program
  610.                  text/richtext; richtext %s; copiousoutput
  611.                  #
  612.                  # Next, basic u-law audio
  613.                  audio/*; showaudio; test=/usr/local/bin/hasaudio
  614.                  #
  615.                  # Next, use the xview program to handle several image
  616.                  formats
  617.                  image/*; xview %s; test=/usr/local/bin/RunningX
  618.                  #
  619.                  # The ATOMICMAIL interpreter uses curses, so needs a
  620.                  terminal
  621.  
  622.  
  623.  
  624.  
  625.  
  626.             Borenstein         DRAFT - expires 8/1/93          [Page 11]
  627.  
  628.  
  629.  
  630.  
  631.             MAILCAP        Multimedia Mail Configuration      March 1993
  632.  
  633.  
  634.                  application/atomicmail; /usr/local/bin/atomicmail %s; \
  635.                      needsterminal
  636.                  #
  637.                  # The next line handles Andrew format,
  638.                  #   if ez and ezview are installed
  639.                  x-be2; /usr/andrew/bin/ezview %s; \
  640.                     print=/usr/andrew/bin/ezprint %s ; \
  641.                     compose=/usr/andrew/bin/ez -d %s \;
  642.                     edit=/usr/andrew/bin/ez -d %s; \;
  643.                     copiousoutput
  644.                  #
  645.                  # The next silly example demonstrates the use of
  646.                  quoting
  647.                  application/*; echo "This is \\"%t\\" but \
  648.                     is 50 \% Greek to me" \; cat %s; copiousoutput
  649.  
  650.  
  651.           Appendix C:  A Note on Format Translation
  652.  
  653.             It has been suggested that another function  of  a  mailcap-
  654.             like  mechanism  might  be  to specify the locally available
  655.             tools for document format translation.    For  example,  the
  656.             file could designate a program for translating from format A
  657.             to format B, another for translating from format B to format
  658.             C,   and  finally  a  mechanism  for  displaying  format  C.
  659.             Although this mechanism would be somewhat  richer  than  the
  660.             current  mailcap  file,  and  might  conceivably  also  have
  661.             utility at the message  transport  layer,  it  significantly
  662.             complicates the processing effort necessary for a user agent
  663.             that simply wants to display a message in format  A.   Using
  664.             the  current,  simpler,  mailcap scheme, a single line could
  665.             tell such a user agent to  display  A-format  mail  using  a
  666.             pipeline  of translators and the C-format viewer.  This memo
  667.             resists  the  temptation   to   complicate   the   necessary
  668.             processing  for a user agent to accomplish this task.  Using
  669.             the mailcap format defined here, it  is  only  necessary  to
  670.             find  the  correct  single  line  in  a mailcap file, and to
  671.             execute the command given in that line.
  672.  
  673.           References
  674.  
  675.             [RFC 822]  Crocker, D.,  "Standard for the  format  of  ARPA
  676.             Internet   text  messages", RFC  822,  UDEL, August, 1982.
  677.  
  678.             [RFC  1341]   Borenstein,   N.,   and   N.   Freed,    "MIME
  679.             (Multipurpose  Internet  Mail  Extensions):  Mechanisms  for
  680.  
  681.  
  682.  
  683.             Borenstein         DRAFT - expires 8/1/93          [Page 12]
  684.  
  685.  
  686.  
  687.  
  688.             MAILCAP        Multimedia Mail Configuration      March 1993
  689.  
  690.  
  691.             Specifying and Describing the  Format  of  Internet  Message
  692.             Bodies", RFC 1341, Bellcore, June, 1992.
  693.  
  694.           Acknowledgements
  695.  
  696.             The author  wishes  to  thank  Malcolm  Bjorn  Gillies,  Dan
  697.             Heller,  Olle  Jaernefors, Keith Moore, Luc Rooijakkers, and
  698.             the other members of the IETF task force on mail  extensions
  699.             for  their comments on earlier versions of this draft.    If
  700.             other acknowledgements were neglected, please let  me  know,
  701.             as it was surely accidental.
  702.  
  703.           Security Considerations
  704.  
  705.             Security issues are not  discussed in this memo.    However,
  706.             the  use  of  the mechanisms described in this memo can make
  707.             it easier for implementations to  slip  into  the   kind  of
  708.             security   problems   discussed   in   the   MIME  document.
  709.             Implementors and mailcap administrators should be  aware  of
  710.             these  security  considerations,  and  in particular  should
  711.             exercise caution in the choice of programs to be listed in a
  712.             mailcap file for  automatic execution.
  713.  
  714.           Author's Address
  715.  
  716.             Nathaniel S. Borenstein
  717.             MRE 2D-296, Bellcore
  718.             445 South St.
  719.             Morristown, NJ 07962-1910
  720.  
  721.             Email: nsb@bellcore.com
  722.             Phone: +1 201 829 4270
  723.             Fax:  +1 201 829 7019
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.             Borenstein         DRAFT - expires 8/1/93          [Page 13]
  741.  
  742.