1 .\" Copyright (c) 1999 Sendmail, Inc. and its suppliers.
2 .\" All rights reserved.
4 .\" By using this file, you agree to the terms and conditions set
5 .\" forth in the LICENSE file which can be found at the top level of
6 .\" the sendmail distribution.
9 .\" $Id: qtool.8,v 8.12 2000/12/15 19:53:35 gshapiro Exp $
11 .TH QTOOL 8 "$Date: 2000/12/15 19:53:35 $"
14 \- manipulate sendmail queues
18 target_directory source [source ...]
25 moves the queue files used by sendmail between queues. It uses the same
26 locking mechanism as sendmail so can be safely used while sendmail is
31 will move any queue files as specified by \fIsource\fP into
32 \fItarget_directory\fP. \fISource\fP can be either an individual
33 queue control file, a queue file id, or a queue directory.
35 If the -d option is specified, qtool will delete the messages specified by
36 source instead of moving them.
38 If the -b option is specified, the selected messages will be bounced by
39 running sendmail with the -OTimeout.queuereturn=now option.
43 Bounce all of the messages specified by source. The messages will be bounced
44 immediately. No attempt will be made to deliver the messages.
47 Specify the sendmail config file.
48 Defaults to /etc/mail/sendmail.cf.
51 Delete all of the messages specified by source.
53 \fB\-e\fP \fIperl_expression\fP
54 Evalute \fIperl_expression\fP for each queue file as specified
55 by \fIsource\fP. If \fIperl_expression\fP evaluates to true, then that
56 queue file is moved. See below for more detail on \fIperl_expression\fP.
58 \fB\-s\fP \fIseconds\fP
59 Move only the queue files specified by \fIsource\fP that have a
60 modification time older than \fIseconds\fP.
62 You can use any valid perl expression. Inside the expression you have
63 access to a hash that contains many of the fields in the control file as
64 well as some other data about that queued message. The hash is called
65 \fI%msg\fP. If a field has multiple values (e.g. 'Recipient'), it will be
66 returned as an array, otherwise it will be returned as a scalar. Through
67 \fI%msg\fP, you can access the following variables:
73 Body type (\fB8BITMIME\fP, \fB7BIT\fP, or undefined).
75 \fBbody_last_mod_time\fP
76 The last time the body was modified since the epoch in seconds.
79 The size of the body file in bytes.
82 Character set (for future use).
85 Content-Length: header value (Solaris sendmail only).
87 \fBcontrolling_user\fP
90 \fBcontrol_last_mod_time\fP
91 The last time the body was modified since the epoch in seconds.
94 The size of the control file in bytes.
97 The time when the control file was created.
100 The data file name (deprecated).
103 Original envelope id form ESMTP.
105 \fBerror_recipient\fP
106 The error recipient (deprecated).
109 Array of characters that can be the following values:
114 warning message has been sent
117 This is an error respone or DSN
120 has 8 bit data in body
126 envelope has DSN RET= parameter
134 This is a Perl hash where the keys are rfc822 field names and the values
135 are rfc822 field values. If a field has only one value it will be returned
136 as a string. If a field has more than one value (e.g. 'Received') it will
137 be returned as a list of strings.
140 The inode number for the data (body) file.
142 \fBnext_delivery_time\fP
143 Earliest time of next delivery attempt.
145 \fBnum_delivery_attempts\fP
146 Number of delivery attempts that have been made.
152 Envelope status message.
154 \fBoriginal_recipient\fP
155 Original recipient (ORCPT= parameter).
158 Adjusted priority of message.
161 Array of character flags followed by colon and recipient name. Flags:
166 Has NOTIFY= parameter.
169 Success DSN requested.
172 Failure DSN requested.
178 Primary address (not the result of alias/forward expansion).
186 Version of control file.
190 Moves all of the queue files in queue q1 to queue q2.
192 \fBqtool.pl q2 q1/d6CLQh100847\fP
193 Moves the message with id d6CLQh100847 in queue q1 to queue q2.
195 \fBqtool.pl q2 q1/qfd6CLQh100847\fP
196 Moves the message with id d6CLQh100847 in queue q1 to queue q2.
198 \fBqtool.pl -e '$msg{num_delivery_attempts} == 3' /q2 /q1\fP
199 Moves all of the queue files that have had three attempted deliveries from
200 queue q1 to queue q2.
202 In sendmail 8.12, it is possible for a message's qf and df files
203 to be stored in different queues.
204 In this situation, you must give qtool the pathname of the qf file,
206 To be safe, never feed qtool the pathname of a df file.