Document revision date: 15 July 2002
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS User's Manual

Previous Contents Index MIME$MAILCAP.DAT File Processing

The format of the MIME$MAILCAP file originated in RFC 1524, A User Agent Configuration Mechanism for Multimedia Mail Format Information, by N. Borenstein, September, 1993. The MIME utility uses instructions in this file to interpret and display messages and attachments. By following these instructions, the MIME user agent calls external programs to display the content types found in MIME messages.

You can customize the MIME$MAILCAP.DAT file to specify a File Descriptor Language (FDL) for a specific content type to extract message parts on your system. Example 7-1 contains an example of a MIME$MAILCAP.DAT file.


References to program names must be logical names or valid file specifications.

Example 7-1 MIME$MAILCAP.DAT File

# Local customizations of content types and processing options 
# Use xv.exe to display images 
image/*; xv %s 
# Use Netscape for html attachments 
text/html; netscape %s 
# MIME$FILETYPES.DAT File Processing

The optional MIME$FILE_TYPES.DAT file contains lists of OpenVMS file extensions and the MIME content type associated with each one. ADD command processing uses the FILETYPE structure to designate the content type of an OpenVMS file to be attached to a composed message.

The syntax of the file format is similar to that of the MIME$MAILCAP.DAT file, with the "#" character indicating comments. Each line in the file contains a single file extension (without the leading '.'), followed by the content type and subtype to be associated with files that use that extension.

Optionally, the line can include the Content-Transfer-Encoding string (7bit, 8bit, Base64 or Quoted-printable), which is used to encode the contents of the file for transmission in the message. 7bit, 8bit, Base64 or Quoted-printable are the standard MIME encodings and the only ones accepted. If no encoding is specified, the MIME utility uses 7bit.

7.15.4 Extracting MIME-Encoded Files Using the MIME Utility

To extract a MIME-encoded file using the MIME utility, first, open the file you want to decode. You can open the file in one of two ways: by invoking the MIME utility specifying the file name or by opening the file in the MIME utility. EXTRACT extracts the specified attachment to a file in its native file format or in another format specified by the /FDL qualifier.

The following are typical MIME utility commands used to open a message file, display the message in readable text, and list the message attributes:

MIME> OPEN file-name

To extract the attachment, enter the following command:

MIME> EXTRACT /ATTACHMENT=n destination-file-name

You can specify a single attachment by appending the /ATTACHMENT=n qualifier, which specifies the number of the attachment to be extracted. You can also use /FDL=filename, which specifies a File Descriptor Language (FDL) definition file to use when converting the specified attachment into an output file. The numbers for the individual attachments are displayed with the LIST command.

See Section 7.15.6 for a complete list of commands used in the MIME utility.

7.15.5 Encoding Files Using the MIME utility

To encode files to be sent as attachments, you must first create a new file by invoking the MIME utility and specifying the NEW command. If the file name is not specified, NEW will prompt for a file name:

$ MIME NEW new-file-name

Or you can use the OPEN command in the MIME utility to open a draft message file:

MIME> OPEN/DRAFT file-name

To open a file that you created in a previous session, specify the qualifier /DRAFT in the command.

To add attachments to the file, enter the command:

MIME> ADD file-name

For a complete list of optional qualifiers for this command, see Section 7.15.6.

To write the current information to the file, use the SAVE command. Once saved, the MIME-encoded file can be sent as a file by the OpenVMS Mail utility.

To exit the MIME utility, enter the QUIT or EXIT command.

See Section 7.15.6 for a complete list of commands used in the MIME utility.

7.15.6 MIME Utility Commands

The following list contains descriptions of the commands, parameters, and qualifiers available in the MIME utility. Examples follow each description.

ADD --- Adds a new body part or attachment to the message being edited. The ADD command requires the name of the file you want to attach as a parameter. The optional qualifiers are:

MIME> ADD file-name/TEXT 

CLOSE --- Closes the current message file. If you have not saved your most recent changes, the MIME utility will prompt you to save before closing. If the file is /READ_ONLY, the file is left unchanged.


EDIT --- Invokes the user's default text editor for the specified attachment.

MIME> EDIT attachment-number

EXIT --- Exits the MIME editor, saving any work in process.


EXTRACT --- Extracts the specified attachment to a file in its native file format.


HELP --- Displays a help file for the MIME utility.


LIST --- Displays information about the current message including a list of body parts and attributes, such as the attachment number.


NEW --- Creates a new message.

MIME>  NEW file-name 

OPEN --- Opens the message with the specified file name. The qualifiers available are:

MIME> OPEN file-name/NEW 

QUIT --- Aborts the current MIME editing session without saving the current message.


READ --- Displays the current message as readable text. Displays the attachment, if applicable.


REMOVE --- Deletes a specified attachment from the current message.


SHOW --- Displays information about the MIME environment, depending upon what option is specified. Possible options are CONTENT_TYPE, FILE_TYPES, and VERSION.

MIME> SHOW option 

SAVE --- Writes the current message to a file. If a file name is specified, it will be used.

MIME> SAVE file-name

7.15.7 Error Handling

Error conditions are reported using the OpenVMS signaling subsystem, specifically lib$signal() and lib$stop(). Three levels of severity exist for error conditions: Fatal, Error, and Warning. These levels indicate what results you can expect from a condition. The severities and corresponding results are described in the following list:

Chapter 8
Editing Text Files with EVE

Text editors allow you to create and modify text files. With a text editor, you can enter text from a keyboard and modify the text using text editing commands. For example, you can type in data for a report and then rearrange sections, duplicate information, substitute phrases, or format text. You can use text editors to create and modify source files for programming languages. The operating system supports several text editors.

The Extensible Versatile Editor (EVE) is a general-purpose text editor based on the DEC Text Processing Utility (DECTPU). This chapter includes information about:

For additional information about EVE, refer to online help in EVE and the Extensible Versatile Editor Reference Manual.

For information about EDT, refer to the OpenVMS EDT Reference Manual.


In this chapter, EVE key names are shown (with the SHOW KEY or HELP KEYS command) by using a slash for control keys, shifted function keys, and Alt key combinations, and a space or a dash for GOLD key sequences. Thus, key combinations that require you to hold down one key (such as Ctrl) while pressing another key are shown with a slash; key combinations in which you press one key after another (such as GOLD-Help) are shown with a space or a dash.

8.1 EVE Features

DECTPU is a high-performance, programmable text processor. With EVE software, you can create and edit text files such as business letters, technical documents, and program source files.

EVE is the default editor on the OpenVMS operating system. Unless you define a different default editor, EVE is invoked when you enter the EDIT command.

With EVE, you can do the following:

Once you know how to invoke EVE and how to enter commands, you can use EVE commands to create and edit files. Using editing keys and commands, you can move the cursor, set buffer mode, and perform editing operations such as entering, erasing, restoring, and moving text.

8.2 Getting Help

You can get online help at any time during your editing session. There are two kinds of online help available with the EVE editor:

8.2.1 Using Keypad Help

To access keypad help, follow these steps:

  1. Press the Help key.
    The Help utility displays a diagram of your keypad.
  2. Follow the directions on the screen to get information on:
  3. Press the Enter key to exit from Help.

8.2.2 Using EVE Help

To use the HELP command to access EVE Help, follow these steps:

  1. Press the Do key.
  2. Enter the command HELP.
    Use the Prev Screen and Next Screen keys to scroll through the list of available help topics.
  3. Press the Enter key to exit from Help.

To get information about a particular command, enter HELP followed by the command name and press the Enter key. The help text appears on the screen. You can also get help on DECTPU built-in procedures by entering the command HELP TPU.

The following example shows the help text for the MOVE BY LINE command:

Moves the cursor a line at a time in the current direction. 
Keys:  EVE Default                        VT100 Keypad 
       F12                                MINUS on keypad 
   1.  If necessary, set the direction to move in --- forward or reverse. 
   2.  Use MOVE BY LINE (see key list above). 
Usage notes: 
o  In forward direction, moves to the end of the current line, or to the 
   end of the next line, if any. 
o  In reverse direction, moves to the start of the current line, or to 
   the start of the next line, if any. 
Related topics: 

8.3 Beginning an Editing Session

EVE is the default editor for the OpenVMS operating system. The EDIT command, as follows, automatically starts the EVE editor (unless the default editor has been redefined by you or the system manager):

$  EDIT 

On systems where EVE is not the default editor, start EVE with the EDIT/TPU command. When you begin an editing session, you can specify the name of an existing file or a new file you want to create. If you do not specify a file name, EVE prompts you for a file name when you end your editing session if you have added text to the default buffer called Main. See Section 8.18 for more information on using buffers.

The following example invokes EVE to create a new file named NEWFILE.DAT:


[End of file](1)
Buffer: NEWFILE.DAT              | Write | Insert | Forward (3)
Command: (4)
Editing new file. Could not find: FABLES.TXT (5)

As you examine the EVE screen display, note the following:

  1. The end-of-file marker marks the end of an EVE buffer. It is visible only on the screen and does not become part of your file. When you add text to the buffer, the end-of-file marker moves down. Depending on the length of your terminal screen, the marker may not be visible when you view the beginning of a buffer that contains many lines of text.
  2. A window is an area of your screen that displays a buffer. EVE buffers exist only during the editing session. When you end an editing session, you can save your edits or discard them.
  3. A highlighted status line appears at the bottom of the EVE window and provides information about the buffer you are viewing in the window. The status line shows the buffer name, editing status (write or read-only), current mode (insert or overstrike), and current direction (forward or reverse).
  4. You use the command line to enter line-mode commands (see Section 8.4). You get the command line by pressing the Do key.
  5. The message window contains an informational message that appears beneath the highlighted status line when you invoke EVE and specify a file name on the command line. The message states either that the file is a new file or that a certain number of lines were read from an existing file. During the editing session, EVE displays other messages in the message window.

8.4 Entering Commands

There are two ways to enter EVE commands:

8.4.1 Typing Commands

To type a command, follow these steps:

  1. Press the Do key.
    The cursor moves to the command window and EVE prompts you to type a command.
  2. Type a command. You can abbreviate the command by using the first few letters of the command. EVE is not case sensitive. You can use any combination of uppercase and lowercase characters in the command line except when specifying strings for the FIND and REPLACE commands.
  3. Press the Do key or the Enter key.
    EVE executes the command or prompts you for further information.

8.4.2 Using Defined Keys

You can use defined keys to enter EVE commands. Each defined key performs one editing command. You can also define your own keys to perform EVE functions.

EVE defines some keys by default. The predefined keys on VT200, VT300, and VT400 series terminals include:

Control keys, arrow keys, and the Tab, Return, and Delete keys have the same definitions on all three types of terminal.

Figure 8-1 shows the predefined keys for the VT200, VT300, and VT400 series terminal.

Figure 8-1 EVE Keys --- VT200, VT300, and VT400 Series Terminals

On VT100 series terminals, EVE automatically defines most of the numeric keypad keys, the four arrow keys, and certain control keys. Figure 8-2 shows the predefined keys for the VT100 series terminal.

Figure 8-2 EVE Keys --- VT100 Series Terminals

8.5 Saving Your Edits and Exiting from EVE

You can use one of the following methods to save your edits:

8.5.1 Using the WRITE FILE Command

To save the text in your buffer by writing it to a file without exiting from EVE, use the WRITE FILE command. If no file is associated with your buffer, EVE prompts for a file name, as follows:

Type filename for buffer Main (press RETURN to not write it): 

Type the name of the file and press the Enter key to write the buffer to a file.

Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement