Provided by: sendmail-base_8.17.1.9-1_all bug


       qtool - manipulate sendmail queues

SYNOPSIS [options] target_directory source [source ...] [-Q][-d|-b] [options] source [source ...]


       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.  However, it should
       not be used when queue groups have been configured to move queue files into directories to
       which they do not belong according to the queue group selections made in  the
       file.   Unless you are absolutely sure you do not interfere with the queue group selection
       mechanism, do not move queue files around.

       With  no  options,  qtool  will  move  any  queue  files  as  specified  by  source   into
       target_directory.  Source can be either an individual queue control file, a queue file id,
       or a queue directory.

       If the -d option is specified, qtool will delete the messages specified by source  instead
       of moving them.

       If  the  -b option is specified, the selected messages will be bounced by running sendmail
       with the -OTimeout.queuereturn=now option.

       -b     Bounce all of the messages specified  by  source.  The  messages  will  be  bounced
              immediately. No attempt will be made to deliver the messages.

       -C configfile
              Specify the sendmail config file.  Defaults to /etc/mail/

       -d     Delete all of the messages specified by source.

       -e perl_expression
              Evaluate   perl_expression   for  each  queue  file  as  specified  by  source.  If
              perl_expression evaluates to true, then that queue file is  moved.  See  below  for
              more detail on perl_expression.

       -Q     Operate on quarantined items (queue control file begins with hf instead of qf).

       -s seconds
              Move  only  the queue files specified by source that have a modification time older
              than seconds.

   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  %msg.  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 %msg, you can access the following variables:

       auth   AUTH= parameter.

              Body type (8BITMIME, 7BIT, or undefined).

              The last time the body was modified since the epoch in seconds.

              The size of the body file in bytes.

              Content-Length: header value (Solaris sendmail only).

              The controlling user.

              The last time the control file was modified since the epoch in seconds.

              The size of the control file in bytes.

              The time when the control file was created.

              The data file name (deprecated).

              Deliver by flag and deadline for DELIVERBY ESMTP extension.

       envid  Original envelope id form ESMTP.

              The error recipient (deprecated).

              Final recipient (for DSNs).

       flags  Array of characters that can be the following values:
               w       warning message has been sent
               r       This is an error response or DSN
               8       has 8 bit data in body
               b       delete Bcc: headers
               d       envelope has DSN RET= parameter
               n       don't return body

              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

              The inode number for the data (body) file.

              Earliest time of next delivery attempt.

              Number of delivery attempts that have been made.

       macro  Defined macro.

              Envelope status message.

              Original recipient (ORCPT= parameter).

              Adjusted priority of message.

              Quarantine reason for quarantined (held) envelopes.

              Array of character flags followed by colon and recipient name. Flags:
               N       Has NOTIFY= parameter.
               S       Success DSN requested.
               F       Failure DSN requested.
               D       Delay DSN requested.
               P       Primary address (not the result of alias/forward expansion).

       sender Sender

              Version of control file.

              Moves all of the queue files in queue q1 to queue q2. q2 q1/d6CLQh100847
              Moves the message with id d6CLQh100847 in queue q1 to queue q2. q2 q1/qfd6CLQh100847
              Moves the message with id d6CLQh100847 in queue q1 to queue q2. -e '$msg{num_delivery_attempts} == 3' /q2 /q1
              Moves all of the queue files that have had three attempted deliveries from queue q1
              to queue q2.


       In sendmail 8.12, it is possible for a message's queue and data files (df) to be stored in
       different  queues.  In this situation, you must give qtool the pathname of the queue file,
       not of the data file (df).  To be safe, never feed qtool the pathname of a data file (df).




       The qtool command appeared in sendmail 8.10.

                                   $Date: 2013-11-22 20:51:18 $                          QTOOL(8)