OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / sendmail / original / man8 / qtool.8
1 .\" Copyright (c) 1999 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 8.12 2000/12/15 19:53:35 gshapiro Exp $
10 .\"
11 .TH QTOOL 8 "$Date: 2000/12/15 19:53:35 $"
12 .SH NAME
13 qtool
14 \- manipulate sendmail queues
15 .SH SYNOPSIS
16 .B qtool.pl
17 .RB [options] 
18 target_directory source [source ...]
19 .PP
20 .B qtool.pl [-d|-b]
21 .RB [options]
22 source [source ...]
23 .SH DESCRIPTION
24 .B Qtool
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
27 running.
28 .PP
29 With no options,
30 .B qtool
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.
34 .PP
35 If the -d option is specified, qtool will delete the messages specified by
36 source instead of moving them.
37 .PP
38 If the -b option is specified, the selected messages will be bounced by
39 running sendmail with the -OTimeout.queuereturn=now option.
40 .SS Options
41 .TP  
42 \fB\-b\fP
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.
45 .TP  
46 \fB\-C\fP configfile
47 Specify the sendmail config file.
48 Defaults to /etc/mail/sendmail.cf.
49 .TP
50 \fB\-d\fP
51 Delete all of the messages specified by source.
52 .TP  
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.
57 .TP 
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.
61 .SS Perl Expressions
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:
68 .TP
69 \fBauth\fP
70 AUTH= parameter.
71 .TP
72 \fBbody_type\fP
73 Body type (\fB8BITMIME\fP, \fB7BIT\fP, or undefined).
74 .TP
75 \fBbody_last_mod_time\fP
76 The last time the body was modified since the epoch in seconds.
77 .TP
78 \fBbody_size\fP
79 The size of the body file in bytes.
80 .TP
81 \fBcharset\fP
82 Character set (for future use).
83 .TP
84 \fBcontent-length\fP
85 Content-Length: header value (Solaris sendmail only).
86 .TP
87 \fBcontrolling_user\fP
88 The controlling user.
89 .TP
90 \fBcontrol_last_mod_time\fP
91 The last time the body was modified since the epoch in seconds.
92 .TP
93 \fBcontrol_size\fP
94 The size of the control file in bytes.
95 .TP
96 \fBcreation_time\fP
97 The time when the control file was created.
98 .TP
99 \fBdata_file_name\fP
100 The data file name (deprecated).
101 .TP
102 \fBenvid\fP
103 Original envelope id form ESMTP.
104 .TP
105 \fBerror_recipient\fP
106 The error recipient (deprecated).
107 .TP
108 \fBflags\fP
109 Array of characters that can be the following values:
110 .PD 0
111 .RS +8
112 .TP 8
113 w
114 warning message has been sent
115 .TP 8
116 r
117 This is an error respone or DSN
118 .TP 8
119 8
120 has 8 bit data in body
121 .TP 8
122 b
123 delete Bcc: headers
124 .TP 8
125 d
126 envelope has DSN RET= parameter
127 .TP 8
128 n
129 don't return body
130 .PD
131 .RE
132 .TP
133 \fBheaders\fP
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.
138 .TP
139 \fBinode_number\fP
140 The inode number for the data (body) file.
141 .TP
142 \fBnext_delivery_time\fP
143 Earliest time of next delivery attempt.
144 .TP
145 \fBnum_delivery_attempts\fP
146 Number of delivery attempts that have been made.
147 .TP
148 \fBmacro\fP
149 Defined macro.
150 .TP
151 \fBmessage\fP
152 Envelope status message.
153 .TP
154 \fBoriginal_recipient\fP
155 Original recipient (ORCPT= parameter).
156 .TP
157 \fBpriority\fP
158 Adjusted priority of message.
159 .TP
160 \fBrecipient\fP
161 Array of character flags followed by colon and recipient name. Flags:
162 .PD 0
163 .RS +8
164 .TP 8
165 N
166 Has NOTIFY= parameter.
167 .TP 8
168 S
169 Success DSN requested.
170 .TP 8
171 F
172 Failure DSN requested.
173 .TP 8
174 D
175 Delay DSN requested.
176 .TP 8
177 P
178 Primary address (not the result of alias/forward expansion).
179 .PD
180 .RE
181 .TP
182 \fBsender\fP
183 Sender
184 .TP
185 \fBversion\fP
186 Version of control file.
187 .SH EXAMPLES
188 .TP
189 \fBqtool.pl q2 q1\fP
190 Moves all of the queue files in queue q1 to queue q2.
191 .TP
192 \fBqtool.pl q2 q1/d6CLQh100847\fP
193 Moves the message with id d6CLQh100847 in queue q1 to queue q2.
194 .TP
195 \fBqtool.pl q2 q1/qfd6CLQh100847\fP
196 Moves the message with id d6CLQh100847 in queue q1 to queue q2.
197 .TP
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.
201 .SH BUGS
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,
205 not of the df file.
206 To be safe, never feed qtool the pathname of a df file.
207 .SH SEE ALSO
208 sendmail(8)
209 .SH HISTORY
210 The
211 .B qtool
212 command appeared in 
213 sendmail 8.10.