f9b805aaf8d778abd8c84997b0cefd2f5bf079d0
[mmh] / man / refile.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH REFILE %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 refile \- file message in other folders
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B refile
11 .RI [ msgs ]
12 .RB [ \-draft ]
13 .RB [ \-link " | " \-nolink ]
14 .RB [ \-preserve " | " \-nopreserve ]
15 .RB [ \-unlink " | " \-nounlink ]
16 .RB [ \-src
17 .IR +folder ]
18 .RB [ \-file
19 .IR file ]
20 .RB [ \-rmmproc
21 .IR program ]
22 .RB [ \-normmproc ]
23 .I +folder1
24 \&...
25 .RB [ \-version ]
26 .RB [ \-help ]
27 .ad
28 .SH DESCRIPTION
29 .B Refile
30 moves (see
31 .BR mv (1))
32 or links (see
33 .BR ln (1))
34 messages
35 from a source folder into one or more destination folders.
36 .PP
37 If you think of a message as a sheet of paper, this operation is not
38 unlike filing the sheet of paper (or copies) in file cabinet folders.
39 When a message is filed, it is linked into the destination folder(s)
40 if possible, and is copied otherwise.  As long as the destination
41 folders are all on the same file system, multiple filing causes little
42 storage overhead.  This facility provides a good way to cross\-file or
43 multiply\-index messages.  For example, if a message is received from
44 Jones about the ARPA Map Project, the command
45 .PP
46 .RS 5
47 refile\0cur\0+jones\0+Map
48 .RE
49 .PP
50 would allow the message to be found in either of the two folders `jones'
51 or `Map'.
52 .PP
53 You may specify the source folder using
54 .B \-src
55 .IR +folder .
56 If this is
57 not given, the current folder is used by default.  If no message is
58 specified, then `cur' is used by default.
59 .PP
60 The option
61 .B \-file
62 .I file
63 directs
64 .B refile
65 to use the specified file
66 as the source message to be filed, rather than a message from a folder.
67 Note that the file should be a validly formatted message, just like
68 any other
69 .B nmh
70 message.  It should
71 .B NOT
72 be in mail drop format
73 (to convert a file in mail drop format to a folder of
74 .B nmh
75 messages,
76 see
77 .BR inc (1)).
78 .PP
79 If a destination folder doesn't exist,
80 .B refile
81 will ask if you want
82 to create it.  A negative response will abort the file operation.  If the
83 standard input for
84 .B refile
85 is
86 .B not
87 a tty, then
88 .B refile
89 will not ask any questions and will proceed as if the user answered
90 \*(lqyes\*(rq to all questions.
91 .PP
92 The option
93 .B \-link
94 preserves the source folder copy of the message (i.e.,
95 it does a
96 .BR ln (1)
97 rather than a
98 .BR mv (1)),
99 whereas,
100 .B \-nolink
101 (the default) deletes the filed messages from the source folder.
102 .PP
103 Normally when a message is refiled, for each destination folder it
104 is assigned the number which is one above the current highest message
105 number in that folder.  Use of the
106 .B \-preserv
107 switch will override
108 this message renaming, and try to preserve the number of the message.
109 If a conflict for a particular folder occurs when using the
110 .B \-preserve
111 switch, then
112 .B refile
113 will use the next available message number
114 which is above the message number you wish to preserve.
115 .PP
116 If
117 .B \-link
118 is not specified (or
119 .B \-nolink
120 is specified), the filed
121 messages will be removed from the source folder.  The default is to
122 remove these messages by renaming them with a site-dependent prefix
123 (usually a comma).  Such files will then need to be removed in some
124 manner after a certain amount of time.  Many sites arrange for
125 .B cron
126 to remove these files once a day, so check with your
127 system administrator.
128 .PP
129 Alternately, if you wish for
130 .B refile
131 to really remove the files
132 representing these messages from the source folder, you can use the
133 .B -unlink
134 switch (not to be confused with the
135 .B \-link
136 switch).  But
137 messages removed by this method cannot be later recovered.
138 .PP
139 If you prefer a more sophisticated method of `removing' the messages
140 from the source folder, you can define the
141 .B rmmproc
142 profile
143 component.  For example, you can add a profile component such as
144 .PP
145 .RS 5
146 rmmproc:        /home/coleman/bin/rmm_msgs
147 .RE
148 .PP
149 then
150 .B refile
151 will instead call the named program or script to
152 handle the message files.
153 .PP
154 The user may specify
155 .B \-rmmproc
156 .I program
157 on the command line to
158 override this profile specification.  The
159 .B \-normmproc
160 option forces
161 the message files to be deleted by renaming or unlinking them as
162 described above.
163 .PP
164 The
165 .B \-draft
166 switch tells
167 .B refile
168 to file the <mh\-dir>/draft.
169
170 .SH FILES
171 .fc ^ ~
172 .nf
173 .ta \w'%etcdir%/ExtraBigFileName  'u
174 ^$HOME/\&.mh\(ruprofile~^The user profile
175 .fi
176
177 .SH "PROFILE COMPONENTS"
178 .fc ^ ~
179 .nf
180 .ta 2.4i
181 .ta \w'ExtraBigProfileName  'u
182 ^Path:~^To determine the user's nmh directory
183 ^Current\-Folder:~^To find the default current folder
184 ^Folder\-Protect:~^To set mode when creating a new folder
185 ^rmmproc:~^Program to delete the message
186 .fi
187
188 .SH "SEE ALSO"
189 folder(1), rmf(1), rmm(1)
190
191 .SH DEFAULTS
192 .nf
193 .RB ` "\-src\ +folder" "' defaults to the current folder"
194 .RB ` msgs "' defaults to cur"
195 .RB ` \-nolink '
196 .RB ` \-nounlink '
197 .RB ` \-nopreserve '
198 .fi
199
200 .SH CONTEXT
201 If
202 .B \-src
203 .I +folder
204 is given, it will become the current folder.
205 If neither
206 .B \-link
207 nor `all' is specified, the current message in the
208 source folder will be set to the last message specified; otherwise, the
209 current message won't be changed.
210 .PP
211 If the \*(lqPrevious\-Sequence\*(rq profile entry is set, in addition to defining
212 the named sequences from the source folder,
213 .B refile
214 will also define
215 those sequences for the destination folders.  See
216 .B mh\-sequence (5)
217 for information concerning the previous sequence.
218
219 .SH BUGS
220 Since
221 .B refile
222 uses your
223 .I rmmproc
224 to delete the message,
225 the
226 .I rmmproc
227 must
228 .B NOT
229 call
230 .B refile
231 without specifying
232 .BR \-normmproc ,
233 or you will create an infinite loop.