Solaris Advanced User's Guide

Saving and Copying Messages in Folders

You can avoid typing full path names to files if you save or copy messages to mail folders. Folders are special files that are stored in a folder directory.

The advantage of saving or copying messages to folders is that your messages are automatically stored in the same directory, where they are easily accessible without typing long path names.

Setting the Folder Directory

To use folders, you must first set up a folder directory. Follow these steps to set up a folder directory.

  1. Create a directory by using the mkdir command.

    For example, if you wanted your folder directory to be called Messages, you would first create the directory:

    $ mkdir Messages
  2. Edit the .mailrc file in your home directory (which contains mailx options) to set the folder directory path.

    Edit the folder variable to include the full path name of your newly created folder directory. For example:

    set folder=/home/austin/rose/Messages

    Or use the C shell shortcut ~ to specify your home directory.

    set folder=~/Messages

Now your folder directory is set to receive messages that are saved in folders. The change to the .mailrc file becomes effective the next time you start mailx.

Designating Folders

You use the same commands to save or copy messages into folders as into files, except that the folder name is preceded by a plus sign (+) instead of a path name. The + tells mailx that the folder is to be kept in the folder directory (Messages).

For example, to save message 3 to a folder called projects, type:

& s 3 +projects

mailx interprets this command as “save message 3 into ~/Messages/projects.” If the folder doesn't already exist, mailx creates it.

Copy the message into a folder by typing:

& c 3 +projects

Sending a Message Directly to a File or Folder

You can send copies of your messages directly to one of your files or folders. To send a copy to a folder, simply type the folder name in either the Cc: or the Bcc: field. Sending a copy to a file is similar, but you must include the full path name.