1 .TH MH-FOLDERS %manext5% 2016-02-25 "%nmhversion%"
6 mh-folders \- storage format used by nmh message system
9 stores messages in the files and directories of the host filesystem
10 according to the following rules:
12 .B one folder per directory
16 folder corresponds to a directory. There are no limits on folder
17 names beyond those of the host filesystem.
20 .B one message per file
22 The file name is a positive integer. Other files containing metadata or
23 arbitrary names can exist in a folder; while the preference is that non-message
24 files begin with \*(lq.\*(rq, all files that are not positive integers
28 implementation. However, implementations are free to indicate to the user
29 the existence of non-message files that are not prefixed with a \*(lq.\*(rq.
31 The filename for a new message is one greater than the highest numbered
32 message in the folder; its full path can be accessed by the pseudo-sequence
39 permitted to be added to a folder at the end of the message number range.
41 To add a new message to a folder, the recommended sequence is:
43 Create a temporary file in the desired folder.
45 Attempt to link the temporary file to the new message number.
47 If successful, remove the temporary file. If the link fails, increment the
48 message number and try again.
52 There is one context file. Its default location is in the
53 user's Path and its default name is
55 but these can be overridden by the $MHCONTEXT environment variable.
57 has the following format:
60 .BI "Current-Folder: +" folder
63 .BI "atr-" sequence-path ": " "m[-n] [...]"
68 is the directory name of the current folder. Lines beginning
69 with \*(lqatr\*(rq are used for private sequences.
71 is the name of the private sequence,
73 is the full path to the folder with the private sequence, and
75 is a message number or range of message numbers in the sequence.
80 There is one sequences file in each
82 folder. Its default name is
84 but this can be overridden by the \*(lqmh\-sequences\*(rq profile entry.
86 has the following format:
89 .BI "sequence: " "m[-n] [...]"
92 showing the (possibly empty) message numbers and/or ranges of message
93 numbers in each sequence. The
95 sequence has at most just a single message number, not a range.
97 Sequence names have a maximum size of 998 characters. Each line is also
98 limited to a maximum of 998 characters, but RFC 822 continuation rules
99 apply; sequences can be continued across multiple lines by prefixing
100 continuation lines with a whitespace character.
102 If an implementation finds messages in a sequence that do not exist,
103 the sequence file should be updated to remove the missing messages
104 from the sequence. If a sequence contains no messages, it should be
105 removed from the sequence file. The exception to this is the
107 sequence, which can refer to a nonexistent message.
111 programs read and write the context and sequences files, and lock
112 these files when accessing them. There should not be a need to
113 access these files directly; instead, programs such as
120 should be used to query and update their contents. Any program
123 that accesses these files must be sure to lock them using the same
126 The default data locking method is selected when
128 is configured and can be accessed as a string using
129 .BR "mhparam datalocking" .
130 By default, fcntl locking is used, but this may be overridden by
135 A second, possibly different, locking method is used by
137 when accessing the user's mail spool file or by
139 programs that open any mbox file. This locking method can be overridden
142 is configured, or in the
144 mts configuration file, and can be accessed as a string using
145 .BR "mhparam spoollocking" .
146 By default, kernel-level locking is used if appropriate for the
147 platform, and it is for popular platforms. That default should also
148 be the same as used by the
150 program, if provided on the platform.
153 folders can be given arbitrary names, with one exception:
154 folders should not be given all-numeric names. This
155 limitation results from
157 messages themselves being stored
158 in numerically named files -- allowing folders to be named
161 slower, and introduce usage ambiguities.
169 Overrides the above context.
171 <folder>/.mh\-sequences
172 Public sequences for <folder>.
181 .IR mh\-sequence (5),