% Librarian T09-207&+7?+675FADDCLOSEEDITFEXIT4EXTRACTLISTNEWOPENOverview!QUIT!READ"REMOVE#SAVE#SHOW5SPAWN W:+ 1 Overview/ Multipurpose Internet Mail Extensions (MIME)E The MIME utility is a standalone, user-mode, nonprivileged utility> that provides MIME interpretation and composition editing. F Messages in the VMSMAIL MAIL files can be extracted into text filesD and then be read and interpreted using MIME. MIME formatted textC files can be composed using MIME, and then sent using VMSMAIL toE OpenVMS and other systems that have a MIME utility or MIME capable  MAIL application.  2 Composing_MessagesG MIME provides basic composition commands that allow you to create a B text file in MIME compliant format: NEW, OPEN/DRAFT, ADD, EDIT.F Use the NEW command, which runs the editor specified in the VMSMAILA user profile, to create a text message. You are prompted for a$ filename if one is not specified. MIME> NEW [filename]G Or you can use the OPEN/DRAFT command to continue editing a previous, MIME message that was compo sed and saved.# MIME> OPEN/DRAFT [filename]E Then use the ADD and REMOVE commands to add attachments (or parts)C to the message or to remove them. Attachments are such as binaryC image files, sound files, and compound documents, and also text.E MIME> ADD filename /CONTENT_TYPE="image/gif" /ENCODING=base64 MIME> REMOVE nC Where "n" is the attachment number. Use the LIST command to list) attachments and their characteristics.B Lastly, execute the S AVE command to write the composed outgoing MIME text file. MIME> SAVE B Note that the MIME command SHOW FILE_TYPES lists the file typesB and their default settings for the ADD command. Other optionalD file types: the file extension, its Content-Type/subtype, and the= encoding to use, are defined in MIME$FILETYPES.DAT file. : For more help, see the ADD command and SHOW FILE_TYPES  MIME$FILETYPES.DAT command.2 Extracting AttachmentsD A message is opened for read  access in one of the following ways: $ MIME filename.xxx MIME> OPEN filename.xxxC MIME decodes the attachments (or parts) of the MIME encoded mailG message when opened, storing them as temporary files in your defined MAIL directory. H If the file is opened with the OPEN command, MIME automatically listsF the attachments of the MIME encoded mail message. You can also listC the attachments and their characteristics (content-type/subtype,> encoding scheme, file name ...) with the following command: MIME> LISTB Attachments, such as binary .JPG images, documents, spreadsheetF files, audio, DECsound, and text attachments, can be extracted into= their native file format using the following MIME command:' MIME> EXTRACT /ATTACHMENT=n [filename] H Where "n" is the attachment number listed with the MIME LIST command.G The filename is optional, unless MIME cannot determine the file nameF from the attachment information. In that case, MI ME will prompt youE for a file name. The attachment is stored as a file in the default directory.* See HELP EXTRACT for more information. 2 Getting_StartedG The MIME utility is a tool for reading MIME-formatted messages that F are delivered in VMSMAIL messages. SMTP/MIME based mail systems, G such as the Compaq TCP/IP Services for OpenVMS mail system, deposit F incoming MIME-formatted messages into the VMSMAIL message store. @ To read and extract binary attach ments in such messages, use @ VMSMAIL to extract the message into a text file; then run the, MIME utility to interpret its contents. B This approach would allow MIME to be easily backported and usedA on previous versions of OpenVMS, without changing the existing VMSMAIL environment.D On some SMTP/MIME mail systems, the message headers can be moved ? from the beginning of the message, where they would normally? appear, to the end of the message, as a convenience to th e; reader. Unfortunately, this makes it impossible for MIMEC interpreters such as the MIME utility to interpret the contents< of the message. If SMTP messages are reformatted in this= manner, see the system administrator about disabling thisB feature so that SMTP headers appear in their original positionC at the beginning of the message. For Compaq TCP/IP Services for7 OpenVMS, you can disable this feature using the SET * CONFIGURATION SMTP/OPTIONS=TOP command.2 Restrictions= The MIME utility does not fully integrate with the VMSMAILB user interface to send MIME messages over the internet. You canD use VMSMAIL to send MIME messages created and saved with the MIMED utility. Those messages can then be interpreted using MIME at theE destination OpenVMS host or with a MIME capable reader on another  system platform. G However, MIME messages sent with Compaq TCP/IP Services for OpenVMS G may not be interpreted by MIME programs other t han the OpenVMS MIME E Utility. That is unless the version of TCP/IP Services for OpenVMSH is later than V5.0A, or the latest TCP/IP updates have been applied. C As of TCP/IP Services for OpenVMS version V5.0A, a known problemD exists where an extra NEWLINE character corrupts the MIME message@ sent with SMTP. This will be corrected in the next release of TCP/IP Services for OpenVMS.2 Viewing_MessagesF MIME operates as a standalone utility to interpret MIME-formatted J messages received by VMSMAIL. Use the VMSMAIL command EXTRACT/NOHEADER F to extract a MIME-formatted message received by VMSMAIL into a text file. MAIL> EXTRACT/NOHEADER filenameD A message is opened for read access in one of the following ways: $ MIME filename.xxx MIME> OPEN filename.xxxF The OPEN command opens and decodes the message file, in preparation for file viewing.2 Use the MIME READ command to display the file. MIME> READ3 Notes_on_Content -typesF Not all attachments (content-type/subtypes, such as .DOC and .XLS),? can be displayed with the OpenVMS MIME utility. OpenVMS MIMEB displays only the attachments that have been defined and have aB native OpenVMS viewer application installed and associated with% that defined content-type/subtype.A Example OpenVMS native viewer applications include NETSCAPE toF display .HTML and .HTM attachments, and Freeware X-VIEW application9 to display image types .JPG, .GIF, and .JPEG subtypes.E Also note that foreign commands must be defined for invoking theseE native viewer application images. This is so OpenVMS MIME can pass@ a filename (string) representing the attachment to the viewer application, for example:G NETSCAPE :== $ SYS$MANAGER:NETSCAPE-EXPORT-ALPHA-V303C4R-JAVA-GOLD.EXE XV == "$ SYS$LIBRARY:XV.EXE"D Content-types/subtypes are defined internally by OpenVMS MIME and& in optional MIME$MAILCAP.DAT files.B The MIME command SHOW CONTENT lists the content types of files D that can be displayed with the READ command. Other optional types( are defined in MIME$MAILCAP.DAT file. MIME> SHOW CONTENT_TYPEF See the READ command and SHOW CONTENT MIME$MAILCAP.DAT command for 2 more information and its security implications.wwW:+1 ADD Format: ADD filenameE When editing a message draft or new message, this command attachesH the specified file to the current message. MIME mainta ins a list of F known file types associated with various file name extensions; for B example, files that end in ".TXT" are treated as text. Use the B SHOW FILE_TYPES command to display this list of file types. To D override the default file type associated with any file, use one ! of the ADD command qualifiers. 2 /BINARY7 Sets Content-Type to "application/octet-stream" and ; Content-Transfer-Encoding to "Base64". This format can 8 be used to represent an arbitrary binary data stream.2 /CONTENT_TYPE /CONTENT_TYPE="type/subtype"H Overrides the default Content-Type and sets it to the specified type I and subtype (enclosed in quotation marks). See RFC 1700 for a list of H registered media types and subtypes. Examples of types include text, F image, message, application, audio, and so forth. Subtypes specify > the type of content, such as jpg, bmp, gif, html, or plain. 2 /ENCODING /ENCODING_TYPE=encoding-typeE Overrides the defau lt Content-Transfer-Encoding and sets it to theC specified type. Permissible types are: 7Bit, 8Bit, Base64, or  Quoted-Printable.B Experimentation may be necessary to achieve the desired result.A However, it is suggested to use Base64 for most binary files, $ such as JPG and GIF image files. 2 /MESSAGE> Sets Content-Type to "message/rfc822", indicating that the C attachment contains the text of a message to be forwarded as an ? attachment. Content-Transfer-Encoding for the attachment is  set to 7Bit.2 /TEXTH Sets Content-Type to "text/plain" and sets Content-Transfer-Encoding to 7Bit. 2 ExampleE MIME> add /content_type ="image/gif" /encoding=base64 filename.gifC This adds an "IMAGE" attachment with a subtype of "GIF" using anC encoding scheme of "BASE64" for the "filename.gif" file. Use theF SHOW FILE_TYPES command to display the list of file types and their settings. 3 Example MIME> add myfile.txtA This would add the file "myfile.txt" with the default settings: specified by the program and also any found in the fileC MIME$FILETYPES.DAT file. The current default settings for a text@ (.TXT) file are: the content type set to "text/plain;" with aD content type parameter of "charset=ISO-8859-1" and an encoding ofF "7bit/8bit". Use the SHOW FILE_TYPES command to display the list of! file types and their settings.ww <+1 CLOSE Format: CLOSEL Closes the current message, if any. If you have not saved your changes, H the program prompts you to save the message to a file before closing.ww <+1 EDIT, Format: EDIT attachment-number [filename]H Invokes the user's default text editor to edit the specified message  attachment. ww <+1 EXIT Format: EXIT F Terminates the current process. If a draft or new message is open F and has been modified, the program prompts you to save the message to a file before terminating.ww <+ 1 EXTRACT: Format: EXTRACT/ATTACHMENT=attachment-number [filename]= NOTE: The /ATTACHMENT qualifier is required with EXTRACT. < This qualifier specifies the number of the attachment as ! displayed by the LIST command.> EXTRACT extracts the specified attachment to a file in its A native file format or in another format specified by the /FDL B qualifier. By default, the attachment is written to a file in :  the default directory, using the name specified by the A Content-Disposition header of the attachment. If no file name @ is provided, the program prompts for one. A file name can be 9 specified in the command to override the value of the  Content-Disposition header.2 /FDL /FDL=filenameD Specifies a File Descriptor Language (FDL) definition file to useD when converting the specified attachment into an output file. UseC this qualifier when the desired file characterist ics differ thanH those produced by the MIME utility default settings, or are different4 than those specified in the MIME$MAILCAP.DAT fileB Note that the /FDL qualifier will override the default FDL file7 specified in MIME$MAILCAP.DAT file (if one exists). E FDL files can be created with the ANALYZE/RMS/FDL command and also0 created and edited with the EDIT/FDL command.3 Example_to_Create_a_FDLF One way to create a FDL file is from an existing file and type. For exa mpleww <+1 LIST Format: LIST< Displays a list of the components of the current message.ww <+1 NEW Format: NEW [filename]G Creates a new message. If a file is not specified, you are prompted H for a file name. The default text editor will then be invoked to add F the text portion of the message. Use the ADD and REMOVE command to ? add MIME encoded attachments, such as images or sound files.ww <+1 OPEN ! Format: OPEN filenameB Opens the specified ASCII text file containing a MIME-formattedB message. If no qualifier is specified, /READ (read-only) access& is the default message access mode.2 /DRAFTD Specifies that the file is a draft of a message that was composedE previously. This also implies write access to the file, to add or E remove attachments. Draft files do not contain header information * such as To:, From:, Cc:, and so forth. 4 See the NEW command to crea"te a new MIME message.2 /READ@ Specifies that the file is to be opened for read access only.& The default is the /READ qualifier.ww <+1 QUIT Format: QUITG Aborts the MIME editing session without saving the current message. ww <+1 READ Format: READJ Displays the current message as readable text with attachment markers. L Any non-textual attachments (such as JPG images), must be read by helper I viewer applications. Th#e MIME utility will automatically invoke these H viewers, if they are defined in the MIME$MAILCAP.DAT file with their I respective content type and subtype. A SHOW CONTENT_TYPE command will M display the current viewer applications and types defined for the system. C For more information, see SHOW CONTENT MIME$MAILCAP.DAT command.*! REMOVE may change to include /ATTACHMENTww <+1 REMOVE# Format: REMOVE attachment-number= Deletes the specified attachmen$t from the current message.@ Attachments can be removed only from draft or new messages. = Attachments to messages within the current message cannot  be removed.ww <+1 SAVE  Format: SAVED Saves the current message to a file in the default directory. An C informational message indicates if the operation was successful.F If the current message mode is read-only, the file is not saved and! an error message is displayed.ww <+%1 SHOW Format: SHOW optionC Displays information about the MIME environment, depending upon @ what option is specified. Possible options are CONTENT_TYPE,  FILE_TYPES, and VERSION.2 CONTENT_TYPE? Displays a table of message Content-Types/subtypes that MIME: recognizes for viewing with the READ command, and their? associated application viewer to invoke. Other MIME content 7 types and subtypes can be configured in the optional MIME$MAILCAP.DAT file. 3 Ex&amplesMIME> SHOW CONTENT_TYPEKnown Content-types:Content-Type: text/htmlContent-Type: text/plain Edit Command: EDIT/TPUContent-Type: message/rfc822 Content-Type: image/*' View Command: $SYS$SYSTEM:XV.EXE %s CThis example shows there are four "Known Content-types" or types of>MIME messages the MIME utility can read. Three are of the type@"text" and one is of the type "image". Their respective subtypes@are "HTML," "PLAIN" and "RFC822". The fourth type is "image" and 'Cthe wildcard (*) indicates that any subtype of image, (for example,B.JPEG or .GIF), can be displayed on this system using the X-Viewer>application ($SYS$SYSTEM:XV.EXE). See MIME$MAILCAP.DAT and theexamples for more information.3 MIME$MAILCAP.DAT=The Content-Type table defines how an attachment is read, and@optionally, how its output is converted when extracted with the@X-FDL=file option. It is constructed from program built-in typesBand is read from the optional MIME$MAILCAP.DAT c(onfiguration files(if they exist).  SYS$MANAGER:MIME$MAILCAP.DAT SYS$LOGIN:MIME$MAILCAP.DAT3System-wide Content-Types are specified by the file9SYS$MANAGER:MIME$MAILCAP.DAT and can be supplemented with@additional entries found in the SYS$LOGIN:MIME$MAILCAP.DAT file.AThese files are not created by default for customization on a perAsystem/site basis. The MIME$MAILCAP.DAT file follows the general *format of (Request for Comments) RFC 1524. TYPE/SUBTYPE VIEW_COMMANDAThe )Content-Type table is constructed beginning with the built-inCtypes, then adding the system definitions from the system manager's;MIME$MAILCAP.DAT file, and ending with data from the user's.default login directory MIME$MAILCAP.DAT file.?The entries are displayed in order of the most recently definedB(LIFO) entries. In the case of duplicate entries, the first entry Dis used. This allows a user to customize their own environment while?the system manager defines a default system or site envi *ronmentfor all users.DNote that by default, only the minimal ASCII types and subtypes are Edefined. This allows customizing MIME to the system, and for security.reasons, allows a regulated site environment. ?Consider the effect of a malicious user mailing a harmful imageB(.EXE) file that is executed upon being read with the OpenVMS MIMECutility. RFC 2046 lists certain security considerations that shouldDbe noted, such as PostScript files that include PostScript operators?such as "del+etefile" and others that can be used in a maliciousmanner.@For more information, see Example_MIME$MAILCAP.DAT help section.3 Example_MIME$MAILCAP.DAT #?# SYS$MANAGER:MIME$MAILCAP.DAT - system wide definitions#B# SYS$LOGIN:MIME$MAILCAP.DAT - user specific definitions *# # FORMAT: #'# TYPE/SUBTYPE; VIEW_COMMAND; options##7# Netscape handles .HTML, .HTM (and others if you want)# --------------------------,-- # - for URL -:# text/html; netscape -remote "openURL(%s,new-window)"# - for file -.# text/html; netscape -remote openfile(%s)#4text/html; netscape -remote "openURL(%s,new-window)"#$# A continuation line character '\' # text/htm; \ netscape -remote \ "openURL(%s,new-window)"#0# X-View handles images ('*' = wildcard subtype)# ---------------------# image/bmp; xv %simage/*; xv %s## CDA Viewer handles DDIF, PS,# ----------------------------8# appl-ication/ddif; view/select=x_display/FORMAT=ddif %s#2# ! Note: There are security considerations with:# .PS (and .EXE) files - (file access, write...)# Refer to RFC 2046#4# application/ps; view/select=x_display/FORMAT=PS %s#(# X-PDF handles portable document format(# --------------------------------------#<# Note: The following definition specifies extracting a PDF?# subtype file attachment and to CONVERT the output file<# characteristics and. record attributes using the FDL=# PDF_FILE.FDL file. This definition can be overriddenB# with the qualifier /FDL=filename for the EXTRACT command.#+# This can be used with any subtype.#C# application/pdf; XPDF %s; x-fdl=SYS$MANAGER:PDF_FILE.FDL#application/pdf; XPDF %s## # DECsound # --------0audio/x-aud; sound -volume 100 -speaker -play %s## Applications we don't have# --------------------------#application/doc;#application/msword;/#application/xls;#application/msexcel;#application/vnd.ms-excel;#application/ppt;#application/vnd.ms-powerpoint;#A# In-Line Text - No scroll support, allows query by page and quit# ------------!message/rfc822; TYPE/PAGE=SAVE %s##%# Text - Change the default as above# ----text/plain; TYPE/PAGE=SAVE %s 2 FILE_TYPES>Displays the table of file name extensions and the associated AContent-Type and Content-Transfer-Encoding that is employed when Afiles of each type0 are attached to an outgoing message using the ADD command. :Like the CONTENT_TYPE table, the FILE_TYPES are defined by>built-in entries, followed by system-wide entries, followed by?local user-defined entries. File type definitions are found in<the configuration file MIME$FILETYPES.DAT, which is found inBthe SYS$MANAGER: directory and in the user's SYS$LOGIN: directory. 3 ExamplesMIME> sho fileKnown File Types:=Extension: HTML, Content-Type: text/html, Encoding: 7bit/8bit@Th1is example shows "Known File Types" for MIME as defined in theAMIME program, and any others configured in the MIME$FILETYPES.DAT?file. When composing a MIME message, the ADD command uses theseCcorresponding settings when given only the file name and extension,(or file type), for example:MIME> add myfile.htmlBThis would add the file "myfile.html" with the content type set to+"text/html" and an encoding of "7bit/8bit".3 MIME$FILETYPES.DAT@The FILE_TYPES table is constructed from 2 program built-in types 8and is read from the simple comma separated list in the 9MIME$FILETYPES.DAT configuration files, (if they exist). 0System-wide FILE_TYPES are specified by the file;SYS$MANAGER:MIME$FILETYPES.DAT and can be supplemented withBadditional entries found in the SYS$LOGIN:MIME$FILETYPES.DAT file.@The table is constructed beginning with the built-in types, thenBadding the system definitions from SYS$MANAGER:MIME$FILETYPES.DAT,@and ending with data from the SYS$LOGIN:MIME3$FILETYPES.DAT file.?The entries are displayed in order of the most recently definedB(LIFO) entries. In the case of duplicate entries, the first entry Dis used. This allows a user to customize their own environment while?the system manager defines a default system or site environmentfor all users.3 Example_MIME$FILETYPES.DATCThese following file and its two entries define how to add .JPG andD.JPEG files with a "Content-Type" of image/jpg, and an "Encoding" ofBase64.!# MIME Fil4e Type Information File#<# These entries are used when adding MIME attachments.## '#' is a comment delimiter# # Example:#4# File Extension: Content-Type: Encoding:4# --------------- ------------- ---------#1# jpg, image/jpg, Base641# jpeg, image/jpeg, Base64#9# Other examples can be copied from Netscape's MIME.TYPES## # DECsoundaud , audio/x-aud , base64## WAV. wav, 5 audio/x-wav, Base64## JPGjpg, image/jpg, Base64jpeg, image/jpeg, Base64## # CDA Viewerps, application/ps, Base64ddif, application/ddif, Base64## PDFpdf, application/pdf, Base64### For PC applications we don't have## ---------------------------------doc, application/msword, Base64xls, application/xls, Base64ppt, application/ppt, Base64 2 VERSION/ Displays the MIME utility's version number. 3 ExamplesMIME> SHOW VERSION MIME Ver6sion: Vn.nnKThis example displays the major version "n" and minor version ".nn" of the OpenVMS MIME utility.FThe DCL ANALYZE/IMAGE command can also be used to display the identity.and linkage date of the MIME executable image:I$ ANAL/IMA/SEL=(FILE,ARCH,IMAGE_TY,NAM,ID,BUILD,LINK) SYS$SYSTEM:MIME.EXESYS$COMMON:[SYSEXE]MIME.EXE;1Image OpenVMS Alpha Executable"MIME""Vn.nn""PCSI-0060000000"DD-MMM-YYYY 23:17:12.88 ww7?+1 SPAWN Format: SPAWNG Spawns a DCL subprocess. Use the DCL LOGOUT command to return MIME. C The DCL ATTACH command can also be used to temporarily transfer  control between processes. ww