1 Overview Multipurpose Internet Mail Extensions (MIME) The MIME utility is a standalone, user-mode, nonprivileged utility that provides MIME interpretation and composition editing. Messages in the VMSMAIL MAIL files can be extracted into text files and then be read and interpreted using MIME. MIME formatted text files can be composed using MIME, and then sent using VMSMAIL to OpenVMS and other systems that have a MIME utility or MIME capable MAIL application. 2 _Getting_Started The MIME utility is a tool for reading MIME-formatted messages that are delivered in VMSMAIL messages. SMTP/MIME based mail systems, such as the TCP/IP Services for OpenVMS mail system, deposit incoming MIME-formatted messages into the VMSMAIL message store. To read and extract binary attachments in such messages, use VMSMAIL to extract the message into a text file; then run the MIME utility to interpret its contents. This approach would allow MIME to be easily backported and used on previous versions of OpenVMS, without changing the existing VMSMAIL environment. 3 Invoking_MIME A foreign symbol is used to invoke MIME, for example, $ MIME :== $SYS$SYSTEM:MIME.EXE Note that a file name can be provided as a parameter to MIME, but MIME opens that file for READ access only. No file modifications will be allowed. See Composing_Messages for more information. 2 Composing_Messages MIME provides basic composition commands that allow you to create a text file in MIME compliant format: NEW, OPEN/DRAFT, ADD, EDIT. Use the NEW command, which runs the editor specified in the VMSMAIL user profile, or specify the editor to use to create a text message. You are prompted for a filename if one is not specified. MIME> NEW [/edit="edit/teco"] [filename] Or you can use the OPEN/DRAFT command to continue editing a previous MIME message that was composed and saved. MIME> OPEN/DRAFT [filename] Then use the ADD and REMOVE commands to add attachments (or parts) to the message or to remove them. Attachments are such as binary image files, sound files, and compound documents, and also text. MIME> ADD filename /CONTENT_TYPE="image/gif" /ENCODING=base64 MIME> REMOVE n Where "n" is the attachment number. Use the LIST command to list attachments and their characteristics. Use the EDIT command to edit the text attachment. MIME> EDIT n [/EDIT="edit/tpu"] Where "n" is the attachment number. Use the LIST command to list attachments and their characteristics. The editor can be specified with the /EDIT qualifier or /NOEDIT to avoid the edit session. Lastly, execute the SAVE command to write the composed outgoing MIME text file. MIME> SAVE Note that the MIME command SHOW FILE_TYPES lists the file types and their default settings for the ADD command. Other optional 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_Attachments A message is opened for read access in one of the following ways: $ MIME filename.xxx MIME> OPEN filename.xxx MIME decodes the attachments (or parts) of the MIME encoded mail message when opened, storing them as temporary files in your defined MAIL directory. If the file is opened with the OPEN command, MIME automatically lists the attachments of the MIME encoded mail message. You can also list the attachments and their characteristics (content-type/subtype, encoding scheme, file name ...) with the following command: MIME> LIST Attachments, such as binary .JPG images, documents, spreadsheet files, audio, DECsound, and text attachments, can be extracted into their native file format using the following MIME command: MIME> EXTRACT /ATTACHMENT=n [filename] Where "n" is the attachment number listed with the MIME LIST command. In a single part message, no attachment number is displayed. For this case specify attachment number one. The filename is optional, unless MIME cannot determine the file name from the attachment information. In that case, MIME will prompt you for a file name. The attachment is stored as a file in the default directory. See HELP EXTRACT for more information. 2 Mailing_MIME_Messages Whenever OpenVMS MAIL is used to send a MIME encoded file, if the address in not a TCP/IP mail address, MAIL will add an extra blank line between it's mail headers and the message. This is standard for OpenVMS MAIL to separate its mail headers from the message. Consequently, this blank line may pose a problem to most MIME capable applications because it separates the MIME headers as well. However, if a TCP/IP mail address is used, the TCP/IP for OpenVMS SMTP service will send the MIME encoded mail with the properly formatted (RFC822) mail message and MIME headers. A blank line will properly separate the mail/MIME headers from the message body. An alternative is to use the DCL command line to send the mail, (e.g.): $ MAIL/NOSELF MimeFile.TXT smtp%"user@domain.com" /subject="Sending MIME" Note that using SMTP for MIME mail requires TCP/IP Services for OpenVMS 5.0A + an SMTP patch or a later version. There are other problems with SMTP HEADER position that can affect MIME mail, please see Restrictions section for further information. 3 Restrictions 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 the reader. Unfortunately, this makes it impossible for MIME 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 this feature so that SMTP headers appear in their original position at the beginning of the message. For TCP/IP Services for OpenVMS, you can disable this feature using the command: SET CONFIGURATION SMTP/OPTIONS=TOP The MIME utility does not fully integrate with the VMSMAIL user interface to send MIME messages over the internet. You can use VMSMAIL to send MIME messages created and saved with the MIME utility. Those messages can then be interpreted using MIME at the destination OpenVMS host or with a MIME capable reader on another system platform. As of TCP/IP Services for OpenVMS version V5.0A, a known problem exists where an extra NEWLINE character corrupts the MIME message sent with SMTP. MIME messages sent with TCP/IP V5.0A and prior may not be interpreted correctly by MIME programs other than the OpenVMS MIME Utility. This problem was corrected in later versions of TCP/IP Services for OpenVMS or with a patch to V5.0A. SFF could be used as an alternative on systems prior to TCPIP V5.0A and the SMTP Patch. $ r TCPIP$SYSTEM:TCPIP$SMTP_SFF.EXE Usage: SMTP_SFF infile_name [-log logfile_name] [-loglevel log_level] infile_name : Name of text input file containing SMTP mail to send. logfile_name : Name of text log file to log diagnostics to. (Default SYS$OUTPUT). log_level : Debug log level. 1 or 0 at this time. (Default 0) See the TCP/IP Service release notes and documentation for more information. 2 MIME_Procedures_and_BATCH MIME will work properly with command procedures and in BATCH mode provided the following guidelines are utilized. When a foreign symbol is used to invoke MIME, for example, $ MIME :== $SYS$SYSTEM:MIME.EXE a file name can be provided as a parameter to MIME. But, MIME will OPEN that file for READ access only. No file modifications will be allowed. The NEW command creates a MIME message and by default, opens a text editor for editing or composing that MIME message. MIME invokes the editor defined in the user's MAIL profile by the MAIL SET EDIT command. The /[NO]EDIT="edit/teco" qualifier allows manipulating this default behavior. Use NEW/NOEDIT to disable starting the editor. Use /EDIT="edit/edt" to override the editor specified by the MAIL profile. Please see the NEW and EDIT command for more information. An alternative is the OPEN/DRAFT command. This allows modifying a previously processed MIME text file that was saved with MIME and includes the MIME headers. This file can be blank or contain text and possibly originated with the NEW command. Now other attachments (or message parts) can be added to the basic MIME message structure with ADD command. 2 Viewing_Messages MIME operates as a standalone utility to interpret MIME-formatted messages received by VMSMAIL. Use the VMSMAIL command EXTRACT/NOHEADER to extract a MIME-formatted message received by VMSMAIL into a text file. MAIL> EXTRACT/NOHEADER filename A message is opened for read access in one of the following ways: $ MIME filename.xxx MIME> OPEN filename.xxx The OPEN command opens and decodes the message file, in preparation for file viewing. Use the MIME READ command to display the file. MIME> READ 3 Notes_on_Content-types Not all attachments (content-type/subtypes, such as .DOC and .XLS), can be displayed with the OpenVMS MIME utility. OpenVMS MIME displays only the attachments that have been defined and have a native OpenVMS viewer application installed and associated with that defined content-type/subtype. Example OpenVMS native viewer applications include NETSCAPE to display .HTML and .HTM attachments, and Freeware X-VIEW application to display image types .JPG, .GIF, and .JPEG subtypes. Also note that foreign commands must be defined for invoking these native viewer application images. This is so OpenVMS MIME can pass a filename (string) representing the attachment to the viewer application, for example: NETSCAPE :== $ SYS$MANAGER:NETSCAPE-EXPORT-ALPHA-V303C4R-JAVA-GOLD.EXE XV == "$ SYS$LIBRARY:XV.EXE" Content-types/subtypes are defined internally by OpenVMS MIME and in optional MIME$MAILCAP.DAT files. The MIME command SHOW CONTENT lists the content types of files that can be displayed with the READ command. Other optional types are defined in MIME$MAILCAP.DAT file. MIME> SHOW CONTENT_TYPE See the READ command and SHOW CONTENT MIME$MAILCAP.DAT command for more information and its security implications.