1REFILE(1)                          [nmh-1.3]                         REFILE(1)
2
3
4

NAME

6       refile - file message in other folders
7

SYNOPSIS

9       refile [msgs] [-draft] [-link | -nolink] [-preserve | -nopreserve]
10            [-unlink | -nounlink] [-src +folder] [-file file] [-rmmproc pro‐
11            gram] [-normmproc] +folder1 ...  [-version] [-help]
12

DESCRIPTION

14       Refile  moves  (see  mv(1)) or links (see ln(1)) messages from a source
15       folder into one or more destination folders.
16
17       If you think of a message as a sheet of paper, this  operation  is  not
18       unlike  filing  the sheet of paper (or copies) in file cabinet folders.
19       When a message is filed, it is linked into the destination folder(s) if
20       possible,  and is copied otherwise.  As long as the destination folders
21       are all on the same file system, multiple filing causes little  storage
22       overhead.   This  facility  provides a good way to cross-file or multi‐
23       ply-index messages.  For example, if a message is received  from  Jones
24       about the ARPA Map Project, the command
25
26            refile cur +jones +Map
27
28       would  allow  the  message  to  be  found  in either of the two folders
29       `jones' or `Map'.
30
31       You may specify the source folder using -src +folder.  If this  is  not
32       given,  the current folder is used by default.  If no message is speci‐
33       fied, then `cur' is used by default.
34
35       The option -file file directs refile to use the specified file  as  the
36       source  message to be filed, rather than a message from a folder.  Note
37       that the file should be a validly  formatted  message,  just  like  any
38       other  nmh message.  It should NOT be in mail drop format (to convert a
39       file in mail drop format to a folder of nmh messages, see inc(1)).
40
41       If a destination folder doesn't exist, refile will ask if you  want  to
42       create  it.  A negative response will abort the file operation.  If the
43       standard input for refile is not a tty, then refile will  not  ask  any
44       questions  and  will proceed as if the user answered “yes” to all ques‐
45       tions.
46
47       The option -link preserves the source folder copy of the message (i.e.,
48       it  does  a  ln(1) rather than a mv(1)), whereas, -nolink (the default)
49       deletes the filed messages from the source folder.
50
51       Normally when a message is refiled, for each destination folder  it  is
52       assigned the number which is one above the current highest message num‐
53       ber in that folder.  Use of the -preserv switch will override this mes‐
54       sage  renaming,  and  try  to preserve the number of the message.  If a
55       conflict for a  particular  folder  occurs  when  using  the  -preserve
56       switch, then refile will use the next available message number which is
57       above the message number you wish to preserve.
58
59       If -link is not specified (or -nolink is specified), the filed messages
60       will be removed from the source folder.  The default is to remove these
61       messages by renaming them  with  a  site-dependent  prefix  (usually  a
62       comma).  Such files will then need to be removed in some manner after a
63       certain amount of time.  Many sites arrange for cron  to  remove  these
64       files once a day, so check with your system administrator.
65
66       Alternately,  if  you wish for refile to really remove the files repre‐
67       senting these messages from the source folder, you can use the  -unlink
68       switch  (not  to  be  confused  with  the  -link switch).  But messages
69       removed by this method cannot be later recovered.
70
71       If you prefer a more sophisticated method of  `removing'  the  messages
72       from  the  source folder, you can define the rmmproc profile component.
73       For example, you can add a profile component such as
74
75            rmmproc:  /home/coleman/bin/rmm_msgs
76
77       then refile will instead call the named program or script to handle the
78       message files.
79
80       The  user  may specify -rmmproc program on the command line to override
81       this profile specification.  The -normmproc option forces  the  message
82       files to be deleted by renaming or unlinking them as described above.
83
84       The -draft switch tells refile to file the <mh-dir>/draft.
85
86

FILES

88       $HOME/.mh_profile          The user profile
89
90

PROFILE COMPONENTS

92       Path:                To determine the user's nmh directory
93       Current-Folder:      To find the default current folder
94       Folder-Protect:      To set mode when creating a new folder
95       rmmproc:             Program to delete the message
96
97

SEE ALSO

99       folder(1), rmf(1), rmm(1)
100
101

DEFAULTS

103       `-src +folder' defaults to the current folder
104       `msgs' defaults to cur
105       `-nolink'
106       `-nounlink'
107       `-nopreserve'
108
109

CONTEXT

111       If  -src  +folder is given, it will become the current folder.  If nei‐
112       ther -link nor `all' is specified, the current message  in  the  source
113       folder  will  be set to the last message specified; otherwise, the cur‐
114       rent message won't be changed.
115
116       If the “Previous-Sequence” profile entry is set, in addition to  defin‐
117       ing the named sequences from the source folder, refile will also define
118       those sequences for the destination folders.  See mh-sequence  (5)  for
119       information concerning the previous sequence.
120
121

BUGS

123       Since  refile uses your rmmproc to delete the message, the rmmproc must
124       NOT call refile without specifying -normmproc, or you  will  create  an
125       infinite loop.
126
127
128
129MH.6.8                            1 June 2008                        REFILE(1)
Impressum