Qm utility

qm is a utility program which allows inspection and manipulation of queued messages. It is invoked with a command of the form: imsimta qm &#x5b;command &#x5b;\ command ...&#x5d;&#x5d; Historically qm has two modes: Maintenance mode and user mode. User mode is now obsolete and no longer documented. Maintenance mode is used to inspect and manipulate the channel queue directories and the messages contained in them. Privileges sufficient to read, create, and delete files in the channel queue directory tree as well as read and update the queue cache database are required to use maintenance mode.

One or more qm commands can be specified on the qm invocation line, separated by a backslash. (Note that depending on the shell used the backslash may have to be quoted in some way.) If no commands are specified qm enters interactive mode; if commands are specified qm executes them and exits.

directory command
The  command is used to show the currently queued message files. In the listing, message identification numbers will appear to the left of each message file name. These numbers may be used with subsequent,  ,  ,  ,  , and   commands so as to identify which message to operate on.

The  command can also be used to list the total number of messages matching given criteria by channel.

The  command produces its listing by looking at either the actual queue directory tree on disk, or by looking at the queue cache database. Use either the  command or the   or   switches to control the source of information used.

The syntax of the  command is: directory &#x5b;switches&#x5d; &#x5b;channel-name&#x5d; Here  is optional parameter specifying the channel for which to obtain a directory listing. All channels are listed if no channel name is specified. Wildcards are permitted in the channel name.

The following switches are supported on the  command:

The  command defaults to displaying message file name information rather than envelope information. For example: qm.maint&#x3e; directory Thu, 04 Apr 2019 09:53:27 -0700 (PDT) Data gathered from the queue directory tree Channel: process                 Size Queued since --    1 ZZl0_3m0eS~91.00               2  04 Apr 2019 07:09:48 -- Total size:                         2 Channel: tcp_lmtpcs              Size Queued since --    2 ZZl0_2b0SQlV3.00               1  02 Apr 2019 07:57:32 3 ZZl0_3m0eS~90.00              1  04 Apr 2019 07:09:48 -- Total size:                         2 Channel: tcp_local               Size Queued since --    4 ZZl0_2b0SQ7V2.00               6  02 Apr 2019 07:56:28 5 ZZl0_2b0PQLV0.00              2  02 Apr 2019 07:46:28 -- Total size:                         8 Grand total size:                  12 Envelope information will be displayed if  or any of the selection switches that cause the message file to be opened and read are specified: qm.maint&#x3e; directory -envelope Thu, 04 Apr 2019 09:57:08 -0700 (PDT) Data gathered from the queue directory tree Channel: process From                     To                         Size Queued since ---    1                           xxx+test2@example.com         2 04 Apr 19 07:09 --- Total size:                                                  2 Channel: tcp_lmtpcs From                     To                         Size Queued since ---    2 xxx@example.com           @multke.example.com:test1     1 02 Apr 19 07:57 3 whoever@example.com      @multke.example.com:test2     1 04 Apr 19 07:09 --- Total size:                                                  2 Channel: tcp_local From                     To                         Size Queued since ---    4 xxx@example.com           xxx@example.com               6 02 Apr 19 07:56 5 xxx@example.com          xxx@example.com               2 02 Apr 19 07:46 --- Total size:                                                  8 Grand total size:                                           12 The,  , and   switches all require a pattern as an argument. All patterns are treated as regular expressions if  is specified; similarly, all patterns are treated as glob-style patterns if   is specified. If neither switch is specified a given pattern is taken to be a glob-style wildcard if either wildcard character ("&#x2a;" or "?") are present, and as a prefix match string otherwise.

There can be multiple envelope To: (RCPT TO) addresses and conversion tags associated with a message. The  and   selection switches succed if they match any of the corresponding address or conversion tags regardless of the setting of the   switch.

The channel parameter selects what messages are eligible for listing and thus is always a logcal-AND with any other seletion criteria.

The  switch takes a Sieve test as an argument; this is what in sieve would be given as a parameter to the "if" control. For example, a test to see if the Subject: header contains the word "SPAM" would be: header :contains "subject" "SPAM" Note that,   and   can be used to combine multiple Sieve tests here, just as in Sieve itself.

Sieve tests can be specified directly in the  switch argument or they can be read from a file simply by specifying the file name as the argument. In the former case note that quotes must surround the entire argument; the use of single rather than double quotes is recommended in order to avoid having to double the double quotes, i.e., directory -sieve=&#x27;header :matches "subject" "&#x2a;important&#x2a;note&#x2a;"&#x27; is a lot easier to type than: directory -sieve="header :contains ""subject"" ""important""" The  switch produces a per-channel tally of messages. For example: qm.maint&#x3e; dir -total Thu, 04 Apr 2019 10:02:34 -0700 (PDT) Data gathered from the queue directory tree Message Channel name                    Count     Size --- process                             1        2 tcp_lmtpcs                          2        2 tcp_local                           2        8 --- Grand totals:                       5       12 As of MS 8.1.0.2, the various selection criterial can be combined with  to produce lists of messages meeting selected criteria. For example: qm.maint&#x3e; dir -total -tag=tag2 tcp_&#x2a; Thu, 04 Apr 2019 10:02:34 -0700 (PDT) Data gathered from the queue directory tree Message Channel name                    Count     Size --- tcp_lmtpcs                          1        1 tcp_local                           1        4 --- Grand totals:                       2        5