[OpenVMS documentation]
[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
Updated: 11 December 1998

OpenVMS User's Manual


Previous Contents Index

6.6.1 Sending DDIF Files

If the file is a compound document structured according to the DIGITAL Document Interchange Format (DDIF) specification, Mail preserves the OpenVMS RMS file tags and DDIF semantics, for OpenVMS AXP Version 1.0 or VAX/VMS Version 5.2-2 or later systems only. If you try to send mail messages containing DDIF files to operating systems other than OpenVMS or to OpenVMS systems earlier than OpenVMS AXP Version 1.0 or VAX/VMS Version 5.2-2, Mail returns an error message.

6.6.2 Sending Files from DCL

When you send a file from DCL level, Mail is invoked but you do not enter an interactive session, nor do you see the MAIL> prompt. When the file is sent, you return to DCL level automatically. After you have typed the MAIL command with the appropriate qualifiers, press Return to send the file or press Ctrl/C to cancel the send operation.

Note the following as well:

In the following example, the file MEMO.TXT is sent to user EDGELL on node CHEETA from the DCL level:


$ MAIL/SUBJECT="Another memo" MEMO.TXT CHEETA::EDGELL [Return]

In the following example, the user is prompted to input the text of the message because the file name specified is SYS$INPUT:


$ MAIL SYS$INPUT: [Return]
To: ARMSTRONG [Return]
Enter your message below.  Press CTRL/Z when complete, or CTRL/C to quit: 
The text of the message is here.
[Ctrl/Z]
$

6.6.3 Creating Files from Messages

To create a text file from a message, enter the EXTRACT command and the file name at the MAIL> prompt while you are reading the message. When you exit from Mail, the file is listed in your current directory (unless you specify another directory). If the file is a DDIF file, Mail preserves the OpenVMS RMS file tags and DDIF semantics (VAX/VMS Version 5.2-2 or later).

The mail header is composed of the From:, To:, and Subj: lines. To create a file that does not include header information, specify the /NOHEADER qualifier to the EXTRACT command. If the message has more than one header (for example, a forwarded message), only the topmost header is deleted.

Use the /APPEND qualifier to the EXTRACT command to copy a message to the end of an existing file. Use the /ALL qualifier to copy all the files in the current folder to an existing file.

In the following example, a file named DEC_MEETINGS.TXT is created from the mail message shown:


#1                  01-DEC-1996  14:12:27        NEWMAIL 
 
From:  STONE::FELLINI 
To:    Thompson 
Subj:  Dates for December sales meetings 
 
Sales meetings in December will be held on the following dates: 
      Wednesday Dec. 8, 1996 
      Tuesday   Dec. 14, 1996 
      Monday    Dec. 20, 1996 
      Thursday  Dec. 30, 1996
MAIL> EXTRACT DEC_MEETINGS.TXT [Return]
%MAIL-I-CREATED, DISK:[THOMPSON]DEC_MEETINGS.TXT

The following example shows how to create a file named JANUARY_MEETINGS.TXT containing the text of message number 3:


MAIL> READ 3 [Return]
. 
.
.
MAIL> EXTRACT/NOHEADER JANUARY_MEETINGS.TXT  [Return]
%MAIL-I-CREATED, DISK1:[JONES]JANUARY_MEETINGS.TXT;1 created 
MAIL> 

6.6.4 Appending Files to Messages

To append a small file to the end of a mail message automatically, use the SET SIGNATURE_FILE command. The file you specify is automatically (by default) appended to every mail message you send using the ANSWER, FORWARD, MAIL, REPLY, or SEND command. An example of a signature file is a text file that is formatted as a business card, containing the user's company name, address, telephone number, and Internet address.

If you want to selectively append a file to a message or override the default signature file setting, use the /SIGNATURE_FILE[=file-name] qualifier with the ANSWER, FORWARD, MAIL, REPLY, or SEND command.

Use the SHOW SIGNATURE_FILE command to show whether you specified a default signature file. (The SHOW ALL command also displays signature file information.)

You can also set the default signature file at the DCL level by using the /SIGNATURE_FILE[=file-name] qualifier with the DCL command MAIL.

Note that when you create a mail message that includes a signature file, that message requires more temporary disk space than a conventional message because temporary files are created during the operation. After the message is sent, those temporary files are deleted.

When specifying the signature file name, also note the following:

In the following example, the file BUSINESS_CARD.SIG is designated as the default file that will automatically be appended to every mail message sent using the FORWARD, MAIL, REPLY, or SEND command.


MAIL> SET SIGNATURE_FILE BUSINESS_CARD.SIG

In the next example, the file GREETINGS.SIG is designated as the file that will automatically be appended to that specific reply instead of the default signature file.


MAIL> REPLY/SIGNATURE_FILE=GREETINGS.SIG

6.7 Other Ways to Send Messages

The following sections describe other ways to use the Mail utility to send messages.

6.7.1 Replying to Messages

To reply to a message you have received, use the following procedure:
Step Task
1 Type REPLY at the MAIL> prompt and press Return.
2 Enter your message and press Ctrl/Z to send the message or press Ctrl/C to quit.

In the following example, a reply is being sent to STONE::THOMPSON. Note that after the reply command is entered, Mail automatically displays the To: and Subj: prompts:


To: STONE::THOMPSON 
Subj:  RE: Budget Meeting 
Enter your message below. Press CTRL/Z when complete. CTRL/C to quit: 

6.7.1.1 Replying to an Address Containing Nested Quotation Marks

In most cases, you can use the Mail command REPLY to reply to mail received from an address containing nested quotation marks. However, if your system does not have this capability, contact your system manager.

6.7.2 Forwarding Messages

To forward a mail message to other users, enter the FORWARD command at the MAIL> prompt after you have read the message. Mail prompts you for the name of the addressee and a subject line. After you enter the requested information, press Return to send the message.

If you forward a message that consists of a .DDIF file, Mail sends the entire .DDIF file, including .DDIF semantics and the .DDIF tag, to the addressee.

In the following example, a message is forwarded to user STONE::JONES:


MAIL> FORWARD [Return]
To: STONE::JONES [Return]
Subj: FYI -  Status of proposed budget meeting [Return]

6.7.2.1 SET FORWARD Command

You can use the SET FORWARD command to redirect all mail messages sent to you to another account on another OpenVMS cluster or on another system entirely. Essentially this command creates an electronic forwarding address. Only set a forwarding address for accounts you do not want to check regularly. For example, you'd like to forward all your mail from your mail account on the OLD cluster to your mail account on the STAR cluster. After you log into OLD, enter the Mail utility and enter the following command.


MAIL> SET FORWARD STAR::SMITH 

All messages sent OLD::SMITH will be automatically redirected to the mail account on node STAR. You can also set your forwarding address to an internet mail address:


MAIL> SET FORWARD SMITH@Company.com 

In this case, all mail sent to OLD::SMITH will be sent to SMITH@Company.com.

Always send a test message to the old account to confirm that the account is forwarding correctly. To avoid creating forwarding loops where mail messages forward infinitely and never arrive, never set an account to forward to itself or another forwarding account. Do not forward OLD::SMITH to OLD::SMITH. Do not forward OLD::SMITH to STAR::SMITH and then forward STAR::SMITH to OLD::SMITH.

To check where an account is forwarding, enter the following command:


MAIL> SHOW FORWARD 
Your mail is being forwarded to STAR::SMITH. 

To remove a forwarding address, enter the following command:


MAIL> SET NOFORWARD 
MAIL> SHOW FORWARD 
You have not set a forwarding address. 

Confirm that you have removed the forwarding address and send the account a test message.

Note

In prior versions of the OpenVMS operating system, you had to specify an extra pair of quotation marks if you wanted them included with the SET FORWARD command because the command automatically removed the first pair. Starting with OpenVMS Version 7.0, you need not specify an extra pair of quotation marks because the SET FORWARD command no longer removes the first pair.

6.8 Organizing Messages

The following sections describe how to organize mail messages.

6.8.1 Creating Folders

To organize your mail messages, you can create your own mail files and folders. A mail file contains folders, and a folder contains mail messages. Each folder and file can contain any number of messages.

Typically, you organize your messages by creating folders rather than by creating mail files. As with the default mail folders (NEWMAIL, MAIL, WASTEBASKET), the folders you create are normally stored in the mail file MAIL.MAI. The name of the current folder is displayed in the top right corner of the screen each time you enter a READ or DIRECTORY command. You can work only with messages that are in your current folder.

If your mail file is very large (over 500 blocks), you might want to create separate mail files for the larger folders to improve Mail's performance.

6.8.2 Creating Mail Subdirectories

When you receive mail messages, they are written to files named MAIL$xxxxxxxxxx.MAI by default and are located in your top-level directory. (Note that the x characters represent a long, random file specification.) Your default mail file, MAIL.MAI, is created in your top-level directory the first time you receive a mail message.

To avoid the display of .MAI files in your top-level directory, use the Mail command SET MAIL_DIRECTORY. This command creates a mail subdirectory and moves all your .MAI files to that subdirectory. To move the .MAI files from a subdirectory back to your top level directory, use the SET NOMAIL_DIRECTORY command.

To display the name of the subdirectory that contains all your .MAI files, enter SHOW MAIL_DIRECTORY at the MAIL> prompt.

In the following example, a user (FRED) creates the directory .MAIL:


MAIL> SET MAIL_DIRECTORY [.MAIL] [Return]
MAIL> SHOW MAIL_DIRECTORY [Return]
Your mail file directory is SY$LOGIN:[FRED.MAIL]

6.8.3 Moving Messages into Folders

You can use either the FILE command or the MOVE command to place the current message in a different folder. If the folder does not exist, Mail displays a message asking if you want to create it. After filing the message in the specified folder, Mail automatically deletes the message from the current folder.

6.8.4 Copying Messages Between Folders

The Mail command COPY places a copy of the current message into the folder you specify. If the folder does not exist, Mail displays a message asking if you want to create it.

In the following example, all messages containing the word MEETING are copied from the current folder to a folder named SCHEDULE. After the COPY command completes, there are two copies of each message, one in the current folder and one in the folder named SCHEDULE.


MAIL> SEARCH MEETING [Return]
MAIL> COPY SCHEDULE [Return]
Folder SCHEDULE does not exist. 
Do you want to create it (Y/N, default is N)?Y  [Return]
%MAIL-I-NEWFOLDER, folder SCHEDULE created

The following command selects and displays the next message containing the word "meeting":


MAIL> SEARCH [Return]


MAIL> COPY SCHEDULE [Return]
MAIL> SEARCH [Return]
%MAIL-E-NOTFOUND, no messages containing 'MEETING' found

6.8.5 Selecting Folders

To display a list of the folders in your current mail file, enter the DIRECTORY/FOLDER command. To select a new folder as your current folder, use one of the following commands:

In the following example, the MEMOS folder is selected:


MAIL> DIRECTORY/FOLDER [Return]
Listing of folders in SYS$LOGIN:[FRED]MAIL.MAI;1 
     Press CTRL/C to cancel listing 
MAIL                                  MEETING_MINUTES 
MEMOS                                 PROJECT_NOTES 
STAFF 
MAIL> SELECT MEMOS

6.8.6 Deleting Folders

To delete a mail folder, delete all the messages in the folder or move them to another folder. When you delete all messages in a folder, the empty folder is deleted automatically as soon as you select another folder.

In the following example, the messages in the MUSIC folder are deleted:


MAIL> SELECT MUSIC [Return]
%MAIL-I-SELECTED, 2 messages selected
MAIL> DELETE/ALL [Return]

6.8.7 Creating and Accessing Mail Files

You can also create files to organize your mail messages. You use the same commands to create a mail file that you use to create a folder: COPY, MOVE, and FILE. After Mail prompts you for the name of the folder, it also prompts you for a file name. If you enter a new file name at the File: prompt, a new mail file is created.

To work within a mail file other than the default mail file, use the Mail command SET FILE to specify the alternate file. The Mail command SHOW FILE displays the name of the current mail file. When you change mail files, the WASTEBASKET folder of the current mail file is emptied and deleted (if AUTO_PURGE is set) and the mail file is closed.

Figure 6-1 shows how a typical user might organize their mail.

Figure 6-1 Organizing Mail


In the following example, the current message is moved into a folder named FEED in the ACCOUNTS file. The MOVE command creates the mail file ACCOUNTS.MAI, moves the current message into the FEED folder, and deletes the message from its current folder and file.


MAIL> MOVE [Return]
_Folder:  FEED [Return]
_File:  ACCOUNTS [Return]

In the following example, the FEED folder (which is in the ACCOUNTS file) is selected:


MAIL> SET FILE ACCOUNTS [Return]
MAIL> SET FOLDER FEED [Return]
MAIL> SHOW FILE [Return]
Your current mail file is SYS$LOGIN:[FRED.MAI]ACCOUNTS.MAI;1.

6.8.8 Correcting the Mail Message Count

If the number of new (unread) mail messages displayed on your screen is inconsistent with the actual number of new messages, enter the READ/NEW command when there is no new mail. You will know there is no new mail when you enter the READ/NEW command and receive one of the following system messages:


"%MAIL-W-NONEWMAIL, no new messages" 
 
"%MAIL-E-NOMOREMSG, no more messages" 

6.9 Deleting Messages

To delete a mail message from the current folder, either enter the DELETE command while you are reading the message or enter the DELETE command followed by the number (or range of numbers) of the message you want to delete. You can use either the hyphen (-) or the colon (:) to define the range of messages to be deleted.

In the following example, messages 4, 5, 6, 11, 12, 14, 15, 16, and 17 are deleted:


MAIL> DELETE 4-6,11,12,14:17 [Return]

6.9.1 Recovering Deleted Messages

When you delete a message, the message is moved to a folder called WASTEBASKET. Deleted messages collect in the WASTEBASKET folder until you exit from the current mail file (either by exiting from Mail or by specifying a different mail file). If you have issued the SET AUTO_PURGE command, when you exit from the current mail file, WASTEBASKET is emptied and the folder itself is deleted. During your interactive Mail session, you can recover any deleted message by moving the message out of the wastebasket folder. You can also empty the WASTEBASKET folder by entering the PURGE command.

In the following example, the mail message identified by the number 12 is deleted and then recovered from the WASTEBASKET folder.


MAIL> DELETE 12 
 
MAIL> SELECT WASTEBASKET 
%MAIL-I-SELECTED, 1 message selected 
 
MAIL> DIRECTORY 
    # top 
From                 Date         Subject 
 
    1 FABLES::WEST         11-DEC-1996  Meeting this week 
 
MAIL> MOVE MAIL 

6.10 Printing Mail Messages

To print a mail message, enter the PRINT command at the MAIL> prompt. By default, Mail sends your message to the SYS$PRINT queue. Mail files are not sent to a print queue until you press Ctrl/Z, enter the EXIT command, or enter the PRINT/PRINT command.

To specify a different queue, use the PRINT command qualifier /QUEUE. You can also select a different queue by issuing the SET QUEUE queue-name command; this queue will remain your default print queue until you enter another SET QUEUE command, even if you exit Mail.

In the following example, the mail message is submitted to the AK34$PRINT print queue:


MAIL> PRINT/QUEUE=AK34$PRINT [Return]

In the following example, the default print queue is changed from SYS$PRINT to AK34$PRINT:


MAIL> SET QUEUE AK34$PRINT [Return]

6.11 Protecting Mail Files

The following sections describe how to protect mail files.

6.11.1 Default Protection

Mail files (for example, MAIL.MAI) are protected so that no one else can read them and so that you cannot accidentally delete them. The protection code that Mail gives .MAI files is: (S:RW,O:RW,G:,W:). The system (including Mail itself) and the owner (you) can read and write to the file. The group and world are denied all access.

The Mail utility also has default file protection to discourage mail tampering. However, Mail is not completely secure from tampering. Anyone with sufficient privileges can change protection and access mail files.


Previous Next Contents Index

[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
[OpenVMS documentation]

Copyright © Compaq Computer Corporation 1998. All rights reserved.

Legal
6489PRO_011.HTML