1REFILE(1)                   General Commands Manual                  REFILE(1)
2
3
4

NAME

6       refile - file message in nmh folders
7

SYNOPSIS

9       refile [-help] [-version] [msgs] [-draft] [-link | -nolink] [-preserve
10            | -nopreserve] [-retainsequences | -noretainsequences] [-unlink |
11            -nounlink] [-src +folder] [-file file] [-rmmproc program] [-normm‐
12            proc] +folder1 ...
13

DESCRIPTION

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

FILES

94       $HOME/.mh_profile          The user profile
95

PROFILE COMPONENTS

97       Path:                To determine the user's nmh directory
98       Current-Folder:      To find the default current folder
99       Folder-Protect:      To set mode when creating a new folder
100       rmmproc:             Program to delete the message
101

SEE ALSO

103       folder(1), mh-sequence(5), rmf(1), rmm(1)
104

DEFAULTS

106       `-src +folder' defaults to the current folder
107       `msgs' defaults to cur
108       `-nolink'
109       `-nounlink'
110       `-nopreserve'
111       `-noretainsequences'
112

CONTEXT

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

BUGS

125       Since refile and rmm use your rmmproc to delete the message,  the  rmm‐
126       proc  must not call refile or rmm without specifying -normmproc, or you
127       will create an infinite loop.
128
129
130
131nmh-1.8                           2013-03-19                         REFILE(1)
Impressum