X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/d502442ac32f8964f6cf86469869cecb035d12c0..1ccd5f670a432f98e94b384dd169a1a760dced9a:/src/src/exiqgrep.src diff --git a/src/src/exiqgrep.src b/src/src/exiqgrep.src index 94b17f58b..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. @@ -44,9 +45,10 @@ if ($^O eq 'darwin') { # aka MacOS X }; 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}) { $eargs .= ' -C '.$opt{C}; } +if ($opt{C} && -e $opt{C} && -f $opt{C} && -R $opt{C}) { $eargs .= ' -C '.$opt{C}; } # Read message queue output into hash &collect(); @@ -86,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 = $_;