OpenWindows Advanced User's Guide

7.6.2 Saving and Copying Letters in Folders

You can dispense with typing full pathnames to files if you save or copy letters to mail folders. Folders are special files that are stored in a folder directory.

The advantages to saving or copying letters to folders is that your letters are automatically kept together in the same directory, where they are easily accessible without typing long pathnames.

7.6.2.1 Setting the Folder Directory

To use folders, you must first set up a folder directory. This is a two-step process:

  1. First, make the directory using the mkdir command.

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

    $ mkdir Letters
    

  2. Second, use a text editor to edit the .mailrc file in your home directory (which contains mailx options) to set the folder directory path.

    Here you need to edit the folder variable to include the full path name of your newly created folder directory. For example:

    set folder=/home/austin/rose/Letters
    

    or, using the C shell shortcut ~ to specify your home directory.

    set folder=~/Letters
    

Now your folder directory is set to receive letters saved in folders. (The change to the .mailrc file will take effect the next time you start mailx.)

7.6.2.2 Designating Folders

You use the same commands to save or copy letters 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 (Letters).

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

& s 3 +projects

mailx interprets this command as meaning "save letter 3 into ~/Letters/projects." (If the folder doesn't already exist, mailx will create it.)

Copy the letter into a folder by typing:

& c 3 +projects

7.6.2.3 Sending a Letter Directly to a File or Folder

You can send copies of your letters 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.