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