1 .TH MH-FOLDERS %manext5% "July 22, 2014" "%nmhversion%"
6 mh-folders \- specification of 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 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
32 message is one greater than the highest numbered message in
33 the folder; its full path can be accessed by the pseudo\-sequence
40 permitted to be added to a folder at the end of the message number range.
42 To add a new message to a folder, the recommended sequence is:
45 Create a temporary file in the desired folder.
47 Attempt to link the temporary file to the new message number.
49 If successful, remove the temporary file. If the link fails, increment the
50 message number and try again.
55 There is one context file. Its default location is in the
56 user's Path and default name is
58 but those can be overridden with the $MHCONTEXT environment
61 has the following format:
64 .BI "Current-Folder: +" folder
67 .BI "atr-" sequence-path ": " "m[-n] [...]"
72 is the directory name of the current folder. Lines beginning
73 with \*(lqatr\*(rq are used for private sequences.
75 is the name of the private sequence,
77 is the full path to the folder with the private sequence, and
79 is a message number or range of message numbers in the sequence.
84 There is one sequences file in each
86 folder. Its default name is
87 .IR \&.mh\(rusequences ,
88 but that can be overridden with the \*(lqmh\-sequences\*(rq profile entry.
90 has the following format:
93 .BI "sequence: " "m[-n] [...]"
96 showing the (possibly empty) message numbers and/or ranges of message
97 numbers in each sequence. The
99 sequence has at most just a single message number, not a range.
101 Sequence names have a maximum size of 998 characters. Each line is also
102 limited to a maximum of 998 characters, but RFC 822 continuation rules
103 apply; sequences can be continued across multiple lines by prefixing
104 continuation lines with a whitespace character.
106 If an implementation finds messages in a sequence that do not exist,
107 the sequence file should be updated to remove the missing messages
108 from the sequence. If a sequence contains no messages, it should be
109 removed from the sequence file. The exception to this is the
111 sequence, which can refer to a nonexistant message.
116 programs read and write the context and sequences files, and lock
117 these files when accessing them. There should not be a need to
118 access these files directly; instead, programs such as
125 should be used to query and update their contents. Any program
128 that accesses these files must be sure to lock them using the same
131 The default data locking method is selected when
133 is configured and can be accessed as a string using
134 .BR "mhparam datalocking" .
135 By default, fcntl locking is used, but this may be overridden with
140 A second, possibly different, locking method is used by
142 when accessing the user's mail spool file or by
144 programs that open any mbox file. This locking method can be overridden
147 is configured, or in the
149 mts configuration file, and can be accessed as a string using
150 .BR "mhparam spoollocking" .
151 By default, kernel-level locking is used if appropriate for the
152 platform, and it is for popular platforms. That default should also
153 be the same as used by the
155 program, if provided on the platform.
159 .ta \w'^<folder>/\&.mh\(rusequences~'u
160 ^<mh\-dir>/context~^The user context
161 ^or $MHCONTEXT~^Rather than the standard context
162 ^<folder>/\&.mh\(rusequences~^Public sequences for <folder>
173 .IR mh\-sequence (5),