Scroll to navigation

REFILE(1mh) [mmh-0.4] REFILE(1mh)


refile - file messages in other folders


refile [msgs] [-link | -nolink] [-src +folder] [-file file] +folder1 ... [-Version] [-help]


Refile moves (see mv(1)) or links (see ln(1)) messages from a source folder into one or more destination folders.

If you think of a message as a sheet of paper, this operation is not unlike filing the sheet of paper (or copies) in file cabinet folders. When a message is filed, it is linked into the destination folder(s) if possible, and is copied otherwise. As long as the destination folders are all on the same file system, multiple filing causes little storage overhead. This facility provides a good way to cross-file or multiply-index messages. For example, if a message is received from Jones about the ARPA Map Project, the command

refile c +jones +Map

would allow the message to be found in either of the two folders `jones' or `Map'.

You may specify the source folder using -src +folder. If this is not given, the current folder is used by default. If no message is specified, then the current message is used by default.

The option -file file directs refile to use the specified file as the source message to be filed, rather than a message from a folder. Note that the file should be a validly formatted message, just like any other mh message. It should NOT be in mail drop format (to convert a file in mail drop format to a folder of mh messages, see inc(1)).

If a destination folder doesn't exist, refile will ask if you want to create it. A negative response will abort the file operation. If the standard input for refile is not a tty, then refile will not ask any questions and will proceed as if the user answered `yes' to all questions.

The option -link preserves the source folder copy of the message (i.e., it does a ln(1) rather than a mv(1)), whereas, -nolink (the default) deletes the filed messages from the source folder. No backups are kept, because the contents don't vanish. They are only moved to a new location. To restore: refile the other way.


^$HOME/.mmh/profile~^The user profile


^Path:~^To determine the user's mail storage
^Current-Folder:~^To find the default current folder
^Folder-Protect:~^To set mode when creating a new folder


folder(1), rmf(1), rmm(1)


`-src +folder' defaults to the current folder
`msgs' defaults to the current message


If -link is specified, the current message in the source folder will be set to the last message specified; otherwise, the current message won't 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-sequence (7) for information concerning the previous sequence.


Since mmh-0.3, refile does never change the current folder. (It used to change it when -src +folder was given, but this behavior had usability disadvantages.)

2019-01-06 MH.6.8