X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/209e806ce1bf13554bf7a5cfe161b83f0fbbab3a..a5ffa9b475a426bc73366db01f7cc92a3811bc3a:/src/src/exiqgrep.src diff --git a/src/src/exiqgrep.src b/src/src/exiqgrep.src index 05c1b9ed0..d900e9933 100644 --- a/src/src/exiqgrep.src +++ b/src/src/exiqgrep.src @@ -18,6 +18,7 @@ # Version 1.2 use strict; +BEGIN { pop @INC if $INC[-1] eq '.' }; use Getopt::Std; # Have this variable point to your exim binary. @@ -43,9 +44,11 @@ if ($^O eq 'darwin') { # aka MacOS X $base = 62; }; -getopts('hf:r:y:o:s:zxlibRca',\%opt); +getopts('hf:r:y:o:s:C:zxlibRca',\%opt); +if ($ARGV[0]) { &help; exit;} if ($opt{h}) { &help; exit;} if ($opt{a}) { $eargs = '-bp'; } +if ($opt{C} && -e $opt{C} && -f $opt{C} && -R $opt{C}) { $eargs .= ' -C '.$opt{C}; } # Read message queue output into hash &collect(); @@ -61,6 +64,7 @@ sub help() { Exim message queue display utility. -h This help message. + -C Specify which exim.conf to use. Selection criteria: -f Match sender address sender (field is "< >" wrapped) @@ -84,7 +88,7 @@ EOF } sub collect() { - open(QUEUE,"$exim $eargs |") or die("Error openning pipe: $!\n"); + open(QUEUE,"$exim $eargs |") or die("Error opening pipe: $!\n"); while() { chomp(); my $line = $_;