refile(1mh)
Name
refile − file message in other folders
Syntax
refile [msgs] [−draft] [−link] [−nolink] [−preserve] [−nopreserve] [−src +foldername] [−file filename] +folder [−help]
Description
Use the refile command to move the specified message from the current folder to another folder or a number of other folders.
If you do not specify a message, the current message will be refiled. Use refile in conjunction with the message numbers, to refile a message other than the current message. You can refile more than one message at a time by specifying:
• more than one message number
• a range of message numbers
• a sequence of messages defined by pick (see pick()))
The following example shows how to refile messages 3 and 5 in the folder +records.
$ refile 3 5 +records
Options
You will normally refile messages from the current folder into another folder. However, you can specify an alternative source folder using the −src+folder option. The following example shows how to refile a message from the +inbox folder when +inbox is not the current folder.
$ refile 3 −src +inbox +outbox
You can refile a message in more than one folder, as the following example shows. This means that you could reference mail both under the name of the sender and the subject that the message deals with.
$ refile +jones +map
Note that folder names are case sensitive, so you must type the exact folder name including any capital letters.
When you refile a message, the message is normally (−nolink) moved from the source folder to the destination folder. You can keep a copy of the message in the source folder, if you want, by specifying the −link option. The following example takes the thirteenth message in the current folder and refiles it in the +test folder. Message 13 however remains in the current folder as well as appearing in the +test folder.
$ refile −link 13 +test
Normally when you refile a message, the message number is reset to the next available number. So if you were refiling message number 109 into a folder that only contained five messages, the message number would probably not be the same in the new file as it was in the old file. This happens because the −nopreserve option of refile is normally in force. You can make sure that the message that you are refiling has the same number in the destination folder as it did in the source folder by specifying the −preserve option. You cannot have two messages with the same message number, so you need to use this option carefully.
You can use refile to move a file out of a directory into a message folder using the −file filename option, provided that the file is formatted as a mail message. This means that the message must have the minimum header fields separated from the body of the message by a blank line or a line of dashes. The following example shows this option being used to refile the file <mailfile> into the +test folder.
$ refile −file mailfile +test
You can refile the draft message, or the current message in your drafts file, if you use refile with the −draft option.
Files
| $HOME/.mh_profile | The user profile |
Profile Components
| Path: | To determine your MH directory |
| Current-Folder: | To find the default current folder |
| Folder-Protect: | To set mode when creating a new folder |
| rmmproc: | Program to delete the message |
Context
If −src +folder is given, it will become the current folder. If neither −link nor all is specified, the current message in the source folder will be set to the last message specified; otherwise, the current message will not be changed.
If the Previous-Sequence profile entry is set, in addition to defining the named sequences from the source folder, refile will also define those sequences for the destination folders. See mh_profile() for information concerning the previous sequence.