source: trunk/third/sendmail/contrib/qtool.8 @ 19204

Revision 19204, 6.0 KB checked in by zacheiss, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r19203, which included commits to RCS files with non-trunk default branches.
Line 
1.\" Copyright (c) 1999, 2001-2002 Sendmail, Inc. and its suppliers.
2.\"      All rights reserved.
3.\"
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.
7.\"
8.\"
9.\"     $Id: qtool.8,v 1.1.1.1 2003-04-08 15:06:53 zacheiss Exp $
10.\"
11.TH QTOOL 8 "$Date: 2003-04-08 15:06:53 $"
12.SH NAME
13qtool
14\- manipulate sendmail queues
15.SH SYNOPSIS
16.B qtool.pl
17.RB [options]
18target_directory source [source ...]
19.PP
20.B qtool.pl [-Q][-d|-b]
21.RB [options]
22source [source ...]
23.SH DESCRIPTION
24.B Qtool
25moves the queue files used by sendmail between queues. It uses the same
26locking mechanism as sendmail so can be safely used while sendmail is
27running.
28However, it should not be used when queue groups have been configured
29to move queue files into directories to which they do not belong according
30to the queue group selections made in the sendmail.cf file.
31Unless you are absolutely sure you do not interfere with the queue group
32selection mechanism, do not move queue files around.
33.PP
34With no options,
35.B qtool
36will move any queue files as specified by \fIsource\fP into
37\fItarget_directory\fP. \fISource\fP can be either an individual
38queue control file, a queue file id, or a queue directory.
39.PP
40If the -d option is specified, qtool will delete the messages specified by
41source instead of moving them.
42.PP
43If the -b option is specified, the selected messages will be bounced by
44running sendmail with the -OTimeout.queuereturn=now option.
45.SS Options
46.TP
47\fB\-b\fP
48Bounce all of the messages specified by source. The messages will be bounced
49immediately. No attempt will be made to deliver the messages.
50.TP
51\fB\-C\fP configfile
52Specify the sendmail config file.
53Defaults to /etc/mail/sendmail.cf.
54.TP
55\fB\-d\fP
56Delete all of the messages specified by source.
57.TP
58\fB\-e\fP \fIperl_expression\fP
59Evalute \fIperl_expression\fP for each queue file as specified
60by \fIsource\fP. If \fIperl_expression\fP evaluates to true, then that
61queue file is moved. See below for more detail on \fIperl_expression\fP.
62.TP
63\fB\-Q\fP
64Operate on quarantined items
65(queue control file begins with hf instead of qf).
66.TP
67\fB\-s\fP \fIseconds\fP
68Move only the queue files specified by \fIsource\fP that have a
69modification time older than \fIseconds\fP.
70.SS Perl Expressions
71You can use any valid perl expression. Inside the expression you have
72access to a hash that contains many of the fields in the control file as
73well as some other data about that queued message. The hash is called
74\fI%msg\fP. If a field has multiple values (e.g. 'Recipient'), it will be
75returned as an array, otherwise it will be returned as a scalar. Through
76\fI%msg\fP, you can access the following variables:
77.TP
78\fBauth\fP
79AUTH= parameter.
80.TP
81\fBbody_type\fP
82Body type (\fB8BITMIME\fP, \fB7BIT\fP, or undefined).
83.TP
84\fBbody_last_mod_time\fP
85The last time the body was modified since the epoch in seconds.
86.TP
87\fBbody_size\fP
88The size of the body file in bytes.
89.TP
90\fBcontent-length\fP
91Content-Length: header value (Solaris sendmail only).
92.TP
93\fBcontrolling_user\fP
94The controlling user.
95.TP
96\fBcontrol_last_mod_time\fP
97The last time the control file was modified since the epoch in seconds.
98.TP
99\fBcontrol_size\fP
100The size of the control file in bytes.
101.TP
102\fBcreation_time\fP
103The time when the control file was created.
104.TP
105\fBcurrent_delay\fP
106Current delay for queue delay algorithm if _FFR_QUEUEDELAY is enabled.
107.TP
108\fBdata_file_name\fP
109The data file name (deprecated).
110.TP
111\fBdeliver_by\fP
112Deliver by flag and deadline for DELIVERBY ESMTP extension.
113.TP
114\fBenvid\fP
115Original envelope id form ESMTP.
116.TP
117\fBerror_recipient\fP
118The error recipient (deprecated).
119.TP
120\fBfinal_recipient\fP
121Final recipient (for DSNs).
122.TP
123\fBflags\fP
124Array of characters that can be the following values:
125.PD 0
126.RS +8
127.TP 8
128w
129warning message has been sent
130.TP 8
131r
132This is an error response or DSN
133.TP 8
1348
135has 8 bit data in body
136.TP 8
137b
138delete Bcc: headers
139.TP 8
140d
141envelope has DSN RET= parameter
142.TP 8
143n
144don't return body
145.PD
146.RE
147.TP
148\fBheaders\fP
149This is a Perl hash where the keys are rfc822 field names and the values
150are rfc822 field values. If a field has only one value it will be returned
151as a string. If a field has more than one value (e.g. 'Received') it will
152be returned as a list of strings.
153.TP
154\fBinode_number\fP
155The inode number for the data (body) file.
156.TP
157\fBnext_delivery_time\fP
158Earliest time of next delivery attempt.
159.TP
160\fBnum_delivery_attempts\fP
161Number of delivery attempts that have been made.
162.TP
163\fBmacro\fP
164Defined macro.
165.TP
166\fBmessage\fP
167Envelope status message.
168.TP
169\fBoriginal_recipient\fP
170Original recipient (ORCPT= parameter).
171.TP
172\fBpriority\fP
173Adjusted priority of message.
174.TP
175\fBquarantine_reason\fP
176Quarantine reason for quarantined (held) envelopes if _FFR_QUARANTINE is
177enabled.
178.TP
179\fBqueue_delay\fP
180Queue delay algorithm if _FFR_QUEUEDELAY is enabled.
181.TP
182\fBrecipient\fP
183Array of character flags followed by colon and recipient name. Flags:
184.PD 0
185.RS +8
186.TP 8
187N
188Has NOTIFY= parameter.
189.TP 8
190S
191Success DSN requested.
192.TP 8
193F
194Failure DSN requested.
195.TP 8
196D
197Delay DSN requested.
198.TP 8
199P
200Primary address (not the result of alias/forward expansion).
201.PD
202.RE
203.TP
204\fBsender\fP
205Sender
206.TP
207\fBversion\fP
208Version of control file.
209.SH EXAMPLES
210.TP
211\fBqtool.pl q2 q1\fP
212Moves all of the queue files in queue q1 to queue q2.
213.TP
214\fBqtool.pl q2 q1/d6CLQh100847\fP
215Moves the message with id d6CLQh100847 in queue q1 to queue q2.
216.TP
217\fBqtool.pl q2 q1/qfd6CLQh100847\fP
218Moves the message with id d6CLQh100847 in queue q1 to queue q2.
219.TP
220\fBqtool.pl -e '$msg{num_delivery_attempts} == 3' /q2 /q1\fP
221Moves all of the queue files that have had three attempted deliveries from
222queue q1 to queue q2.
223.SH BUGS
224In sendmail 8.12, it is possible for a message's queue and data files (df)
225to be stored in different queues.
226In this situation, you must give qtool the pathname of the queue file,
227not of the data file (df).
228To be safe, never feed qtool the pathname of a data file (df).
229.SH SEE ALSO
230sendmail(8)
231.SH HISTORY
232The
233.B qtool
234command appeared in
235sendmail 8.10.
Note: See TracBrowser for help on using the repository browser.