Document revision date: 30 March 2001

## OpenVMS User's Manual

Previous | Contents | Index

### 6.13.2 Using /EDIT Qualifier Keywords

By specifying the /EDIT qualifier when you invoke Mail, you can use the editor for sending, replying, and forwarding during the ensuing mail session. You can also use keywords with the /EDIT qualifier to set the default for Mail.

To invoke the editor only when you are replying to a message, use the REPLY keyword with the MAIL/EDIT command. To invoke the editor and display the message to which you are replying, use the REPLY keyword with the =EXTRACT option. If you do not specify a keyword with /EDIT, the default is /EDIT=(SEND,REPLY).

To send or reply to a message, EXIT from the editor. To cancel a SEND or REPLY command, enter the QUIT command to exit from the editor.

Examples

- In the following example, the editor will be invoked for every mail message that is sent or forwarded:

      $ MAIL/EDIT=(SEND,FORWARD) [Return]

- In the following example, the editor will be invoked for every message that is replied to:

      $ MAIL/EDIT=(REPLY) [Return]

- In the following example, the editor will be invoked and the message to which you are replying will be included as text every time you reply to a message:

      $ MAIL/EDIT=(REPLY=EXTRACT) [Return]

### 6.13.3 Selecting an Editor

By default, Mail invokes the DECTPU-based EVE editor when you specify the Mail command SEND/EDIT. If you are not running an ANSI-compliant CRT (hardcopy) terminal, you will not be able to invoke DECTPU-based editors (such as EVE and LSE). If you attempt to invoke a DECTPU-based editor, you will receive the error message :

    %TPU-E-NONANSICRT, SYS$INPUT must be supported CRT

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.

### 6.13.4 Displaying the Selected Editor

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

In the following example, the EDT editor is selected and then used to create a message:

    MAIL> SET EDITOR EDT [Return]
    MAIL> SHOW EDITOR [Return]
    Your editor is EDT.

    MAIL> SEND/EDIT [Return]
    To:   STONE::THOMPSON [Return]
    Subj: Budget Meeting [Return]
    [EOB]
    *

### 6.13.5 Using EDT

When EDT is used to edit messages, you will see an asterisk (*) after you enter the subject line and press Return. Enter the CHANGE command and press Return to switch to the screen editor. For more information on using EDT, see Chapter 9. Enter the text of your message using EDT commands to move around in the buffer. A buffer is a temporary storage area that exists only during an editing session. To send the message, press Ctrl/Z. To cancel and not send the message, press Ctrl/C.

### 6.13.6 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 C for an annotated example of a MAILEDIT.COM command procedure and refer to Chapter 15 and Chapter 16 for more information on command files.

### 6.13.7 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:

    $ DEFINE MAIL$EDIT CALLABLE_EDT

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. In order to use the command file defined by MAIL$EDIT again, you must exit from Mail and restart it.

## 6.14 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 6-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 6-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.

### 6.14.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:

    MAIL> DEFINE/KEY KP2 "PRINT/PARAM=PAGE_ORIENT=LANDSCAPE" [Return]

### 6.14.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:

    MAIL> DEFINE/KEY PF1 "DIRECTORY"/SET_STATE=FOLDER /NOTERMINATE  [Return]
    MAIL> DEFINE/KEY PF1 "/FOLDER" /IF_STATE=FOLDER /TERMINATE  [Return]

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

### 6.14.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 PF1 "DIRECTORY "     /NOTERMINATE    /SET_STATE=folder
    DEFINE/KEY PF1 "/FOLDER"        /TERMINATE      /IF_STATE=folder
    DEFINE/KEY PF2 "SELECT "        /NOTERMINATE    /SET_STATE=mail
    DEFINE/KEY PF2 "MAIL"           /TERMINATE      /IF_STATE=mail
    DEFINE/KEY PERIOD "READ "       /NOTERMINATE    /SET_STATE=new
    DEFINE/KEY PERIOD "/NEW"        /TERMINATE      /IF_STATE=new

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

    $ DEFINE MAIL$INIT SYS$LOGIN:MAIL$KEYDEF.INI

## 6.15 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 6.16 for information about using the MIME utility to read and compose MIME-encoded messages.

### 6.15.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.
- CURRENT
  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.
- ERASE
  Clears your terminal screen.
- EXTRACT
  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.

- FIRST
  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 Return 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.
- SHOW NEW_MAIL_COUNT
  Displays the number of unread mail messages.

### 6.15.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.
- FORWARD
  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.

### 6.15.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.
- PURGE
  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.
- SET [NO]AUTO_PURGE
  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.

- SHOW AUTO_PURGE
  Displays whether messages in the WASTEBASKET folder are deleted (purged automatically) when you enter the EXIT or SET FILE command.

### 6.15.4 Printing Messages

Use the following commands to print messages:

- PRINT
  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
  SHOW FORM
  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
  SHOW QUEUE
  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.

### 6.15.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.
- SHOW FILE
  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.
- SHOW WASTEBASKET_NAME
  Displays the name of the WASTEBASKET folder.
- SHOW DELETED
  Displays the amount of deleted message space in the current mail file.

### 6.15.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.

### 6.15.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.
- SET [NO]CC_PROMPT
  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.
- SHOW COPY_SELF
  Displays which command (SEND, REPLY, or FORWARD) automatically sends a copy of the message to you.
- SET [NO]SIGNATURE_FILE
  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.
- SHOW SIGNATURE_FILE
  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.
- SHOW EDITOR
  Displays the name of your selected text editor.
- SET [NO]FORWARD address
  Sets a forwarding address for your mail.
- SHOW FORWARD
  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.
- SHOW MAIL_DIRECTORY
  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.
- SHOW PERSONAL_NAME
  Displays the text string established with the SET PERSONAL_NAME command.
- SHOW ALL
  Displays detailed information about your current Mail settings.

### 6.15.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.

### 6.15.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).

### 6.15.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.
- SHOW FORWARD
  Displays the name of a user's current forwarding address.
- SHOW PERSONAL_NAME
  Displays the text string that a user has established with the SET PERSONAL_NAME command.

## 6.16 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.

### 6.16.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 :== $SYS$SYSTEM:MIME.EXE

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 6.7.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.

Previous | Next | Contents | Index

| privacy and legal statement |
6489PRO_013.HTML