HP OpenVMS Systems Documentation

Content starts here

OpenVMS User's Manual

Previous Contents Index

7.12.3 Selecting an Editor

By default, Mail invokes the DECTPU-based EVE editor when you specify the Mail command SEND/EDIT. By entering the Mail command SET EDITOR, you can specify that a different editor be invoked instead of EVE. For example, to select the EDT editor, issue the Mail command SET EDITOR EDT. The EDT editor remains your default Mail editor (even if you log out of the system and log back in) until you enter another SET EDITOR command.

To display the name of the selected Mail editor, enter the Mail command SHOW EDITOR.

7.12.4 Using a Command File to Edit Mail

You can define the logical name MAIL$EDIT to be a command file before entering Mail. Then, when you issue any Mail command that invokes an editor, the command file will be called to perform the edit. In the command file, you can also invoke other utilities such as the spell-checker and you can specify any function that can be done in a command file. Refer to Appendix B for an annotated example of a MAILEDIT.COM command procedure and refer to Chapter 13 and Chapter 14 for more information on command files.

7.12.5 Overriding Your Selected Editor

If you wish to temporarily override your selected editor, you can define MAIL$EDIT to be the string "CALLABLE_" with the desired editor name appended. For example, to use callable EDT rather than callable EVE, you can type the following command:


If you issue the SET EDITOR command during a session that was invoked with MAIL$EDIT defined, you override both your permanent selected editor and the current editor setting. To use the command file defined by MAIL$EDIT again, you must exit from Mail and restart it.

7.13 Using the Mail Keypad

You can use the numeric keypad on your keyboard to execute commands in Mail. Most keypad keys can execute two commands.

Figure 7-2 shows the Mail keypad. To enter the top command for each key shown, press the appropriate key. To enter the bottom command shown, press the PF1 key first, and then the desired function key.

Figure 7-2 Mail Utility Keypad

To execute the Mail command SEND, press KP7. To execute the Mail command SEND/EDIT, press the PF1 key first and then press KP7.

7.13.1 Redefining Keypad Keys

You can redefine the keypad keys to execute Mail commands when you are in Mail. Note that the previous definition of the key is superseded when you redefine a key.

Defining keypad keys in Mail is similar to defining keypad keys to execute DCL commands.

In the following example, the key KP2 is defined as the Mail command PRINT/PARAM=PAGE_ORIENT=LANDSCAPE. After KP2 is defined, you can press it to display the PRINT/PARAM=PAGE_ORIENT=LANDSCAPE command:


7.13.2 Assigning Additional Key Definitions

To increase the number of key definitions available on your terminal, use the /STATE qualifier. You can assign many definitions to the same key as long as each definition is associated with a different state. State names can be any alphanumeric string. By specifying states, you can press a key once to enter a command and a second time to enter a qualifier.

In the following example, PF1 (pressed twice) is defined as DIRECTORY/FOLDER:


Press PF1 twice to enter the command DIRECTORY/FOLDER. The /TERMINATE qualifier ends the command line so you do not need to press the Enter key.

7.13.3 Creating Permanent Key Definitions

Any keypad keys that you define during a Mail session are lost when you exit from Mail. To retain keypad key definitions from one Mail session to another, create a file containing key definitions (for example, MAIL$KEYDEF.INI) in your top-level directory. For example, the following MAIL$KEYDEF.INI file contains six key definitions:

DEFINE/KEY PF2 "MAIL"           /TERMINATE      /IF_STATE=mail

To execute these commands each time you invoke Mail, enter the following command line in your login command file (LOGIN.COM):


7.14 Summary of Mail Commands

This section contains a summary of all Mail utility commands. For complete information on qualifiers used with these commands, refer to online help.

See also Section 7.15 for information about using the MIME utility to read and compose MIME-encoded messages.

7.14.1 Reading Messages

Use the following commands to read messages:

  • BACK
    Displays the message preceding the current or last-read message when the last command issued was READ. When the last command issued was DIRECTORY, the BACK command displays the preceding screen of the directory listing.
    Displays the beginning of the message you are currently reading.
  • DIRECTORY [folder-name]
    Displays a list of the messages in the current mail file, including message number, sender's name, date, and subject.

    Clears your terminal screen.
    Places a copy of the current message into the specified output file. To copy a mail message to a folder in a Mail file, use either the COPY, FILE, or MOVE command.
    Displays the first message in the current folder.
  • LAST
    Displays the last message in the current folder.
  • NEXT
    Skips to the next message and displays it.
  • READ [folder-name] [message-number]
    Displays your messages. Pressing the Enter key is the same as entering the READ command without parameters.
  • SEARCH search-string
    Searches the currently selected folder for the message containing the first occurrence of the specified text string.
    Displays the number of unread mail messages.

7.14.2 Exchanging Messages

Use the following commands to exchange messages:

  • ANSWER [filespec]
    REPLY [filespec]
    Sends a message to the sender of the message you are currently reading or of the one you last read.
    Sends a copy of the message you are currently reading (or have just read) to one or more users.
  • MAIL [filespec]
    SEND [filespec]
    Sends a message to one or more users.

7.14.3 Removing Messages

Use the following commands to remove messages:

  • DELETE [message-number]
    Deletes either the message you are currently reading, a range of messages, or the message you just read, and moves it to the WASTEBASKET folder.
    Deletes all the messages in the WASTEBASKET folder. When you exit from Mail or enter a SET FILE command (to select a new mail file), an implicit purge is done to empty the WASTEBASKET folder, unless you have previously entered the SET NOAUTO_PURGE command.
    Determines whether Mail empties the WASTEBASKET folder when you enter the EXIT or SET FILE command. When you use the SET NOAUTO_PURGE command, you must enter the PURGE command periodically to delete the messages in the WASTEBASKET folder.
    Displays whether messages in the WASTEBASKET folder are deleted (purged automatically) when you enter the EXIT or SET FILE command.

7.14.4 Printing Messages

Use the following commands to print messages:

    Adds a copy of the message you are currently reading to the print queue. The files created by the PRINT command are released to the print queue when you exit from Mail. Multiple messages are concatenated into one print job unless you use the /NOW or /PRINT qualifier.
  • SET [NO]FORM form-name
    Sets the default print form for printing done within Mail. The SET NOFORM command clears the default print form. The SHOW FORM command displays the default print form.
  • SET [NO]QUEUE queue-name
    Sets the default print queue to be used when you enter the PRINT command from within Mail. SET NOQUEUE clears the previously defined print queue and sets the queue to SYS$PRINT, the default print queue. The SHOW QUEUE command displays your default print queue.

7.14.5 Organizing Messages

Use the following commands to organize messages:

  • COPY folder-name [filename]
    Copies a message to another folder without deleting it from the current folder. If the specified folder does not exist, it is created.
  • FILE folder-name [filename]
    MOVE folder-name [filename]
    Moves the current message to the specified folder and deletes the message from the original folder.
  • SELECT [folder-name]
    SET FOLDER [folder-name]
    Establishes a set of messages that you can affect as a group. You can copy or move this set of messages from one folder to another. You can also read and delete, or search and extract a set of messages. In addition, you can use the SELECT and SET FOLDER commands to move from one folder to another.
  • SET FILE filename
    Establishes (or opens) another file as the current mail file. By default, your mail file is MAIL.MAI. If you use the COPY command, the FILE command, or the MOVE command to create other mail files (for example, JOKES.MAI or HISTORY.MAI), you can then use the SET FILE command to open the Mail files.
    Displays the name of the mail file that is currently open.
  • SHOW FOLDER [folder-name]
    Displays the current folder name.
  • SET WASTEBASKET_NAME folder-name
    Changes the name of the WASTEBASKET folder, which contains messages to be deleted. You can delete all the messages in the WASTEBASKET folder by entering the PURGE command. If AUTO_PURGE is set, when you enter the EXIT command, messages in the WASTEBASKET folder will be deleted. If AUTO_PURGE is set, you can avoid deleting messages in the WASTEBASKET folder by entering the QUIT command.
    Displays the name of the WASTEBASKET folder.
    Displays the amount of deleted message space in the current mail file.

7.14.6 Marking Messages

The following commands are used for marking messages:

  • MARK [message-number]
    Sets the current or specified message as marked. Marked messages are displayed with an asterisk (*) in the left column of the directory listing. To select or organize marked messages, use the SELECT command with the /MARKED qualifier.
  • UNMARK [message-number]
    Sets the current or specified message as unmarked. The asterisk (*) in the left column of the directory listing is deleted.

7.14.7 Customizing the Mail Environment

The following commands are used for customizing the mail environment:

  • DEFINE/KEY key-name string
    Defines a key to execute a Mail command. You can press the key to enter a command instead of typing the command name.
  • SHOW KEY [key-name]
    Displays the key definitions created by the DEFINE/KEY command.
  • EDIT [filename]
    Invokes your selected editor and enables you to edit a message before you send it.
  • HELP [topic]
    Displays information about Mail. To obtain information about individual commands or topics, enter HELP followed by the command or topic name.
    Sets the default for determining whether the carbon copy (CC:) prompt appears when sending a message.
  • SET COPY_SELF command[,command]
    Sets the default for determining whether the SEND, REPLY, or FORWARD commands return to the sender a copy of the message being sent.
    Displays which command (SEND, REPLY, or FORWARD) automatically sends a copy of the message to you.
    Sets the Mail utility to append a signature text file to the end of a mail message automatically whenever you use the ANSWER, FORWARD, MAIL, REPLY, or SEND command.
    Displays information that shows whether you specified a default signature file and, if so, the name of that file. (The SHOW ALL command also displays signature file information.)
  • SET EDITOR editor-name
    Selects the text editor to be used when you edit a message (for example, with the Mail command SEND/EDIT). You can use any callable editor available on your system. This command overrides any definition that the command procedure MAIL$EDIT has set.
    Displays the name of your selected text editor.
  • SET [NO]FORWARD address
    Sets a forwarding address for your mail.
    Displays the name of your current forwarding address.
  • SET [NO]MAIL_DIRECTORY [.subdirectory-name]
    Specifies that all mail files (file type .MAI) be moved from your SYS$LOGIN directory to the specified subdirectory.
    Displays the name of the device and directory containing all your .MAI files.
  • SET [NO]PERSONAL_NAME "text-string"
    Appends a text string to the end of the From: field of mail messages you send. You can fill this field with your full name or any other information. Note that your personal name must begin with a letter and may not have two consecutive spaces.
    Displays the text string established with the SET PERSONAL_NAME command.
    Displays detailed information about your current Mail settings.

7.14.8 Exiting or Transferring Control

The following commands are used for exiting Mail or transferring control:

  • ATTACH [process-name]
    Permits you to switch control of your terminal from your current process to another process in your job. For example, while you are editing a file, you can use the SPAWN command to move to a subprocess (Mail) to read a new mail message. Then, you can enter the ATTACH command to move back to the editing session.
  • EXIT
    Exits from Mail. When you enter the EXIT command, any messages in the WASTEBASKET folder are deleted unless you have issued the command SET NOAUTO_PURGE. You can also exit from Mail by pressing Ctrl/Z.
  • QUIT
    Exits from Mail without emptying the WASTEBASKET folder (deleted messages are not destroyed unless you enter the EXIT command or press Ctrl/Z). The QUIT command performs the same function as Ctrl/Y.
  • SPAWN [command]
    Creates a subprocess of the current process. You can use the SPAWN command to leave Mail temporarily, perform other functions (such as displaying a directory listing or printing a file), and then return to Mail.

7.14.9 Mail File Compression

The following command is used for compressing mail files:

  • COMPRESS [filespec]
    Makes an indexed mail file smaller. If you do not specify a file name, Mail compresses the mail file that is currently open. If there is no open mail file, Mail compresses the default mail file (MAIL.MAI).

7.14.10 System Management Commands

The following commands are used for system management:

  • REMOVE user name
    Removes a user record from the system's mail profile, data file SYS$SYSTEM:VMSMAIL_PROFILE.DATA. Requires SYSPRV privileges.
    Displays the name of a user's current forwarding address.
    Displays the text string that a user has established with the SET PERSONAL_NAME command.

7.15 MIME Utility

The Multipurpose Internet Mail Extension (MIME) is the standard used to attach nontext files to mail messages. The MIME utility allows you to compose and read MIME-encoded mail messages. With MIME, nontext files, such as graphics or sound files, are encoded and sent as plain text, although that text may not be readable. The MIME utility decodes MIME files to their original form and allows you to create MIME-encoded files, which can be sent as mail messages using the OpenVMS Mail utility.

7.15.1 Invoking the MIME Utility

The system manager may have already set up the foreign command for MIME, but if not, you can do so by adding the following line to your LOGIN.COM:


MIME will only open MIME encoded text files. You need to extract the MIME-encoded message into a text file using Mail first. (See Section 7.6.3 for instructions.)

To invoke the MIME utility from the DCL prompt, enter the following:

$ MIME file-name.TXT

The file name qualifier is optional. If the file specified exists, it is opened READ_ONLY.

  • /READ_ONLY indicates that the file is the contents of a message received by the user who intends to decode it. This is the default.
  • /DRAFT indicates that the file contains a message that was created in a previous session and was opened for WRITE_ACCESS.

The MIME utility does not construct any header information such as the To: or From: fields. It creates only MIME headers and the body text of the message, saving the text in a file to be sent by Mail later. If the file specified to be opened contains such recognizable headers or any RFC822 headers, the file is opened and the default is /READ_ONLY.

If the file specified does not contain any recognizable headers or does not exist, an OPEN FILE ERROR message occurs.

You can establish system-wide defaults for displaying MIME-encoded messages by creating two files: MIME$MAILCAP.DAT and MIME$FILETYPES.DAT.

MIME$MAILCAP.DAT contains an application that defines each locally-recognized content type of MIME-encoded files. MIME$FILETYPES.DAT associates each content type with a file extension. A user can override the defaults by creating these files in SYS$LOGIN.

7.15.2 Initializing the MIME Utility

When a user starts the MIME utility, the initialization process performs the following steps:

  1. In the user's VMSmail profile, the MIME utility looks up the user's mail directory and default editor for use with the MIME utility.
  2. The MIME utility reads files MIME$MAILCAP.DAT and MIME$FILETYPES.DAT.
  3. The MIME utility refers to the following list of internal defaults:
    • Content types
      The MIME utility refers to the list of content types before displaying incoming messages. The list contains content types that the MIME utility recognizes and the information needed to decode each content type into its original format.
      The following is an example of a MAILCAP entry, from RFC 1524:

      image/*; xview %s

      You can add content types to the list MIME recognizes by creating a MIME$MAILCAP.DAT file. (Example 7-1 contains an example of a MIME$MAILCAP.DAT file.)
    • File extensions
      The MIME utility refers to the list of file extensions while composing outgoing messages. The list contains OpenVMS file extensions and the content type associated with each extension. The MIME utility needs these extensions to be included in the MIME-formatted message body it composes.
      Each line in the file-extension list is made up of the following items:

      extension, content type/subtype, (optionally) Content-Transfer-Encoding string

      The following is an example of a line in a file-extension list:

      doc, application/ms-word, base64

      You can add file extensions and matching content types to the list the MIME utility recognizes by creating a MIME$FILETYPES.DAT file, which is described in Table 7-1.

7.15.3 Creating Optional MIME Utility Files

Table 7-1 lists and describes files you might want to create to customize the MIME utility on your system.

Table 7-1 MIME Utility Optional Files
File Purpose
MIME$MAILCAP.DAT For the display and parsing of incoming messages.
MIME$FILETYPES.DAT For the assignment of content types to outgoing attached files.

Place these files in the SYS$LOGIN directory.

Previous Next Contents Index