X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fexiqgrep.src;h=d900e99337a49be8709277bae1eb0d203f34aa22;hb=b7d3afcfad94edf99a8dbc50ab670ded417e6bea;hp=94b17f58bbcf2b999591167178446727f06f4a43;hpb=8d91c6dcd2c16f9a84b7abf47d130bac1a8bb273;p=user%2Fhenk%2Fcode%2Fexim.git 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 = $_;