1SORTM(1)                    General Commands Manual                   SORTM(1)
2
3
4

NAME

6       sortm - sort nmh messages
7

SYNOPSIS

9       sortm [-help] [-version] [+folder] [msgs] [-all | -noall] [-datefield
10            field] [-textfield field] [-notextfield] [-limit days] [-nolimit]
11            [-check | -nocheck] [-verbose | -noverbose]
12

DESCRIPTION

14       sortm sorts the specified messages in the named folder according to the
15       chronological order of the “Date:” field of each message.
16
17       If no messages are specified,  the  default  is  all  messages  in  the
18       folder.  However, if no messages are specified and the -noall switch is
19       enabled, then sortm reports that as an error and  exits  with  non-zero
20       status.  -noall is most useful in the user's profile, to avoid inadver‐
21       tent sorting of an entire folder.  The -all switch can then be used  on
22       the  command line to disable it.  Of course, a message specification of
23       all can be used in any case.
24
25       The -verbose switch directs sortm to tell the user the general  actions
26       that it is taking to place the folder in sorted order.
27
28       The  -datefield  field  switch tells sortm the name of the field to use
29       when making the date comparison.  If the user has a  special  field  in
30       each message, such as “BB-Posted:” or “Delivery-Date:”, then the -date‐
31       field switch can be used to direct sortm which field to examine.
32
33       The -textfield field switch causes sortm to sort messages by the speci‐
34       fied  text  field.   All  characters  except  letters  and  numbers are
35       stripped  and  the  resulting  strings  are   sorted   datefield-major,
36       textfield-minor, using a case insensitive comparison.  If this field is
37       “subject”, any leading "re:" is stripped off.
38
39       With -textfield field, if -limit days is specified, messages  with  the
40       same  textfields  that  are  dated  within  `days' of each other appear
41       together.  Specifying -nolimit makes the limit infinity.   With  -limit
42       0, the sort is instead simply textfield-major.
43
44       For  example,  to  order a folder by date-major, grouping messages with
45       the same subject on the same date together, use:
46
47            sortm -textfield subject +folder
48
49       sortm always issues a warning  for  each  message  that  is  missing  a
50       “Date:” field, has a “Date:” field that cannot be parsed, or has a for‐
51       mat error in any header field.  With the -check switch, sortm  inhibits
52       all  modifications  to  the  folder if there are any such messages, and
53       exits with non-zero status.  With the default of -nocheck, sortm  sorts
54       messages with a missing or invalid “Date:” field using their file modi‐
55       fication times.
56
57       When ordering messages based on their dates,  if  they  have  the  same
58       dates, their original message order is preserved.
59

FILES

61       $HOME/.mh_profile          The user profile
62

PROFILE COMPONENTS

64       Path:                To determine the user's nmh directory
65       Current-Folder:      To find the default current folder
66

SEE ALSO

68       folder(1)
69

DEFAULTS

71       `+folder' defaults to the current folder
72       `msgs"'defaultstoallwithout-noall,nodefaultwith-noall"
73       `-all'
74       `-datefield' defaults to date
75       `-notextfield'
76       `-noverbose'
77       `-nolimit'
78       `-nocheck'
79

CONTEXT

81       If  a  folder is given, it will become the current folder.  If the cur‐
82       rent message is moved, sortm will preserve its status as current.
83

HISTORY

85       Timezones used to be ignored when  comparing  dates:  they  aren't  any
86       more.
87
88       Messages which were in the folder, but not specified by `msgs', used to
89       be moved to  the  end  of  the  folder;  now  such  messages  are  left
90       untouched.
91
92       sortm  sometimes  did  not  preserve  the message numbering in a folder
93       (e.g., messages 1, 3, and 5, might have been  renumbered  to  1,  2,  3
94       after  sorting).   This was a bug, and has been fixed.  To compress the
95       message numbering in a folder, use “folder -pack” as always.
96

BUGS

98       When sortm complains about a message which it can't  temporally  order,
99       it  complains  about  the  message  number prior to sorting.  It should
100       indicate what the message number will be after sorting.
101
102
103
104nmh-1.7.1                         2014-03-23                          SORTM(1)
Impressum