diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2002-04-10 03:05:00 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2002-04-10 03:05:00 +0000 |
commit | 9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84 (patch) | |
tree | 348e6162af337e0b74db963f6e4dcc567e2f99e9 /contrib/sendmail/contrib/qtool.pl | |
parent | 1a7e50d796833cbb4346a251bc88555ea2c58e94 (diff) | |
download | FreeBSD-src-9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84.zip FreeBSD-src-9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84.tar.gz |
Import sendmail 8.12.3
Diffstat (limited to 'contrib/sendmail/contrib/qtool.pl')
-rwxr-xr-x | contrib/sendmail/contrib/qtool.pl | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/contrib/sendmail/contrib/qtool.pl b/contrib/sendmail/contrib/qtool.pl index d93f743a..08f808b 100755 --- a/contrib/sendmail/contrib/qtool.pl +++ b/contrib/sendmail/contrib/qtool.pl @@ -1,9 +1,9 @@ #!/usr/bin/env perl ## -## Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. +## Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. ## All rights reserved. ## -## $Id: qtool.pl,v 8.26 2001/11/21 19:26:17 gshapiro Exp $ +## $Id: qtool.pl,v 8.27 2002/01/29 21:55:49 ca Exp $ ## use strict; use File::Basename; @@ -18,6 +18,11 @@ use Getopt::Std; ## pretty similar to just moving the files manually, but it locks the files ## the same way sendmail does to prevent problems. ## +## NOTICE: Do not use this program to move queue files around +## if you use sendmail 8.12 and multiple queue groups. It may interfere +## with sendmail's internal queue group selection strategy and can cause +## mail to be not delivered. +## ## The syntax is the reverse of mv (ie. the target argument comes ## first). This lets you pick the files you want to move using find and ## xargs. @@ -62,6 +67,7 @@ my $result; my $action; my $new_condition; my $qprefix; +my $queuegroups = 0; my $conditions = new Compound(); Getopt::Std::getopts('bC:de:Qs:', \%opts); @@ -147,6 +153,10 @@ my $queue_root; my $line; open(CONFIG_FILE, $config_file) or die "$config_file: $!"; + + ## Notice: we can only break out of this loop (using last) + ## when both entries (queue directory and group group) + ## have been found. while ($line = <CONFIG_FILE>) { chomp $line; @@ -157,7 +167,26 @@ my $queue_root; { $queue_root = $1; } - last; + # found also queue groups? + if ($queuegroups) + { + last; + } + } + if ($line =~ m/^Q.*/) + { + $queuegroups = 1; + if ($action == \&move_action) + { + print("WARNING: moving queue files around " . + "when queue groups are used may\n" . + "result in undelivered mail!\n"); + } + # found also queue directory? + if (defined $queue_root) + { + last; + } } } close(CONFIG_FILE); |