.code
exim -bp
.endd
-The &*-C*& option is used to specify an alternate &_exim.conf_& which might
-contain alternate exim configuration the queue management might be using.
-
to obtain a queue listing, and then greps the output to select messages
that match given criteria. The following selection options are available:
Include delivered recipients in queue listing.
.endlist
+The following options give alternates for configuration:
+
+.vlist
+.vitem &*-C*&&~<&'config file'&>
+is used to specify an alternate &_exim.conf_& which might
+contain alternate exim configuration the queue management might be using.
+
+.vitem &*-E*&&~<&'path'&>
+can be used to specify a path for the exim binary,
+overriding the built-in one.
+.endlist
+
There is one more option, &%-h%&, which outputs a list of options.
+.new
+At least one selection option, or either the &*-c*& or &*-h*& option, must be given.
+.wen
exit 0;
}
-if (!getopts('hf:r:y:o:s:C:zxlibRcaG:',\%opt) { &help; exit;}
-if ($ARGV[0]) { &help; exit;}
-if ($opt{h}) { &help; exit;}
+if (!getopts('hf:r:y:o:s:C:zxlibRcaG:E:',\%opt)) { &help; exit; }
+if ($opt{h}) { &help; exit; }
+if ($ARGV[0] || !($opt{f} || $opt{r} || $opt{s} || $opt{y} || $opt{o} || $opt{z} || $opt{x} || $opt{c}))
+ { &help; exit(1); }
if ($opt{a}) { $eargs = '-bp'; }
if ($opt{C} && -e $opt{C} && -f $opt{C} && -R $opt{C}) { $eargs .= ' -C '.$opt{C}; }
if ($opt{G}) { $eargs .= ' -qG'.$opt{G}; }
+if ($opt{E}) { $exim = $opt{E}; }
# Read message queue output into hash
&collect();
-h This help message.
-C Specify which exim.conf to use.
+ -E Specify exim binary to use.
Selection criteria:
-f <regexp> Match sender address sender (field is "< >" wrapped)
on the current mainlog file.
+ exiqgrep <data>
+
+This command runs the exiqgrep utility with the given options
+on the current spool directory.
+
+
gnutls
This command is present at the start of all but one of the tests that use
}
+# The "exiqgrep" command runs exiqgrep on the current spool
+
+if (/^exiqgrep(\s+.*)?/)
+ {
+ run_system("(./eximdir/exiqgrep -E ./eximdir/exim -C $parm_cwd/test-config" . ($1 || '') . ";" .
+ "echo exiqgrep exit code = \$?)" .
+ ">>test-stdout");
+ return 1;
+ }
+
+
# The "eximstats" command runs eximstats on the current mainlog
if (/^eximstats\s+(.*)/)
$dbm_build_deleted = 1;
}
-foreach my $tool (qw(exim_dumpdb exim_lock exinext exigrep eximstats)) {
+foreach my $tool (qw(exim_dumpdb exim_lock exinext exigrep eximstats exiqgrep)) {
cp("$parm_exim_dir/$tool" => "eximdir/$tool")
or tests_exit(-1, "Failed to make a copy of $tool: $!");
}
# Collect some version information
print '-' x 78, "\n";
print "Perl version for runtest: $]\n";
-foreach (map { "./eximdir/$_" } qw(exigrep exinext eximstats)) {
+foreach (map { "./eximdir/$_" } qw(exigrep exinext eximstats exiqgrep)) {
# fold (or unfold?) multiline output into a one-liner
print join(', ', map { chomp; $_ } `$_ --version`), "\n";
}
exim -odq a b c
.
****
+# Check that exiqgrep does not fall over, refuses no selectors, and can count.
+exiqgrep -h
+exiqgrep -r '[bc]'
+exiqgrep
+exiqgrep -c -r a
+exiqgrep -c
#
# a slow server as a test target
exim -DSERVER=server -bd -oX PORT_D
--- /dev/null
+Exim message queue display utility.
+
+ -h This help message.
+ -C Specify which exim.conf to use.
+ -E Specify exim binary to use.
+
+Selection criteria:
+ -f <regexp> Match sender address sender (field is "< >" wrapped)
+ -r <regexp> Match recipient address
+ -s <regexp> Match against the size field from long output
+ -y <seconds> Message younger than
+ -o <seconds> Message older than
+ -z Frozen messages only (exclude non-frozen)
+ -x Non-frozen messages only (exclude frozen)
+ -G <queuename> Match in given queue only
+
+[ NB: for regexps, provided string sits in /<string>/ ]
+
+Display options:
+ -c Display match count
+ -l Long Format [Default]
+ -i Message IDs only
+ -b Brief Format
+ -R Reverse order
+ -a All recipients (including delivered)
+exiqgrep exit code = 0
+ 0m sss 10HmaX-0005vi-00 <CALLER@test.ex>
+ a@test.ex
+ b@test.ex
+ c@test.ex
+
+exiqgrep exit code = 0
+Exim message queue display utility.
+
+ -h This help message.
+ -C Specify which exim.conf to use.
+ -E Specify exim binary to use.
+
+Selection criteria:
+ -f <regexp> Match sender address sender (field is "< >" wrapped)
+ -r <regexp> Match recipient address
+ -s <regexp> Match against the size field from long output
+ -y <seconds> Message younger than
+ -o <seconds> Message older than
+ -z Frozen messages only (exclude non-frozen)
+ -x Non-frozen messages only (exclude frozen)
+ -G <queuename> Match in given queue only
+
+[ NB: for regexps, provided string sits in /<string>/ ]
+
+Display options:
+ -c Display match count
+ -l Long Format [Default]
+ -i Message IDs only
+ -b Brief Format
+ -R Reverse order
+ -a All recipients (including delivered)
+exiqgrep exit code = 1
+1 matches out of 1 messages
+exiqgrep exit code = 0
+1 matches out of 1 messages
+exiqgrep exit code = 0