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