5 .\" include the -mh macro file
8 .TH SORTM %manext1% MH.6.8 [%nmhversion%]
10 sortm \- sort messages
16 \%[\-datefield\ field]
17 \%[\-textfield\ field]
20 \%[\-limit days] \%[\-nolimit]
28 \fISortm\fR sorts the specified messages in the named folder according
29 to the chronological order of the \*(lqDate:\*(rq field of each message.
31 The `\-verbose' switch directs \fIsortm\fR to tell the user the general
32 actions that it is taking to place the folder in sorted order.
34 The `\-datefield\ field' switch tells \fIsortm\fR the name of the field to
35 use when making the date comparison. If the user has a special field in
36 each message, such as \*(lqBB\-Posted:\*(rq or \*(lqDelivery\-Date:\*(rq,
37 then the `\-datefield' switch can be used to direct \fIsortm\fR which
40 The `\-textfield\ field' switch causes \fIsortm\fR to sort messages
41 by the specified text field. If this field is \*(lqsubject\*(rq, any
42 leading "re:" is stripped off. In any case, all characters except
43 letters and numbers are stripped and the resulting strings are sorted
44 datefield\-major, textfield\-minor, using a case insensitive comparison.
46 With `\-textfield\ field', if `\-limit\ days' is specified, messages
47 with similar textfields that are dated within `days' of each other
48 appear together. Specifying `\-nolimit' makes the limit infinity.
49 With `\-limit 0', the sort is instead made textfield\-major, date\-minor.
52 For example, to order a folder by date-major, subject-minor, use:
55 sortm -textfield subject +folder
58 ^$HOME/\&.mh\(ruprofile~^The user profile
60 ^Path:~^To determine the user's nmh directory
62 ^Current\-Folder:~^To find the default current folder
66 `+folder' defaults to the current folder
68 `msgs' defaults to all
78 If a folder is given, it will become the current folder. If the current
79 message is moved, \fIsortm\fR will preserve its status as current.
81 Timezones used to be ignored when comparing dates: they aren't any more.
83 Messages which were in the folder, but not specified by `msgs', used to
84 be moved to the end of the folder; now such messages are left untouched.
86 \fISortm\fP sometimes did not preserve the message numbering in a folder
87 (e.g., messages 1, 3, and 5, might have been renumbered to 1, 2, 3 after
88 sorting). This was a bug, and has been fixed. To compress the message
89 numbering in a folder, use \*(lq\fIfolder\ \-pack\fR\|\*(rq as always.
91 If \fIsortm\fR encounters a message without a date\-field, or if the
92 message has a date\-field that \fIsortm\fR cannot parse, then \fIsortm\fR
93 attempts to keep the message in the same relative position. This does
94 not always work. For instance, if the first message encountered lacks
95 a date which can be parsed, then it will usually be placed at the end
96 of the messages being sorted.
98 When \fIsortm\fR complains about a message which it can't temporally
99 order, it complains about the message number \fIprior\fR to sorting.
100 It should indicate what the message number will be \fIafter\fR sorting.