1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
.\" Copyright (c) 1999 Sendmail, Inc. and its suppliers.
.\" All rights reserved.
.\"
.\" By using this file, you agree to the terms and conditions set
.\" forth in the LICENSE file which can be found at the top level of
.\" the sendmail distribution.
.\"
.\"
.\" $Sendmail: qtool.8,v 8.9.16.2 2000/12/15 19:50:41 gshapiro Exp $
.\"
.TH QTOOL 8 "$Date: 2001/01/15 21:09:00 $"
.SH NAME
qtool
\- manipulate sendmail queues
.SH SYNOPSIS
.B qtool.pl
.RB [options]
target_directory source [source ...]
.PP
.B qtool.pl [-d/-b]
.RB [options]
source [source ...]
.SH DESCRIPTION
.B Qtool
moves the queue files used by sendmail between queues. It uses the same
locking mechanism as sendmail so can be safely used while sendmail is
running.
.PP
With no options,
.B qtool
will move any queue files as specified by \fIsource\fP into
\fItarget_directory\fP. \fISource\fP can be either an individual
queue control file, a queue file id, or a queue directory.
.PP
If the -d option is specified, qtool will delete the messages specified by
source instead of moving them.
.PP
If the -b option is specified, the selected messages will be bounced by
running sendmail with the -OTimeout.queuereturn=now option.
.SS Options
.TP
\fB\-b\fP
Bounce all of the messages specified by source. The messages will be bounced
immediately. No attempt will be made to deliver the messages.
.TP
\fB\-d\fP
Delete all of the messages specified by source.
.TP
\fB\-e\fP \fIperl_expression\fP
Evalute \fIperl_expression\fP for each queue file as specified
by \fIsource\fP. If \fIperl_expression\fP evaluates to true, then that
queue file is moved. See below for more detail on \fIperl_expression\fP.
.TP
\fB\-s\fP \fIseconds\fP
Move only the queue files specified by \fIsource\fP that have a
modification time older than \fIseconds\fP.
.SS Perl Expressions
You can use any valid perl expression. Inside the expression you have
access to a hash that contains many of the fields in the control file as
well as some other data about that queued message. The hash is called
\fI%msg\fP. If a field has multiple values (e.g. 'Recipient'), it will be
returned as an array, otherwise it will be returned as a scalar. Through
\fI%msg\fP, you can access the following variables:
.TP
\fBauth\fP
AUTH= parameter.
.TP
\fBbody_type\fP
Body type (\fB8BITMIME\fP, \fB7BIT\fP, or undefined).
.TP
\fBbody_last_mod_time\fP
The last time the body was modified since the epoch in seconds.
.TP
\fBbody_size\fP
The size of the body file in bytes.
.TP
\fBcharset\fP
Character set (for future use).
.TP
\fBcontent-length\fP
Content-Length: header value (Solaris sendmail only).
.TP
\fBcontrolling_user\fP
The controlling user.
.TP
\fBcontrol_last_mod_time\fP
The last time the body was modified since the epoch in seconds.
.TP
\fBcontrol_size\fP
The size of the control file in bytes.
.TP
\fBcreation_time\fP
The time when the control file was created.
.TP
\fBdata_file_name\fP
The data file name (deprecated).
.TP
\fBenvid\fP
Original envelope id form ESMTP.
.TP
\fBerror_recipient\fP
The error recipient (deprecated).
.TP
\fBflags\fP
Array of characters that can be the following values:
.PD 0
.RS +8
.TP 8
w
warning message has been sent
.TP 8
r
This is an error respone or DSN
.TP 8
8
has 8 bit data in body
.TP 8
b
delete Bcc: headers
.TP 8
d
envelope has DSN RET= parameter
.TP 8
n
don't return body
.PD
.RE
.TP
\fBheaders\fP
This is a Perl hash where the keys are rfc822 field names and the values
are rfc822 field values. If a field has only one value it will be returned
as a string. If a field has more than one value (e.g. 'Received') it will
be returned as a list of strings.
.TP
\fBinode_number\fP
The inode number for the data (body) file.
.TP
\fBnext_delivery_time\fP
Earliest time of next delivery attempt.
.TP
\fBnum_delivery_attempts\fP
Number of delivery attempts that have been made.
.TP
\fBmacro\fP
Defined macro.
.TP
\fBmessage\fP
Envelope status message.
.TP
\fBoriginal_recipient\fP
Original recipient (ORCPT= parameter).
.TP
\fBpriority\fP
Adjusted priority of message.
.TP
\fBrecipient\fP
Array of character flags followed by colon and recipient name. Flags:
.PD 0
.RS +8
.TP 8
N
Has NOTIFY= parameter.
.TP 8
S
Success DSN requested.
.TP 8
F
Failure DSN requested.
.TP 8
D
Delay DSN requested.
.TP 8
P
Primary address (not the result of alias/forward expansion).
.PD
.RE
.TP
\fBsender\fP
Sender
.TP
\fBversion\fP
Version of control file.
.SH EXAMPLES
.TP
\fBqtool.pl q2 q1\fP
Moves all of the queue files in queue q1 to queue q2.
.TP
\fBqtool.pl q2 q1/d6CLQh100847\fP
Moves the message with id d6CLQh100847 in queue q1 to queue q2.
.TP
\fBqtool.pl q2 q1/qfd6CLQh100847\fP
Moves the message with id d6CLQh100847 in queue q1 to queue q2.
.TP
\fBqtool.pl q2 q1/dfd6CLQh100847\fP
Moves the message with id d6CLQh100847 in queue q1 to queue q2.
.TP
\fBqtool.pl -e '$msg{num_delivery_attempts} == 3' /q2 /q1\fP
Moves all of the queue files that have had three attempted deliveries from
queue q1 to queue q2.
.SH SEE ALSO
sendmail(8)
.SH HISTORY
The
.B qtool
command appeared in
sendmail 8.10.
|