REFILE(1)
π REFILE(1) β the refile girlies' guide π
okay bestie, welcome to refile from the General Commands Manual, and no this is not the boring version, we're doing this together π
β¨ NAME β¨
refile β file message in nmh folders ποΈβ¨
β¨ SYNOPSIS β¨
refile [-help] [-version] [msgs] [-draft] [-link | -nolink] [-preserve |
-nopreserve] [-retainsequences | -noretainsequences] [-unlink |
-nounlink] [-src +folder] [-file file] [-rmmproc program]
[-normmproc] +folder1 ...
β¨ DESCRIPTION β¨
okay so the whole vibe of refile is: it moves messages (that's mv(1), iykyk) or links them (that's ln(1)) out of a source folder and into one or more destination folders. she's a relocator π
Think of a message like a single sheet of paper, and this operation is literally you filing that sheet (or copies of it) into the little folders inside a file cabinet. iconic, honestly. When a message gets filed, it gets linked into the destination folder(s) if that's possible, and copied otherwise. And here's the slay: as long as all your destination folders live on the same file system, filing a message multiple times costs you basically no extra storage overhead. little-to-no storage overhead, fr fr π«Ά
That makes this a genuinely great way to cross-file or multiple-index your messages. example time:
if a message shows up from Jones about the ARPA Map Project, this command
refile cur +jones +Map
means you can find that message in either of the two folders jones or Map. two homes, one message, main character energy π
You can tell her where the source folder is with -src +folder. If you don't, she just uses the current folder by default. And if you don't specify any message at all? Then cur is used by default. easy π
The -file file option directs refile to use the specified file as the source message to be filed, instead of a message from a folder. β οΈ heads up though: that file should be a validly formatted message, just like any other nmh message. It should not be in mail drop format. (If you need to convert a file in mail drop format into a folder of nmh messages, that's what inc(1) is for, bestie.)
If a destination folder doesn't exist, refile will ask you if you want to create it. A negative response aborts the file operation, periodt. And here's the lowkey important bit: if the standard input for refile is not a tty, then refile won't ask you anything at all β she just proceeds as if the user answered βyesβ to all the questions. so if you're scripting this, she is not going to wait around for your opinion π
The -link option preserves the source folder copy of the message (that means it does an ln(1) instead of a mv(1)), whereas -nolink (which is the default) deletes the filed messages from the source folder. choose your fighter π
Normally, when a message is refiled, for each destination folder it gets assigned the number that's one above the current highest message number in that folder. Use the -preserve switch to override that message renaming and try to preserve the number of the message. But if a conflict for a particular folder happens while you're using -preserve, then refile will use the next available message number which is above the message number you wished to preserve. no cap, that's the fallback πΈ
Message sequences are folder-specific (they belong to their folder, they don't travel), so moving the message out of the source folder removes it from all of its sequences in that folder. -retainsequences adds it to those same sequences in the destination folder, and creates any of those sequences that don't already exist. one exception though: this adding does not apply for the βcurβ sequence.
If -link is not specified (or if -nolink is specified), the filed messages will be removed from the source folder. The default is to remove these messages by renaming them with a site-dependent prefix (usually a comma). Such files will then need to be removed in some manner after a certain amount of time. Many sites arrange for cron to remove these files once a day, so check with your system administrator π§
Alternately, if you want refile to really remove the files representing these messages from the source folder, you can use the -unlink switch β and do not confuse -unlink with the -link switch, they are not the same thing and the vibes are very different. π But listen: messages removed by this method cannot be later recovered. gone means gone. that's a permanent deletion, bestie π
If you prefer a more sophisticated method of removing the messages from the source folder, you can define the rmmproc profile component. For example, you can add a profile component such as
rmmproc: /home/coleman/bin/rmm_msgs
and then refile will instead call the named program or script to handle the message files. cute, delegating π
You may specify -rmmproc program on the command line to override this profile specification. And the -normmproc option forces the message files to be deleted by renaming or unlinking them as described above.
The -draft switch tells refile to file the <mh-dir>/draft. yes, that one. π
β¨ FILES β¨
$HOME/.mh_profileβ the user profile π
β¨ PROFILE COMPONENTS β¨
Path:β to determine the user's nmh directoryCurrent-Folder:β to find the default current folderFolder-Protect:β to set mode when creating a new folderrmmproc:β program to delete the message
β¨ SEE ALSO β¨
folder(1), mh-sequence(5), rmf(1), rmm(1) π¦
β¨ DEFAULTS β¨
`-src +folder'defaults to the current folder`msgs'defaults tocur`-nolink'`-nounlink'`-nopreserve'`-noretainsequences'
β¨ CONTEXT β¨
If -src +folder is given, it will become the current folder. If neither -link nor all is specified, the current message in the source folder will be set to the last message specified; otherwise, the current message won't be changed. π
If the βPrevious-Sequenceβ profile entry is set, then in addition to defining the named sequences from the source folder, refile will also define those sequences for the destination folders. See mh-sequence(5) for information concerning the previous sequence.
β¨ BUGS β¨
Sincerefileandrmmuse yourrmmprocto delete the message, thermmprocmust not callrefileorrmmwithout specifying-normmproc, or you will create an infinite loop. ππ infinite loop. do not do this. periodt.
and that's the whole page, bestie π«Ά this was nmh-1.8, dated 2013-03-19, and honestly? she ate. go file some messages πβ¨π
π¦ where this page comes from
- alpine 3.24: nmh-doc 1.8-r3 Β· BSD-3-Clause
- epel 10: nmh 1.8-3.el10_1 Β· BSD
- epel 9: nmh 1.8-1.el9 Β· BSD
- fedora 43: nmh 1.8-9.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: nmh 1.8-10.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms